FieldChar

Inheritance: java.lang.Object, com.aspose.words.Node, com.aspose.words.Inline, com.aspose.words.SpecialChar

public abstract class FieldChar extends SpecialChar

Base class for nodes that represent field characters in a document.

To learn more, visit the Working with Fields documentation article.

A complete field in a Microsoft Word document is a complex structure consisting of a field start character, field code, field separator character, field result and field end character. Some fields only have field start, field code and field end.

To easily insert a new field into a document, use the DocumentBuilder.insertField(java.lang.String) method.

Constructors

Constructor Description
FieldChar()

Methods

Method Description
accept(DocumentVisitor visitor) Accepts a visitor.
clearRunAttrs()
dd()
deepClone(boolean isCloneChildren) Creates a duplicate of the node.
equals(Object arg0)
fetchInheritedRunAttr(int fontAttr)
getAncestor(int ancestorType)
getAncestor(Class ancestorType) Gets the first ancestor of the specified object type.
getClass()
getCustomNodeId() Specifies custom node identifier.
getDirectRunAttr(int key)
getDirectRunAttr(int key, int revisionsView)
getDocument() Gets the document to which this node belongs.
getDocument_IInline()
getField() Returns a field for the field char.
getFieldType() Returns the type of the field.
getFont() Provides access to the font formatting of this object.
getNextSibling() Gets the node immediately following this node.
getNodeType() Returns NodeType.SPECIAL_CHAR.
getParentNode() Gets the immediate parent of this node.
getParentParagraph() Retrieves the parent Paragraph of this node.
getParentParagraph_IInline()
getPreviousSibling() Gets the node immediately preceding this node.
getRange() Returns a Range object that represents the portion of a document that is contained in this node.
getText() Gets the special character that this node represents.
hashCode()
isComposite() Returns true if this node can contain other nodes.
isDeleteRevision() Returns true if this object was deleted in Microsoft Word while change tracking was enabled.
isDirty() Gets whether the current result of the field is no longer correct (stale) due to other modifications made to the document.
isDirty(boolean value) Sets whether the current result of the field is no longer correct (stale) due to other modifications made to the document.
isFormatRevision() Returns true if formatting of the object was changed in Microsoft Word while change tracking was enabled.
isInsertRevision() Returns true if this object was inserted in Microsoft Word while change tracking was enabled.
isLocked() Gets whether the parent field is locked (should not recalculate its result).
isLocked(boolean value) Sets whether the parent field is locked (should not recalculate its result).
isMoveFromRevision() Returns true if this object was moved (deleted) in Microsoft Word while change tracking was enabled.
isMoveToRevision() Returns true if this object was moved (inserted) in Microsoft Word while change tracking was enabled.
nextPreOrder(Node rootNode) Gets next node according to the pre-order tree traversal algorithm.
nodeTypeToString(int nodeType)
notify()
notifyAll()
previousPreOrder(Node rootNode) Gets the previous node according to the pre-order tree traversal algorithm.
remove() Removes itself from the parent.
removeMoveRevisions()
removeRunAttr(int key)
setCustomNodeId(int value) Specifies custom node identifier.
setRunAttr(int fontAttr, Object value)
toString()
toString(SaveOptions saveOptions) Exports the content of the node into a string using the specified save options.
toString(int saveFormat)
wait()
wait(long arg0)
wait(long arg0, int arg1)

FieldChar()

public FieldChar()

accept(DocumentVisitor visitor)

public boolean accept(DocumentVisitor visitor)

Accepts a visitor.

Calls DocumentVisitor.visitSpecialChar(com.aspose.words.SpecialChar).

For more info see the Visitor design pattern.

Parameters:

Parameter Type Description
visitor DocumentVisitor The visitor that will visit the node.

