Package com.adobe.xfa.data
Class DataNode
java.lang.Object
com.adobe.xfa.Obj
com.adobe.xfa.Node
com.adobe.xfa.Element
com.adobe.xfa.data.DataNode
- All Implemented Interfaces:
Element.DualDomNode,Peer
DataNode is a class that combines what used to be two classes in the C++ code
base: XFADataGroup and XFADataValue.
Because of the revised DOM structure we're using in Java, we can't tell when
an element is first created whether it's a dataGroup or dataValue. The
easiest answer is to not differentiate. We'll set the classId after we load
and rely on it to tell the difference.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.adobe.xfa.Element
Element.DualDomNode, Element.ReplaceContentNested classes/interfaces inherited from class com.adobe.xfa.Node
Node.ChangeLogger -
Field Summary
Fields inherited from class com.adobe.xfa.Element
AttrIsDefault, AttrIsFragment, AttrIsTransient, CREATEACTIONFields inherited from class com.adobe.xfa.Node
CREATE_ALWAYS_NEW, CREATE_IF_NOT_EXIST, CREATE_MUST_NOT_EXIST, CREATE_REPLACE, gsXFANamespacePrefixFields 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 TypeMethodDescriptionvoidappendChild(Node oChild, boolean bValidate) Appends the given child to this element.voidvoidconnectPeerToDocument() is used to rearrange the DOM tree when inserting or appending a node.createChild(boolean bIsLeaf, String aName) create a new child that is appended to this node.Determine if a DataValue participates in its parent's value or is an attribute of the parent.Determine the content type for a DataValue, e.g., text/html.getData()Gets this node's data.Gets this data element's first XFA child.booleanbooleanDetermine if this node contains a null value.getName()Gets this data element's next XFA sibling.getNS()SeeElement.getNS()getValue()Get the value of the node.getValue(boolean bUseNull) Get the value of the node.intvoidinsertChild(Node oChild, Node refChild, boolean bValidate) Inserts a child before a specific child in the child list.booleanDoes this data node correspond to an XML Attribute?booleanCheck to see if this is a container object.final booleanDetermine if this node is transient or not.booleanisValidAttr(int eTag, boolean bReport, String value) Determine if a specified attribute tag is valid for this node.booleanisValidChild(int eTag, int nResId, boolean bBeforeInsert, boolean bOccurrenceErrorOnly) booleanisValidElement(int eTag, boolean bReport) voidmakeNonDefault(boolean bRecursive) Mark this element to indicate it is not a default propertyvoidpreSave(boolean bSaveXMLScript) booleanText children of data cannot be processed at parse time.voidremove()Removes this node fron its parent.voidvoidsaveXML(OutputStream sOutFile, DOMSaveOptions options) Serializes this element (and all its children) to an output stream.voidserialize(OutputStream outStream, DOMSaveOptions options, int level, Node prevSibling) The helper function used by saveXML()voidsetContentType(String contentType) voidsetDataDescription(DataNode dataDescription) voidsetIsDDPlaceholder(boolean bIsDDPlaceholder) voidsetIsNull(boolean bNull, boolean bNotify) Set the null status for this nodevoidsetLocalName(String name) voidSets this element's name attribute.voidsetPictureFormat(String sFormat, String sLocale, boolean bIsTextNode) Proprietary: set the data picture format for this data value Applicable to dataValue nodesvoidsetPrivateName(String sName) used when resolving protosvoidSet the value of the node.intsetWeight(int nWeight) voidsetXMLName(String name) voidsetXmlPeer(Node peer) Methods inherited from class com.adobe.xfa.Element
appendChild, appendPI, appendPI, assignNode, clone, constructKey, constructKeys, copyContent, defaultAttribute, defaultElement, defaultElement, establishID, evaluate, explodeQName, findAttr, findSchemaAttr, foundBadAttribute, foundBadAttribute, getAll, getAppModel, getAtom, getAttr, getAttribute, getAttribute, getAttributeByName, getAttrIndex, getAttrName, getAttrNS, getAttrProp, getAttrQName, getAttrVal, getChildReln, getClassAll, getClassIndex, getClassName, getDeltas, getElement, getElement, getElementClass, getElementLocal, getEnum, getEnum, getEventTable, getFirstXMLChild, getID, getIndex, getInheritedNS, getInstalledLocale, getLastXMLChild, getLineNumber, getModel, getNode, getNodes, getNodeSchema, getNumAttrs, getOneOfChild, getOneOfChild, getPI, getPI, getPrefix, getProperty, getProperty, getSaveXMLSaveTransient, getSchemaType, getScriptMethodInfo, getSibling, getText, getXFAChild, getXMLChild, getXPath, getXsiNilAttribute, inhibitPrettyPrint, inhibitPrettyPrint, isFragment, isHidden, isHidden, isIndexed, isInstalledLocaleAmbient, isLeaf, isNameSpaceAttr, isPropertySpecified, isPropertySpecified, isPropertyValid, isSpecified, isSpecified, isSpecified, isTransient, isTransparent, loadXML, loadXML, makeDefault, newAttribute, optimizeNameSpace, peekAttribute, peekElement, peekOneOfChild, peekProperty, peekProperty, postSave, privateSetName, removeAttr, removeAttr, removeChild, removePI, removePI, removeWhiteSpace, removeXsiNilAttribute, replaceChild, resolveAndEnumerateChildren, resolveNodeCreate, resolvePrefix, saveFilteredXML, saveXML, setAttribute, setAttribute, setAttribute, setAttribute, setAttrProp, setDefaultFlag, setDOMProperties, setElement, setIsDataWindowRoot, setIsIndexed, setLineNumber, setModel, setNS, setOneOfChild, setProperty, setProperty, setQName, setSaveXMLSaveTransient, setTransparent, setXsiNilAttribute, updateFromPeerMethods inherited from class com.adobe.xfa.Node
checkAncestorPerms, checkDescendentPerms, checkPerms, cleanDirtyFlags, compareVersions, getFirstXMLChildElement, getLocked, getNextXMLSibling, getNextXMLSiblingElement, getNodeAsXML, getOwnerDocument, getPIAsXML, getPIName, getPreviousXMLSibling, getPrivateName, getPropName, getSOMExpression, getSOMExpression, getSomName, getUniqueSOMName, getWillDirty, getXFAChildCount, getXFAParent, getXfaPeer, getXMLChildCount, getXMLParent, hasChanged, isDefault, isDirty, isMapped, isPermsLockSet, locateChildByClass, locateChildByName, logValueChangeHelper, notifyPeers, performSOMAssignment, resolveNode, resolveNode, resolveNode, resolveNodes, resolveNodes, sendMessenge, setDirty, setDocument, setLocked, setMapped, setPermsLock, setWillDirty, setXfaPeer, unLock, validateSchema, validateUsage, validateUsageFailedIsFatalMethods 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
-
Constructor Details
-
Method Details
-
appendChild
Description copied from class:ElementAppends the given child to this element.- Overrides:
appendChildin classElement- Parameters:
oChild- the child node being appended.bValidate- when true, ensures the given child is valid per the model's schema and throws anExFullif not.
-
clearNull
public void clearNull() -
clone
-
createChild
create a new child that is appended to this node. -
getContains
Determine if a DataValue participates in its parent's value or is an attribute of the parent. The value returned is "data" or "metaData".- Returns:
- String that determines if this data value should be included in its parent's value result or as an attribute of the parent.
-
getContentType
Determine the content type for a DataValue, e.g., text/html.- Returns:
- String that determines the content type.
-
getDataDescription
-
getIsDDPlaceholder
public boolean getIsDDPlaceholder() -
getIsNull
public boolean getIsNull()Description copied from class:ElementDetermine if this node contains a null value. -
getName
-
getLocalName
- Overrides:
getLocalNamein classElement- Returns:
- the local name as an interned string.
-
setLocalName
- Overrides:
setLocalNamein classElement- Parameters:
name- the new local name.
-
getXMLName
- Overrides:
getXMLNamein classElement- Returns:
- the qualified name as an interned string.
-
setXMLName
- Overrides:
setXMLNamein classElement
-
getNS
SeeElement.getNS() -
getData
Description copied from class:NodeGets this node's data. -
getFirstXFAChild
Gets this data element's first XFA child. Text nodes in the data model can't be exposed to counting, scripting, etc...- Overrides:
getFirstXFAChildin classElement- Returns:
- the first XFA child.
-
getNextXFASibling
Gets this data element's next XFA sibling. Text nodes in the data model can't be exposed to counting, scripting, etc...- Overrides:
getNextXFASiblingin classNode- Returns:
- the next XFA sibling.
-
getScriptTable
- Overrides:
getScriptTablein classElement
-
getValue
Get the value of the node.- Returns:
- The string value of this node.
-
getValue
Get the value of the node.- Returns:
- The string value of this node.
-
isAttribute
public boolean isAttribute()Does this data node correspond to an XML Attribute?- Returns:
- true if this node corresponds to an XML Attribute.
-
getWeight
public int getWeight() -
insertChild
Description copied from class:ElementInserts a child before a specific child in the child list.- Overrides:
insertChildin classElement- Parameters:
oChild- the child to be insertedrefChild- the child to insert beforebValidate- if true, validate the insertion
-
isContainer
public boolean isContainer()Description copied from class:NodeCheck 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:
isContainerin classElement- Returns:
- true if this node is a container, false otherwise
-
isValidAttr
Description copied from class:ElementDetermine if a specified attribute tag is valid for this node.- Overrides:
isValidAttrin classElement- Parameters:
eTag- the XFA tag to check- Returns:
- true if valid.
- See Also:
-
isValidChild
public boolean isValidChild(int eTag, int nResId, boolean bBeforeInsert, boolean bOccurrenceErrorOnly) - Overrides:
isValidChildin classElement- Parameters:
eTag- the class tag of the node that will be or has been appendednResId-bBeforeInsert- iftrue, then the child has not yet been inserted into the child list of this element.bOccurrenceErrorOnly-- Returns:
trueif eTag is a valid child.- See Also:
-
isValidElement
public boolean isValidElement(int eTag, boolean bReport) - Overrides:
isValidElementin classElement- See Also:
-
makeNonDefault
public void makeNonDefault(boolean bRecursive) Description copied from class:NodeMark this element to indicate it is not a default property- Overrides:
makeNonDefaultin classElement- See Also:
-
processTextChildrenDuringParse
public boolean processTextChildrenDuringParse()Text children of data cannot be processed at parse time. This processing is deferred to postLoad processing.- Overrides:
processTextChildrenDuringParsein classElement- Returns:
trueif child text nodes should be processed at parse time.
-
preSave
public void preSave(boolean bSaveXMLScript) -
remove
public void remove()Removes this node fron its parent. -
resetPostLoadXML
public void resetPostLoadXML()- Overrides:
resetPostLoadXMLin classElement
-
saveXML
Description copied from class:ElementSerializes this element (and all its children) to an output stream. -
serialize
public void serialize(OutputStream outStream, DOMSaveOptions options, int level, Node prevSibling) throws IOException Description copied from class:NodeThe helper function used by saveXML()- Overrides:
serializein classElement- Parameters:
outStream- Streamfile to write tooptions- save optionslevel- the indent levelprevSibling- our previous sibling -- needed for some markup options.- Throws:
IOException- See Also:
-
setContentType
-
setDataDescription
-
setIsDDPlaceholder
public void setIsDDPlaceholder(boolean bIsDDPlaceholder) -
setIsNull
public void setIsNull(boolean bNull, boolean bNotify) Set the null status for this node- Parameters:
bNull-bNotify-
-
setName
Description copied from class:ElementSets this element's name attribute. -
setPictureFormat
Proprietary: set the data picture format for this data value Applicable to dataValue nodes- Parameters:
sFormat-sLocale-bIsTextNode-
-
setPrivateName
Description copied from class:Nodeused when resolving protos- Overrides:
setPrivateNamein classNode
-
setValue
Set the value of the node. Note! if a DataValue has child DataValues, setting the value will delete all children.- Parameters:
sValue- - the new value for this node.
-
setWeight
public int setWeight(int nWeight) -
isTransient
public final boolean isTransient()Determine if this node is transient or not. Transient nodes are not saved when the DOM is written out.- Overrides:
isTransientin classNode- Returns:
- boolean transient status.
-
connectPeerToDocument
public void connectPeerToDocument()Description copied from class:ElementconnectPeerToDocument() 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.- Overrides:
connectPeerToDocumentin classElement
-
setXmlPeer
- Specified by:
setXmlPeerin interfaceElement.DualDomNode
-
getXmlPeer
- Specified by:
getXmlPeerin interfaceElement.DualDomNode
-