Class Element
- All Implemented Interfaces:
Peer
- Direct Known Subclasses:
ConfigurationElement
,DataModel.AttributeWrapper
,DataNode
,Document
,DSigData
,LayoutNode
,Model
,ModelPeer
,Packet
,Policy
,ProtoableNode
,RichTextNode
,SVGNode
,WSDLNode
Comment
and processing instructions
ProcessingInstruction
of a DOM,
lie outside the XFA schemas.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Interface that is implemented by classes that use a dual XFA/XML DOM.static enum
Specifies handling of existing node content when XML content is loaded.Nested classes/interfaces inherited from class com.adobe.xfa.Node
Node.ChangeLogger
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
Fields inherited from class com.adobe.xfa.Node
CREATE_ALWAYS_NEW, CREATE_IF_NOT_EXIST, CREATE_MUST_NOT_EXIST, CREATE_REPLACE, gsXFANamespacePrefix
Fields inherited from interface com.adobe.xfa.ut.Peer
ATTR_CHANGED, CHILD_ADDED, CHILD_REMOVED, DESCENDENT_ADDED, DESCENDENT_ATTR_CHANGED, DESCENDENT_REMOVED, DESCENDENT_VALUE_CHANGED, PARENT_CHANGED, PERMS_LOCK_CLEARED, PERMS_LOCK_SET, PROTO_ATTR_CHANGED, PROTO_CHILD_ADDED, PROTO_CHILD_REMOVED, PROTO_DESCENDENT_ADDED, PROTO_DESCENDENT_ATTR_CHANGED, PROTO_DESCENDENT_REMOVED, PROTO_DESCENDENT_VALUE_CHANGED, PROTO_VALUE_CHANGED, UPDATED, VALUE_CHANGED
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendChild
(Node child) void
appendChild
(Node child, boolean bValidate) Appends the given child to this element.final void
final void
final Node
assignNode
(String sSOMExpression, String sValue, int eMode) Assigns the value given to the node located by the given SOM (Scripting Object Model) expression and interpreted relative to this element's context.void
connectPeerToDocument() is used to rearrange the DOM tree when inserting or appending a node.constructKey
(List<String> nodeAddressList, Node namespaceContextNode) Constructs a key (either primary or foreign) for an element given a node address list.void
void
copyContent
(Element newNode, boolean deep) defaultAttribute
(int eTag) int
Returns the class tag of the default one-of child (if there is one)defaultElement
(int eTag, int nOccurrence) final String
final Arg
Evaluates a fragment of script.static void
explodeQName
(String aQName, StringHolder aPrefix, StringHolder aLocalName) final int
Find an attribute value by the combination of URI and name.final int
findSchemaAttr
(String name) Find an attribute value by name.final void
foundBadAttribute
(int eTag, String attrValue) final void
foundBadAttribute
(String attrName, String attrValue) final NodeList
getAll
(boolean bByName) Return the collection of like-named, in-scope, nodes.getAtom
(int eTag) get an attribute value, will return the default attribute value if none exist NON validatingfinal Attribute
getAttr
(int n) Gets this element's n'th attribute.getAttribute
(int eAttributeTag) Gets this element's attribute with the given tag.getAttribute
(int eTag, boolean bPeek, boolean bValidate) Gets this element's attribute whose attribute tag is given.getAttributeByName
(String aAttrName, boolean bSearchProto) get the named attribute.final int
getAttrIndex
(Attribute attr) get the index of this attribute.final String
getAttrName
(int index) final String
getAttrNS
(int index) final boolean
getAttrProp
(int attrIndex, int eProp) Get one of the volatile attribute properties.final String
getAttrQName
(int index) final String
getAttrVal
(int index) final ChildReln
getChildReln
(int eTag) final NodeList
Return the collection of like-class, in-scope, nodes.final int
Return the position of this node in its collection of like-class, in-scope, like-child relationship, nodes.final String
Gets this element's class name.void
Gets a collection of deltas to restore.getElement
(int eTag, boolean bPeek, int nOccurrence, boolean bReturnDefault, boolean bValidate) Gets this element's sub element whose element tag is given.final Element
getElement
(int eElementTag, int nOccurrence) get an element for a given node, The method will create a default if it doesn't exist.final int
final Element
getElementLocal
(int eTag, boolean bPeek, int nOccurrence, boolean bReturnDefault, boolean bValidate) This method does the work of getElement().final int
getEnum
(int ePropertyTag) final EnumAttr
getEventTable
(boolean bCreate) Gets this element's first XFA child.Gets this element's first XML child.final String
getID()
final int
getIndex
(boolean bByName) Return the position of this node in its collection of like-named, in-scope, like-child relationship, nodes.final String
Get our namespace by traversing to our ancestors if necessary.final String
Gets this element's installed locale.boolean
Determine if this node contains a null value.final Node
Gets this element's last XML child.final int
final Model
getModel()
Gets this element's model.getName()
Gets this element's name.final Node
getNode
(int eTag, int nOccurrence) A variant of getElement that peeks for a non-Element and returns it if it exists, otherwise falls back on getElement with bPeek = true (don't create a default).getNodes()
Gets this element's list of children.final NodeSchema
Gets the Schema for this node.getNS()
Gets this element's namespace.final int
Gets this element's number of attributes.final Node
In the case where an element may contain a "OneOf" child, this method will retrieve the child element that has the XFA::oneOfChild relationship to its parent.getOneOfChild
(boolean bPeek, boolean bReturnDefault) void
Get the processing instruction based on the aPiName.void
Get the processing instruction based on the aPiName.final String
Gets this element's namespace prefix.final Object
getProperty
(int ePropTag, int nOccurrence) Get a property for this node.final Object
getProperty
(String propertyName, int nOccurrence) string version of getProperty.boolean
int
getSchemaType
(int eTag) getScriptMethodInfo
(String sFunctionName) Gets the information on a script method.final Node
getSibling
(int index, boolean bByName, boolean bExceptionIfNotFound) a (not so) private method, overrides Node.getSibling()getText
(boolean bPeek, boolean bReturnDefault, boolean bValidate) Gets this element's text node child.final Node
getXFAChild
(int n) Gets this element's n'th XFA child.final Node
getXMLChild
(int n) Gets this element's n'th XML child.Gets this element's XML name.final boolean
final void
inhibitPrettyPrint
(boolean bInhibit) void
insertChild
(Node newChild, Node refNode, boolean bValidate) Inserts a child before a specific child in the child list.boolean
Check to see if this is a container object.void
isFragment
(boolean bFragment, boolean bSetChildren) Set the fragment state of this nodefinal boolean
isHidden()
Determine if this node is hidden or not.final void
isHidden
(boolean bHidden) Set the hidden state of this node.final boolean
final boolean
Determines if this element's installed locale is ambient.final boolean
isLeaf()
Check if this node is a leaf nodeboolean
Is this element's name namespaced.final boolean
isPropertySpecified
(int ePropTag, boolean bCheckProtos, int nOccurrence) Check if a specific property has been defined for this node.final boolean
isPropertySpecified
(String propertyName, boolean bCheckProtos, int nOccurrence) final boolean
isPropertyValid
(int ePropTag) Check if a specified property is valid according to the schema.boolean
isSpecified
(int eTag, boolean bCheckProtos, int nOccurrence) Check if a property, child, or oneOfChild has been defined for this nodeboolean
isSpecified
(int eTag, int eType, boolean bCheckProtos, int nOccurrence) final boolean
isSpecified
(String sPropertyName, boolean bCheckProtos, int nOccurrence) final void
isTransient
(boolean bTransient, boolean bSetChildren) Set the transient state of this node.boolean
boolean
isValidAttr
(int eTag, boolean bReport, String value) Determine if a specified attribute tag is valid for this node.boolean
isValidChild
(int eTag, int nError, boolean bBeforeInsert, boolean bOccurrenceErrorOnly) boolean
isValidElement
(int eTag, boolean bReport) void
loadXML
(InputStream is, boolean bIgnoreAggregatingTag, boolean bReplaceContent) Loads and appends the specified XML fragment (or document) to this element.void
loadXML
(InputStream is, boolean bIgnoreAggregatingTag, Element.ReplaceContent eReplaceContent) Loads and appends the specified XML fragment (or document) to this element.void
Mark this element as a default propertyvoid
makeNonDefault
(boolean bRecursive) Mark this element to indicate it is not a default propertynewAttribute
(int eTag, String value) void
optimizeNameSpace
(int eAttributeTag, boolean bDeleteIfNotNeeded) For use with attributes that live in a non-standard namespace.final Attribute
peekAttribute
(int eAttributeTag) get an attribute value only if it exists.final Element
peekElement
(int eElementTag, boolean bReturnDefault, int nOccurrence) get an element only if it exists NON validating READ ONLY VERSIONfinal Node
peekOneOfChild
(boolean bReturnDefault) Deprecated.final Object
peekProperty
(int ePropTag, int nOccurrence) final Object
peekProperty
(String propertyName, int nOccurrence) void
postSave()
void
preSave
(boolean bSaveXMLScript) void
privateSetName
(String name) This version will not perform any notification or undo steps.boolean
Determines whether child text nodes should be processed (check validity, consolidate) at parse time.final void
removeAttr
(int index) final void
removeAttr
(String URI, String name) Remove an attribute as specified by the combination of URI and name.final void
removeChild
(Node child) Removes a child from the child listfinal void
Remove all processing instruction based on the aPiName.final void
final void
Remove all #text children that consist of whitespacevoid
replaceChild
(Node newChild, Node oldChild) void
resolveAndEnumerateChildren
(boolean bAllProperties, boolean bFirstDefaultOnly) Construct a list of element-based properties and children.resolveNodeCreate
(String somNodesInput, int eAction, boolean bLeaf, boolean bDefault, boolean bNoProperties) resolvePrefix
(String aPrefix) void
saveFilteredXML
(NodeList nodeList, OutputStream outFile, DOMSaveOptions options) void
saveXML
(OutputStream outFile, DOMSaveOptions options) Serializes this element (and all its children) to an output stream.void
saveXML
(OutputStream outFile, DOMSaveOptions options, boolean bSaveXMLScript) Serializes this element (and all its children) to an output stream.void
serialize
(OutputStream outStream, DOMSaveOptions options, int level, Node prevSibling) The helper function used by saveXML()final void
setAttribute
(int eVal, int eTag) Sets (adds) an enumerated attribute value to this element.void
setAttribute
(Attribute attr, int eTag) Sets (adds) an attribute to this element.final Attribute
setAttribute
(String nameSpace, String qName, String localName, String value) Sets (adds) an attribute to this element.final Attribute
setAttribute
(String nameSpace, String qName, String localName, String value, boolean internSymbols) Sets (adds) an attribute to this element.final void
setAttrProp
(int attrIndex, int eProp, boolean bValue) Set one of the volatile attribute properties.void
setDefaultFlag
(boolean bDefaultNode, boolean bSetChildren) void
setDOMProperties
(String uri, String localName, String qName, Attributes attributes) All name properties (including those in attributes) must be interned strings.setElement
(Node child, int eTag, int nOccurrence) Set an element value.final void
setIsDataWindowRoot
(boolean bIsRoot) final void
setIsIndexed
(boolean bIsIndexed) Set whether this node has an XMLIDfinal void
setLineNumber
(int nLineNumber) void
setLocalName
(String name) Sets this element's local name.final void
Sets this element's model.void
Sets this element's name attribute.final void
Sets this element's children null namespace to the given uri.setOneOfChild
(Node child) In the case where an element may contain a "OneOf" child, this method will set the child element that has the XFA::oneOfChild relationship.final void
setProperty
(Object property, int ePropertyTag) Set a property for this node.final void
setProperty
(Object property, String propertyName) string version of setProperty.final void
Sets this element's qualified name.void
setSaveXMLSaveTransient
(boolean bSaveTransient) final void
setTransparent
(boolean isTransparent) void
setXMLName
(String name) Sets this element's XML name.final void
setXsiNilAttribute
(String aValue) void
updateFromPeer
(Object peer, int eventType, String arg1, Object arg2) This method will be called by the peer whenever its state changes.Methods inherited from class com.adobe.xfa.Node
checkAncestorPerms, checkDescendentPerms, checkPerms, cleanDirtyFlags, compareVersions, getData, getFirstXMLChildElement, getLocked, getNextXFASibling, getNextXMLSibling, getNextXMLSiblingElement, getNodeAsXML, getOwnerDocument, getPIAsXML, getPIName, getPreviousXMLSibling, getPrivateName, getPropName, getSOMExpression, getSOMExpression, getSomName, getUniqueSOMName, getWillDirty, getXFAChildCount, getXFAParent, getXfaPeer, getXMLChildCount, getXMLParent, hasChanged, isDefault, isDirty, isMapped, isPermsLockSet, isTransient, locateChildByClass, locateChildByName, logValueChangeHelper, notifyPeers, performSOMAssignment, remove, resolveNode, resolveNode, resolveNode, resolveNodes, resolveNodes, sendMessenge, setDirty, setDocument, setLocked, setMapped, setPermsLock, setPrivateName, setWillDirty, setXfaPeer, unLock, validateSchema, validateUsage, validateUsageFailedIsFatal
Methods inherited from class com.adobe.xfa.Obj
addPeer, addPeeredNode, clearPeers, deafen, getClassAtom, getClassTag, getPeer, getScriptProperty, getScriptThis, invokeFunction, isDeaf, isMute, isSameClass, isSameClass, isSameClass, mute, peerRemoved, removePeer, removePeeredNode, setClass, setClassTag, setScriptProperty, unDeafen, unMute
-
Field Details
-
AttrIsDefault
public static final int AttrIsDefault- See Also:
-
AttrIsFragment
public static final int AttrIsFragment- See Also:
-
AttrIsTransient
public static final int AttrIsTransient- See Also:
-
CREATEACTION
public static final int CREATEACTION- See Also:
-
-
Constructor Details
-
Element
public Element(Element parent, Node prevSibling, String uri, String localName, String qName, Attributes attributes, int classTag, String className) Instantiates an element node with the given properties. All name properties (including those in attributes) must be interned strings.- Parameters:
parent
- the element's parent, if any.prevSibling
- the element's previous sibling, if any.uri
- the element's namespace URI.localName
- the element's local name.qName
- the element's qualified name.attributes
- the element's list of XML attributes.classTag
- the element's class tag.className
- the element's class name.
-
-
Method Details
-
appendChild
-
appendChild
Appends the given child to this element.- Parameters:
child
- the child node being appended.bValidate
- when true, ensures the given child is valid per the model's schema and throws anExFull
if not.
-
appendPI
-
appendPI
-
assignNode
Assigns the value given to the node located by the given SOM (Scripting Object Model) expression and interpreted relative to this element's context.If the node doesn't exist, it can be created depending of the value of the given eMode. The eMode values are those identified in
Node.assignNode()
.- Overrides:
assignNode
in classNode
- Parameters:
sSOMExpression
- a SOM expression evaluating to a node.sValue
- the value to be assigned.eMode
- specifies whether the node should be created or not.- Returns:
- the node identified by the SOM expression.
-
clone
-
clone
-
copyContent
-
defaultAttribute
-
defaultElement
public int defaultElement()Returns the class tag of the default one-of child (if there is one)- Returns:
- the integer tag for the default element.
-
defaultElement
- Parameters:
eTag
- The tag of the attribute we wantnOccurrence
- The zero-based occurrence of the attribute (usually zero)- Returns:
- the default value for this attribute in the context of this node.
-
establishID
-
evaluate
public final Arg evaluate(String sEvalText, String sEvalTypeText, int executeReason, boolean bReportNonFatalErrors) Evaluates a fragment of script. This function is analogous to the built-in scripting capability wherein script fragments can be contained in "xfe:script" and "xfe:contentType" attributes in a file.- Parameters:
sEvalText
- - the text to execute.sEvalTypeText
- - the language name. This can be the name of a script language for which the application has installed a handler, such as "formcalc" or "javascript", or an empty string. An empty string is equivalent to "formcalc". Note that the appropriate language handler must be installed by the application.- Returns:
- The return value of the script.
-
findAttr
Find an attribute value by the combination of URI and name.- Parameters:
URI
- the namespace for this attribute. If null, don't worry about namespace matching. If non-null, this String must be interned.name
- the name of the attribute. This String must be interned.- Returns:
- The position of this attribute, or -1 if not found.
-
findSchemaAttr
Find an attribute value by name. The attribute must be in a compatible namespace with the model.- Parameters:
name
- the name of the attribute. This String must be interned.- Returns:
- The position of this attribute. -1 if not found.
-
foundBadAttribute
-
foundBadAttribute
-
getAll
Return the collection of like-named, in-scope, nodes. -
getAppModel
-
getAtom
get an attribute value, will return the default attribute value if none exist NON validating -
getAttr
Gets this element's n'th attribute.- Parameters:
n
- the zero-based index of the attribute.- Returns:
- the n'th attribute.
-
getAttribute
Gets this element's attribute with the given tag. It will return the default attribute value if none exist. Beware: it will NOT validate. -
getAttribute
Gets this element's attribute whose attribute tag is given.To peek at an attribute, set the peek argument to true. If the attribute is present, it is returned; otherwise null is returned.
To create an attribute, set the peek argument to false. If the attribute is absent, a default attribute is created and returned; for attributes with no default, null is returned.
If validation argument is true, and the validation fails, this method throws.
- Parameters:
eTag
- the tag of the attribute.bPeek
- whether to peek at the attribute or not.bValidate
- whether to validate the attribute or not.- Returns:
- the attribute.
-
getAttributeByName
get the named attribute.- Parameters:
aAttrName
- - the attribute name.bSearchProto
- - whether to search protos.- Returns:
- Attribute object, which may be null.
-
getAttrIndex
get the index of this attribute.- Parameters:
attr
- the attribute to find.- Returns:
- the index position in the attribute array.
-
getAttrName
-
getAttrNS
- Parameters:
index
- the index of the attribute.- Returns:
- the namespace of the attribute at the specified index. This String must be interned.
-
getAttrProp
public final boolean getAttrProp(int attrIndex, int eProp) Get one of the volatile attribute properties. Since attributes are immutable, we can't store these properties in the attributes themselves.- Parameters:
attrIndex
- The offset into the attribute array.eProp
- The property to return. One of AttrIsDefault, AttrIsFragment, AttrIsTransient.- Returns:
- the boolean value of the property
-
getAttrQName
-
getAttrVal
-
getXMLChild
Gets this element's n'th XML child.- Parameters:
n
- the zero-based index of the XML child.- Returns:
- the n'th child.
-
getXFAChild
Gets this element's n'th XFA child.- Parameters:
n
- the zero-based index of the XFA child.- Returns:
- the n'th child.
-
getChildReln
-
getClassAll
Return the collection of like-class, in-scope, nodes.- Returns:
- the collection.
-
getClassIndex
public final int getClassIndex()Return the position of this node in its collection of like-class, in-scope, like-child relationship, nodes.- Returns:
- the 0-based position
-
getClassName
Gets this element's class name.- Overrides:
getClassName
in classObj
- Returns:
- the class name as an interned string.
-
getDeltas
Gets a collection of deltas to restore. The locale attribute is always restored immediately, and is not returned in the list of deltas.- Parameters:
delta
- an Element from the form packet.list
- the list of deltas to be populated.
-
getElement
public Element getElement(int eTag, boolean bPeek, int nOccurrence, boolean bReturnDefault, boolean bValidate) Gets this element's sub element whose element tag is given.To return the element, set the returnDefault argument to true. If the element is present, it is returned; otherwise the default element is created and returned.
To peek at the element, set the peek argument to true. If the element is present, it is returned; otherwise null is returned. When set to true, default properties aren't created, and proto references are not expanded.
To create the element, set the peek argument to false. If the element is absent, a default element is created and returned.
If validation argument is true, and the validation fails, this method throws.
If the occurrence argument is out of range, this method throws.
- Parameters:
eTag
- the tag of the element to retrieve.bPeek
- whether to peek at the element, or not.nOccurrence
- the n'th occurrence of the element to retrieve.bReturnDefault
- whether to create a default element, or not.bValidate
- whether to validate the element, or not.- Returns:
- the element, or null.
-
getElement
get an element for a given node, The method will create a default if it doesn't exist. NON validating -
getNode
A variant of getElement that peeks for a non-Element and returns it if it exists, otherwise falls back on getElement with bPeek = true (don't create a default). Used by compareVersions below. -
getElementLocal
public final Element getElementLocal(int eTag, boolean bPeek, int nOccurrence, boolean bReturnDefault, boolean bValidate) This method does the work of getElement(). It's been split out so that it can be called by derived classes who don't want proto resolution to step in. -
getElementClass
public final int getElementClass() -
getEnum
public final int getEnum(int ePropertyTag) -
getEnum
-
getEventTable
-
getFirstXMLChild
Gets this element's first XML child.- Overrides:
getFirstXMLChild
in classNode
- Returns:
- the first XML child.
-
getSibling
a (not so) private method, overrides Node.getSibling()- Overrides:
getSibling
in classNode
-
getFirstXFAChild
Gets this element's first XFA child.- Overrides:
getFirstXFAChild
in classNode
- Returns:
- the first XFA child.
-
getID
-
getIndex
public final int getIndex(boolean bByName) Return the position of this node in its collection of like-named, in-scope, like-child relationship, nodes. -
getInheritedNS
Get our namespace by traversing to our ancestors if necessary.- Returns:
- [inherited] namespace string
-
getInstalledLocale
Gets this element's installed locale. This method checks all enclosing field, draw, or subform ancestors, looking for their locale attribute.- Returns:
- the installed locale name.
-
isInstalledLocaleAmbient
public final boolean isInstalledLocaleAmbient()Determines if this element's installed locale is ambient.- Returns:
- true if the installed locale name is "ambient", and false otherwise.
- See Also:
-
getIsNull
public boolean getIsNull()Determine if this node contains a null value.- Returns:
- true if this node contains a null value, false otherwise.
-
getLastXMLChild
Gets this element's last XML child.- Overrides:
getLastXMLChild
in classNode
- Returns:
- the last XML child.
-
getLineNumber
public final int getLineNumber() -
getLocalName
- Returns:
- the local name as an interned string.
-
getModel
Gets this element's model. -
getName
Gets this element's name.The name of an element is the value of its name attribute, or the element name if there is no name attribute.
-
privateSetName
This version will not perform any notification or undo steps. Should only be called when a node is being created. -
getNodes
Gets this element's list of children. -
getNodeSchema
Gets the Schema for this node.- Returns:
- an NodeSchema object.
-
getNS
Gets this element's namespace.- Returns:
- the namespace URI.
-
getNumAttrs
public final int getNumAttrs()Gets this element's number of attributes.- Returns:
- the number of attributes.
-
getOneOfChild
In the case where an element may contain a "OneOf" child, this method will retrieve the child element that has the XFA::oneOfChild relationship to its parent.
When one only one child node out of a set of nodes can exist for a particular node, then that set of nodes is called a oneOf children
Note!
This method is the only reliable means to return a oneOf child. Other interfaces (e.g. getProperty()) will not interpret default values or handle prototypes correctly for oneOf children.- Returns:
- the Node for this child. If this child has not been specified, this method will return the appropriate XFA default element.
-
getOneOfChild
-
getPI
Get the processing instruction based on the aPiName. If multiple Processing Instructions exist for the same aPiName, all PI's found with that name will be returned.- Parameters:
aPiName
- the processing instruction's target name. This String must be interned.pis
- an input/output parameter that is populated with the values of all the Processing Instructions found for PI name. with the same aPiName.bCheckProtos
- if TRUE, check if this element is specified via prototype inheritance. Defaults to FALSE.
-
optimizeNameSpace
public void optimizeNameSpace(int eAttributeTag, boolean bDeleteIfNotNeeded) For use with attributes that live in a non-standard namespace. Currently the only attribute for which this is true is XFA::RIDTAG. This method has no effect for other attributes. This method declares the namespace of the specified attribute on this node. The purpose of doing this is to optimize file size when the attribute is present in the document. Otherwise the namespace will be declared with each occurrence of the attribute, leading to file bloat. For the XFA::RIDTAG attribute, this method will declare the urn:oasis:names:tc:xliff:document:1.1 namespace on the template model with the standard prefix "xliff".- Parameters:
eAttributeTag
- - the attribute (currently only XFA::RIDTAG will have any effect).bDeleteIfNotNeeded
- - if FALSE, simply declare the namespace unconditionally. This is very efficient, but if the attribute is never used in the document then the declaration of the namespace is superfluous. If TRUE, search the descendants of this node to see if the attribute is in use; if it's not in use then delete any declarations of the attribute's namespace at any level of the tree under this node. If the attribute is in use then this will have the net effect of the FALSE setting. No superfluous namespace declaration will occur with the TRUE setting.
-
getPI
Get the processing instruction based on the aPiName. If multiple Processing Instructions exist for the same aPiName, all PI's found with that name will be returned.- Parameters:
aPiName
- the processing instructions target namesPropName
- the processing instructions property namepis
- an input/output parameter that is populated with the values of all the Processing Instructions found for PI name. with the same aPiName.bCheckProtos
- if TRUE, check if this element is specified via prototype inheritance. Defaults to FALSE.
-
getPrefix
Gets this element's namespace prefix.- Returns:
- the namespace prefix.
-
getProperty
Description copied from class:Node
Get a property for this node.- Overrides:
getProperty
in classNode
- Parameters:
ePropTag
- The XFA tag (name) of the property to check for.nOccurrence
- if this property can occur a fix number of times (usually [0..n]), then specify which occurrence to get. Defaults to 0.- Returns:
- The requested property. If the property has not been specified,
this will contain a default value.
There is a special case for the handling of pcdata. Technically, pcdata
is a child node relationship, but it is retrieved via an attribute -
XFAString. The property name in this case is
XFA::textNodeTag()
. The return value will never be a null object. The XFAProperty will refer to either an Node or an Attribute.
-
getProperty
Description copied from class:Node
string version of getProperty. ***Less efficient than the int version The parameter propertyName should correspond to the name of either a child element that occurs 0..1 times OR is the name of an attribute. The parameter propertyName must be a valid property for this particular class.- Overrides:
getProperty
in classNode
-
getSaveXMLSaveTransient
public boolean getSaveXMLSaveTransient() -
getSchemaType
public int getSchemaType(int eTag) -
getScriptMethodInfo
Description copied from class:Obj
Gets the information on a script method.- Overrides:
getScriptMethodInfo
in classObj
- Parameters:
sFunctionName
- the name of the method- Returns:
- the script function object or null if not found.
-
getScriptTable
- Overrides:
getScriptTable
in classNode
-
getText
Gets this element's text node child.To return the text node, set the returnDefault argument to true. If the text node is present, it is returned; otherwise the default text node is created and returned.
To peek at the text node, set the peek argument to true. If the text node is present, it is returned; otherwise null is returned. When set to true, default properties aren't created, and proto references are not expanded.
To create the text node, set the peek argument to false. If the text node is absent, a default text node is created and returned.
If validation argument is true, and the validation fails, this method throws.
- Parameters:
bPeek
- whether to peek at the text node, or not.bReturnDefault
- whether to create a default text node, or not.bValidate
- whether to validate the text node, or not.- Returns:
- the text node or null.
-
getXMLName
Gets this element's XML name.- Returns:
- the qualified name as an interned string.
-
setXMLName
Sets this element's XML name. -
getXPath
-
getXsiNilAttribute
-
removeXsiNilAttribute
public void removeXsiNilAttribute() -
setXsiNilAttribute
-
inhibitPrettyPrint
public final boolean inhibitPrettyPrint() -
inhibitPrettyPrint
public final void inhibitPrettyPrint(boolean bInhibit) -
insertChild
Inserts a child before a specific child in the child list.- Parameters:
newChild
- the child to be insertedrefNode
- the child to insert beforebValidate
- if true, validate the insertion
-
isContainer
public boolean isContainer()Description copied from class:Node
Check to see if this is a container object. A container is defined as something that is not a leaf node not properties ( [0..1] occurrences ). It does NOT indicate whether this node derives from XFAContainer- Overrides:
isContainer
in classNode
- Returns:
- true if this node is a container, false otherwise
-
isFragment
public void isFragment(boolean bFragment, boolean bSetChildren) Set the fragment state of this node- Parameters:
bFragment
- the fragment statebSetChildren
- if true, set this flag on all nested children
-
isHidden
public final boolean isHidden()Determine if this node is hidden or not.- Returns:
- boolean hidden status.
-
isHidden
public final void isHidden(boolean bHidden) Set the hidden state of this node. Hidden nodes are not saved when the DOM is written out.- Parameters:
bHidden
- the new hidden state.
-
isIndexed
public final boolean isIndexed() -
isLeaf
public final boolean isLeaf()Check if this node is a leaf node -
isNameSpaceAttr
public boolean isNameSpaceAttr()Is this element's name namespaced.- Returns:
- true if this element's name is namespaced.
-
isPropertySpecified
public final boolean isPropertySpecified(int ePropTag, boolean bCheckProtos, int nOccurrence) Description copied from class:Node
Check if a specific property has been defined for this node.- Overrides:
isPropertySpecified
in classNode
- Parameters:
ePropTag
- The XFA tag (name) of the property to check for.bCheckProtos
- if true, check if this property is specified via prototype inheritance. Defaults to true.nOccurrence
- if this property can occur a fix number of times (usually [0..n]), then specify which occurrence to check for. Defaults to 0.- Returns:
- True if the property has been specified.
The property name should correspond to the name of either a child element that occurs 0..1 times OR is the name of an attribute. The parameter propertyName must be a valid property for this particular class.
-
isPropertySpecified
public final boolean isPropertySpecified(String propertyName, boolean bCheckProtos, int nOccurrence) -
isPropertyValid
public final boolean isPropertyValid(int ePropTag) Check if a specified property is valid according to the schema.- Parameters:
ePropTag
- The XFA tag (name) of the property to check for.- Returns:
- not-null if valid. Boolean TRUE if property is an Element
-
isSpecified
public boolean isSpecified(int eTag, boolean bCheckProtos, int nOccurrence) Description copied from class:Node
Check if a property, child, or oneOfChild has been defined for this node- Overrides:
isSpecified
in classNode
- Parameters:
eTag
- The XFA tag (name) of the property/child/oneOfChild to check for.bCheckProtos
- if true, check if this property is specified via prototype inheritance. Defaults to true.nOccurrence
- if this property can occur a fix number of times (usually [0..n]), then specify which occurrence to check for. Defaults to 0.- Returns:
- True if the property has been specified.
-
isSpecified
public boolean isSpecified(int eTag, int eType, boolean bCheckProtos, int nOccurrence) -
isSpecified
-
isTransient
public final void isTransient(boolean bTransient, boolean bSetChildren) Description copied from class:Node
Set the transient state of this node. Transient nodes are not saved when the DOM is written out.- Overrides:
isTransient
in classNode
- Parameters:
bTransient
- the new transient state.- See Also:
-
isTransparent
public boolean isTransparent()- Overrides:
isTransparent
in classNode
-
isValidAttr
Determine if a specified attribute tag is valid for this node.- Parameters:
eTag
- the XFA tag to check- Returns:
- true if valid.
-
isValidChild
public boolean isValidChild(int eTag, int nError, boolean bBeforeInsert, boolean bOccurrenceErrorOnly) - Parameters:
eTag
- the class tag of the node that will be or has been appendednError
-bBeforeInsert
- iftrue
, then the child has not yet been inserted into the child list of this element.bOccurrenceErrorOnly
-- Returns:
true
if eTag is a valid child.
-
isValidElement
public boolean isValidElement(int eTag, boolean bReport) -
loadXML
Loads and appends the specified XML fragment (or document) to this element.- Parameters:
is
- the input stream of XML fragment.bIgnoreAggregatingTag
- ignore the root node of the XML fragment, when true, in which case, the children of the root node will be appended to this element. Append the root node of the XML fragment to this element, when false.bReplaceContent
- replace the content of this element with the content of the root node of the XML fragment, when true.
-
loadXML
public void loadXML(InputStream is, boolean bIgnoreAggregatingTag, Element.ReplaceContent eReplaceContent) Loads and appends the specified XML fragment (or document) to this element.- Parameters:
is
- the input stream of XML fragment.bIgnoreAggregatingTag
- ignore the root node of the XML fragment, when true, in which case, the children of the root node will be appended to this element. Append the root node of the XML fragment to this element, when false.eReplaceContent
- specifies handling of existing node content.
-
makeDefault
public void makeDefault()Description copied from class:Node
Mark this element as a default property- Overrides:
makeDefault
in classNode
- See Also:
-
makeNonDefault
public void makeNonDefault(boolean bRecursive) Description copied from class:Node
Mark this element to indicate it is not a default property- Overrides:
makeNonDefault
in classNode
- See Also:
-
setDefaultFlag
public void setDefaultFlag(boolean bDefaultNode, boolean bSetChildren) -
newAttribute
-
peekAttribute
get an attribute value only if it exists. NON validating -
peekElement
get an element only if it exists NON validating READ ONLY VERSION -
peekOneOfChild
Deprecated.UsegetOneOfChild(true, bReturnDefault)
instead.Description copied from class:Node
READ ONLY VERSION of getOneOfChild In the case where an element may contain a "OneOf" child, this method will retrieve the child element that has the XFA::oneOfChild relationship to its parent.When one only one child node out of a set of nodes can exist for a particular node, then that set of nodes is called a oneOf children.
Note! Proto references are not expanded, SHOULD NOT modify the resulting node.
- Overrides:
peekOneOfChild
in classNode
- Parameters:
bReturnDefault
- true if you want the defualt node to be returned if the "OneOf" child doesn't exist, if false null will be returned- Returns:
- the "OneOf" child for this node. If this child has not been specified, this method will return null.
-
peekProperty
-
peekProperty
-
postSave
public void postSave() -
preSave
public void preSave(boolean bSaveXMLScript) -
removeAttr
public final void removeAttr(int index) -
removeAttr
Remove an attribute as specified by the combination of URI and name.- Parameters:
URI
- the namespace for this attribute. If null, don't worry about namespace matching. If non-null, this String must be interned.name
- the name of the attribute. This String must be interned.
-
removeChild
Removes a child from the child list- Parameters:
child
- the node to be removed
-
removePI
Remove all processing instruction based on the aPiName.- Parameters:
aPiName
- the processing instructions target name
-
removePI
-
removeWhiteSpace
public final void removeWhiteSpace()Remove all #text children that consist of whitespace -
replaceChild
-
resetPostLoadXML
public void resetPostLoadXML() -
resolveAndEnumerateChildren
Construct a list of element-based properties and children. The list is fully resolved (ie: it will have children from any prototypes in it). -
resolveNodeCreate
public SOMParser.SomResultInfo resolveNodeCreate(String somNodesInput, int eAction, boolean bLeaf, boolean bDefault, boolean bNoProperties) -
saveXML
Serializes this element (and all its children) to an output stream.- Parameters:
outFile
- an output stream.options
- the XML save options
-
saveXML
Serializes this element (and all its children) to an output stream.- Parameters:
outFile
- an output stream.options
- the XML save options
-
saveFilteredXML
-
serialize
public void serialize(OutputStream outStream, DOMSaveOptions options, int level, Node prevSibling) throws IOException Description copied from class:Node
The helper function used by saveXML()- Specified by:
serialize
in classNode
- Parameters:
outStream
- Streamfile to write tooptions
- save optionslevel
- the indent levelprevSibling
- our previous sibling -- needed for some markup options.- Throws:
IOException
- See Also:
-
setAttribute
Sets (adds) an attribute to this element.- Parameters:
attr
- the attribute.eTag
- The XFA tag name of the attribute being set.
-
setAttribute
public final void setAttribute(int eVal, int eTag) Sets (adds) an enumerated attribute value to this element. -
setAttribute
Sets (adds) an attribute to this element.- Parameters:
nameSpace
- namespace of the attribute.qName
- the qualified name of the attribute.localName
- the local name of the attribute.value
- the value of the attribute.- Returns:
- the attribute we just updated or created
-
setAttribute
public final Attribute setAttribute(String nameSpace, String qName, String localName, String value, boolean internSymbols) Sets (adds) an attribute to this element.The internSymbols parameter specifies whether the nameSpace, qName and localName parameters need to be interned. If it is known that these symbols are already interned (eg, they were retrieved from another Attribute, or are literal values), then specifing false for internSymbols saves the overhead for interning.
- Parameters:
nameSpace
- namespace of the attribute.qName
- the qualified name of the attribute.localName
- the local name of the attribute.value
- the value of the attribute.internSymbols
- indicates whether the namespace, qName and localName argument need to be interned.- Returns:
- the attribute we just updated or created
-
setAttrProp
public final void setAttrProp(int attrIndex, int eProp, boolean bValue) Set one of the volatile attribute properties. Since attributes are immutable, we can't store these properties in the attributes themselves.- Parameters:
attrIndex
- The offset into the attribute array.eProp
- The property to return. One of AttrIsDefault, AttrIsFragment, AttrIsTransient.bValue
- the boolean value of the property
-
setDOMProperties
All name properties (including those in attributes) must be interned strings. -
setElement
Set an element value. Must be a valid 0..1 element, (not a oneOfChild or a 0..n child)- Parameters:
child
- the child to add or set.eTag
- only used if oChild isNull -- in which case we remove the element
-
setIsIndexed
public final void setIsIndexed(boolean bIsIndexed) Set whether this node has an XMLID- Parameters:
bIsIndexed
-
-
setLineNumber
public final void setLineNumber(int nLineNumber) -
setLocalName
Sets this element's local name.- Parameters:
name
- the new local name.
-
setModel
Sets this element's model.- Parameters:
model
- the model this element belongs to.
-
setName
Sets this element's name attribute. -
setNS
Sets this element's children null namespace to the given uri.- Parameters:
sNS
- the namespace uri. This string must be interned. Javaport: added.
-
setOneOfChild
In the case where an element may contain a "OneOf" child, this method will set the child element that has the XFA::oneOfChild relationship. If a "OneOf" child already exists, this method will replace it.- Parameters:
child
- the child to set. If this is a null object, any any existing "oneOf" child will be deleted.
-
setProperty
Set a property for this node. The parameter property must be either a valid child that occurs 0..1 times (i.e. an Node) or a valid attribute (i.e. an Attribute or derivative). If this parameter is a Null object, then the corresponding attribute or element will be removed.
There is a special case for the handling of pcdata. Technically, pcdata is a child node relationship, but it is set using an attribute - usually XFAString. The property name in this case isXFA::textNodeTag()
.- Parameters:
property
- The XFA element that defines this property.ePropertyTag
- The XFA tag (name) of the property.
-
setProperty
string version of setProperty. ***Less efficient than the int version ***. -
setQName
Sets this element's qualified name.- Parameters:
name
- the new qualified name.
-
setSaveXMLSaveTransient
public void setSaveXMLSaveTransient(boolean bSaveTransient) -
setTransparent
public final void setTransparent(boolean isTransparent) -
updateFromPeer
Description copied from interface:Peer
This method will be called by the peer whenever its state changes.eventType (String)arg1 (Object)arg2 UPDATED update type (optional) ATTR_CHANGED attr name (optional) CHILD_ADDED (optional) added node CHILD_REMOVED (optional) removed node VALUE_CHANGED new data (optional) PARENT_CHANGED (optional) new parent DESCENDENT_ATTR_CHANGED attr name changed node DESCENDENT_VALUE_CHANGED (optional) changed node DESCENDENT_ADDED (optional) added node DESCENDENT_REMOVED (optional) removed node PERMS_LOCK_SET (optional) (optional) PERMS_LOCK_CLEARED (optional) (optional) PROTO_ATTR_CHANGED attr name changed node PROTO_CHILD_ADDED (optional) added node of the protoype PROTO_CHILD_REMOVED (optional) removed node from the prototype PROTO_VALUE_CHANGED new data prototype node PROTO_DESCENDENT_ATTR_CHANGED attr name changed prototype node PROTO_DESCENDENT_VALUE_CHANGED (optional) changed prototype node PROTO_DESCENDENT_ADDED (optional) added node to the prototype PROTO_DESCENDENT_REMOVED (optional) removed node from the prototype
- Specified by:
updateFromPeer
in interfacePeer
- Overrides:
updateFromPeer
in classObj
- Parameters:
peer
- the peer to this object.eventType
- the event type as enumerated in this classarg1
- additional event informationarg2
- additional event information- See Also:
-
processTextChildrenDuringParse
public boolean processTextChildrenDuringParse()Determines whether child text nodes should be processed (check validity, consolidate) at parse time. Some schemas (or parts of schemas) may require an open schema that cannot be resolved at parse time, and where processing of text nodes must be delayed until load processing when the entire tree is available. Where possible, text child nodes are processed at parse time since that allows us to avoid creating many text nodes (e.g., ignorable whitespace).- Returns:
true
if child text nodes should be processed at parse time.
-
connectPeerToDocument
public void connectPeerToDocument()connectPeerToDocument() is used to rearrange the DOM tree when inserting or appending a node. It is provided here as a utility function for derived classes that could be adding child nodes, when peered against an orphan node. In particular, this happens with xfa:datasets and xfa:data, both of which may be created during the load process. On the C++ side, this method is only used by the data model. Due to the differences between the relationship of Documents and AppModels in Java, on the Java side it is also called when creating a DOM from scratch, from any ModelFactory's createDOM method. In the DataModel context at least, it should only be called if the DOM peer is an orphan. It takes that orphan and connects it to the document, and then moves the original peer of this node to be a child of the node that previously was orphaned. -
setIsDataWindowRoot
public final void setIsDataWindowRoot(boolean bIsRoot) -
constructKey
Constructs a key (either primary or foreign) for an element given a node address list. A context node must be provided for evaluating any namespace prefixes found in the node address list. (The context node is normally the data description node from which the node address list came.) -
constructKeys
-
explodeQName
-
resolvePrefix
-
getOneOfChild(true, bReturnDefault)
instead.