Returns: boolean - { false if the visitor requested the enumeration to stop.

clearRunAttrs()

public void clearRunAttrs()

dd()

public void dd()

deepClone(boolean isCloneChildren)

public Node deepClone(boolean isCloneChildren)

Creates a duplicate of the node.

This method serves as a copy constructor for nodes. The cloned node has no parent, but belongs to the same document as the original node.

This method always performs a deep copy of the node. The isCloneChildren parameter specifies whether to perform copy all child nodes as well.

Parameters:

Parameter Type Description
isCloneChildren boolean True to recursively clone the subtree under the specified node; false to clone only the node itself.

Returns: Node - The cloned node.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

Parameter Type Description
arg0 java.lang.Object

Returns: boolean

fetchInheritedRunAttr(int fontAttr)

public Object fetchInheritedRunAttr(int fontAttr)

Parameters:

Parameter Type Description
fontAttr int

Returns: java.lang.Object

getAncestor(int ancestorType)

public CompositeNode getAncestor(int ancestorType)

Parameters:

Parameter Type Description
ancestorType int

Returns: CompositeNode

getAncestor(Class ancestorType)

public CompositeNode getAncestor(Class ancestorType)

Gets the first ancestor of the specified object type.

Parameters:

Parameter Type Description
ancestorType java.lang.Class The object type of the ancestor to retrieve.

Returns: CompositeNode - The ancestor of the specified type or null if no ancestor of this type was found.

The ancestor type matches if it is equal to ancestorType or derived from ancestorType .

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getCustomNodeId()

public int getCustomNodeId()

Specifies custom node identifier.

Default is zero.

This identifier can be set and used arbitrarily. For example, as a key to get external data.

Important note, specified value is not saved to an output file and exists only during the node lifetime.

Returns: int - The corresponding int value.

getDirectRunAttr(int key)

public Object getDirectRunAttr(int key)

Parameters:

Parameter Type Description
key int

Returns: java.lang.Object

getDirectRunAttr(int key, int revisionsView)

public Object getDirectRunAttr(int key, int revisionsView)

Parameters:

Parameter Type Description
key int
revisionsView int

Returns: java.lang.Object

getDocument()

public DocumentBase getDocument()

Gets the document to which this node belongs.

The node always belongs to a document even if it has just been created and not yet added to the tree, or if it has been removed from the tree.

Returns: DocumentBase - The document to which this node belongs.

getDocument_IInline()

public DocumentBase getDocument_IInline()

Returns: DocumentBase

getField()

public Field getField()

Returns a field for the field char. A new Field object is created each time the method is called.

Returns: Field - A field for the field char.

getFieldType()

public int getFieldType()

Returns the type of the field.

Returns: int - The type of the field. The returned value is one of FieldType constants.

getFont()

public Font getFont()

Provides access to the font formatting of this object.

Returns: Font - The corresponding Font value.

getNextSibling()

public Node getNextSibling()

Gets the node immediately following this node. If there is no next node, a null is returned.

Returns: Node - The node immediately following this node.

getNodeType()

public int getNodeType()

Returns NodeType.SPECIAL_CHAR.

Returns: int - {NodeType.SPECIAL_CHAR. The returned value is one of NodeType constants.

getParentNode()

public CompositeNode getParentNode()

Gets the immediate parent of this node.

If a node has just been created and not yet added to the tree, or if it has been removed from the tree, the parent is null .

Returns: CompositeNode - The immediate parent of this node.

getParentParagraph()

public Paragraph getParentParagraph()

Retrieves the parent Paragraph of this node.

Returns: Paragraph - The corresponding Paragraph value.

getParentParagraph_IInline()

public Paragraph getParentParagraph_IInline()

Returns: Paragraph

getPreviousSibling()

public Node getPreviousSibling()

Gets the node immediately preceding this node. If there is no preceding node, a null is returned.

Returns: Node - The node immediately preceding this node.

getRange()

public Range getRange()

Returns a Range object that represents the portion of a document that is contained in this node.

Returns: Range - A Range object that represents the portion of a document that is contained in this node.

getText()

public String getText()

Gets the special character that this node represents.

Returns: java.lang.String - The string that contains the character that this node represents.

hashCode()

public native int hashCode()

Returns: int

isComposite()

public boolean isComposite()

Returns true if this node can contain other nodes. (31574,6)

Returns: boolean - { true if this node can contain other nodes.

isDeleteRevision()

public boolean isDeleteRevision()

Returns true if this object was deleted in Microsoft Word while change tracking was enabled.

Returns: boolean - True if this object was deleted in Microsoft Word while change tracking was enabled.

isDirty()

public boolean isDirty()

Gets whether the current result of the field is no longer correct (stale) due to other modifications made to the document.

Returns: boolean - Whether the current result of the field is no longer correct (stale) due to other modifications made to the document.

isDirty(boolean value)

public void isDirty(boolean value)

Sets whether the current result of the field is no longer correct (stale) due to other modifications made to the document.

Parameters:

Parameter Type Description
value boolean Whether the current result of the field is no longer correct (stale) due to other modifications made to the document.

isFormatRevision()

public boolean isFormatRevision()

Returns true if formatting of the object was changed in Microsoft Word while change tracking was enabled.

Returns: boolean - True if formatting of the object was changed in Microsoft Word while change tracking was enabled.

isInsertRevision()

public boolean isInsertRevision()

Returns true if this object was inserted in Microsoft Word while change tracking was enabled.

Returns: boolean - True if this object was inserted in Microsoft Word while change tracking was enabled.

isLocked()

public boolean isLocked()

Gets whether the parent field is locked (should not recalculate its result).

Returns: boolean - Whether the parent field is locked (should not recalculate its result).

isLocked(boolean value)

public void isLocked(boolean value)

Sets whether the parent field is locked (should not recalculate its result).

Parameters:

Parameter Type Description
value boolean Whether the parent field is locked (should not recalculate its result).

isMoveFromRevision()

public boolean isMoveFromRevision()

Returns true if this object was moved (deleted) in Microsoft Word while change tracking was enabled.

Returns: boolean - { true if this object was moved (deleted) in Microsoft Word while change tracking was enabled.

isMoveToRevision()

public boolean isMoveToRevision()

Returns true if this object was moved (inserted) in Microsoft Word while change tracking was enabled.

Returns: boolean - { true if this object was moved (inserted) in Microsoft Word while change tracking was enabled.

nextPreOrder(Node rootNode)

public Node nextPreOrder(Node rootNode)

Gets next node according to the pre-order tree traversal algorithm.

Parameters:

Parameter Type Description
rootNode Node The top node (limit) of traversal.

Returns: Node - Next node in pre-order order. Null if reached the rootNode .

nodeTypeToString(int nodeType)

public static String nodeTypeToString(int nodeType)

Parameters:

Parameter Type Description
nodeType int

Returns: java.lang.String

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

previousPreOrder(Node rootNode)

public Node previousPreOrder(Node rootNode)

Gets the previous node according to the pre-order tree traversal algorithm.

Parameters:

Parameter Type Description
rootNode Node The top node (limit) of traversal.

Returns: Node - Previous node in pre-order order. Null if reached the rootNode .

remove()

public void remove()

Removes itself from the parent.

removeMoveRevisions()

public void removeMoveRevisions()

removeRunAttr(int key)

public void removeRunAttr(int key)

Parameters:

Parameter Type Description
key int

setCustomNodeId(int value)

public void setCustomNodeId(int value)

Specifies custom node identifier.

Default is zero.

This identifier can be set and used arbitrarily. For example, as a key to get external data.

Important note, specified value is not saved to an output file and exists only during the node lifetime.

Parameters:

Parameter Type Description
value int The corresponding int value.

setRunAttr(int fontAttr, Object value)

public void setRunAttr(int fontAttr, Object value)

Parameters:

Parameter Type Description
fontAttr int
value java.lang.Object

toString()

public String toString()

Returns: java.lang.String

toString(SaveOptions saveOptions)

public String toString(SaveOptions saveOptions)

Exports the content of the node into a string using the specified save options.

Parameters:

Parameter Type Description
saveOptions SaveOptions Specifies the options that control how the node is saved.

Returns: java.lang.String - The content of the node in the specified format.

toString(int saveFormat)

public String toString(int saveFormat)

Parameters:

Parameter Type Description
saveFormat int

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

Parameter Type Description
arg0 long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

Parameter Type Description
arg0 long
arg1 int