Class ProtoableNode
- java.lang.Object
-
- com.adobe.xfa.Obj
-
- com.adobe.xfa.Node
-
- com.adobe.xfa.Element
-
- com.adobe.xfa.ProtoableNode
-
- All Implemented Interfaces:
Peer
- Direct Known Subclasses:
BindingNode,Border,Button,Calculate,Caption,Color,Container,Content,DateTimeEdit,EffectivePolicy,EventTag,Fill,FormInstanceManager,GenericNode,GenericTextContainer,Items,Keep,Linear,Manifest,Margin,Occur,Picture,Proto,Script,TextEdit,Traverse,UI,Value,WSDLConnection,XMLConnection,XMLMultiSelectNode,XSDConnection
public class ProtoableNode extends Element
A base class to represent protoable objects. Any XFA object that is protoable can make use of prototypes. Prototypes (or proto's) are used to reduce the redundancy of common information repeated throughout a form.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.adobe.xfa.Element
Element.DualDomNode, Element.ReplaceContent
-
Nested classes/interfaces inherited from class com.adobe.xfa.Node
Node.ChangeLogger
-
-
Field Summary
-
Fields inherited from class com.adobe.xfa.Element
AttrIsDefault, AttrIsFragment, AttrIsTransient, CREATEACTION
-
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 Constructor Description ProtoableNode()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Elementclone(Element parent, boolean bDeep)clone will establish any proto relationshipsProtoableNodecreateProto(Element parent, boolean bFull)AttributeelementGetAttribute(int eTag, boolean bPeek, boolean bValidate)We need this method so that derived classes can explicitly call the getAttribute() method on Element.booleanexternalProtoFailed()voidfetchIDValues(java.util.List<java.lang.String> idValues)AttributegetAttribute(int eTag, boolean bPeek, boolean bValidate)Gets this element's attribute whose attribute tag is given.AttributegetAttributeByName(java.lang.String aAttrName, boolean bSearchProto)get the named attribute.ElementgetElement(int eTag, boolean bPeek, int nOccurrence, boolean bReturnDefault, boolean bValidate)Gets this element's sub element whose element tag is given.ProtoableNodegetExternalProtoSource()Get the external prototype reference node used in the creation of this nodeNodegetOneOfChild(boolean bPeek, boolean bReturnDefault)voidgetPI(java.lang.String aPiName, java.lang.String sPropName, java.util.List<java.lang.String> pis, boolean bCheckProtos)Get the processing instruction based on the aPiName.voidgetPI(java.lang.String aPiName, java.util.List<java.lang.String> pis, boolean bCheckProtos)Get the processing instruction based on the aPiName.ProtoableNodegetProto()Get the reference node for this nodeProtoableNodegetProtoed(int nIndex)ScriptTablegetScriptTable()TextNodegetText(boolean bPeek, boolean bReturnDefault, boolean bValidate)Gets the first text node child.booleanhasExternalProto()booleanhasProto()Check if this node has a reference nodebooleanisContextSensitiveAttribute(int eTag)booleanisDefault(boolean bCheckProto)booleanisSpecified(int eTag, int eType, boolean bCheckProtos, int nOccurrence)voidnotifyPeers(int eventType, java.lang.String arg1, java.lang.Object arg2)This method will be called whenever its state changes.booleanperformResolveProtos(boolean bResolveExternalProtos)voidpreSave(boolean bSaveXMLScript)static voidreleaseExternalProtos(ProtoableNode node)Static helper method to help prevent memory leaks in the case of circular fragment references.booleanreResolveProto(boolean bFull)remove any existing proto children and re-resolve the protobooleanresolveProto(ProtoableNode srcProto, boolean bFull, boolean bMarkTransient, boolean bSrcIsExternal)voidsetAttribute(Attribute attr, int eTag)Sets an attribute of this element.NodesetElement(Node child, int eTag, int nOccurrence)Set an element value.NodesetOneOfChild(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.voidsetPermsLock(boolean bPermsLock)Sets the permissions state of this node.voidsetProto(ProtoableNode refProto)voidupdateIDValues(java.lang.String sPrefix, java.util.List<java.lang.String> oldReferenceList)-
Methods inherited from class com.adobe.xfa.Element
appendChild, appendChild, appendPI, appendPI, assignNode, clone, connectPeerToDocument, constructKey, constructKeys, copyContent, defaultAttribute, defaultElement, defaultElement, establishID, evaluate, explodeQName, findAttr, findSchemaAttr, foundBadAttribute, foundBadAttribute, getAll, getAppModel, getAtom, getAttr, getAttribute, getAttrIndex, getAttrName, getAttrNS, getAttrProp, getAttrQName, getAttrVal, getChildReln, getClassAll, getClassIndex, getClassName, getDeltas, getElement, getElementClass, getElementLocal, getEnum, getEnum, getEventTable, getFirstXFAChild, getFirstXMLChild, getID, getIndex, getInheritedNS, getInstalledLocale, getIsNull, getLastXMLChild, getLineNumber, getLocalName, getModel, getName, getNode, getNodes, getNodeSchema, getNS, getNumAttrs, getOneOfChild, getPrefix, getProperty, getProperty, getSaveXMLSaveTransient, getSchemaType, getScriptMethodInfo, getSibling, getXFAChild, getXMLChild, getXMLName, getXPath, getXsiNilAttribute, inhibitPrettyPrint, inhibitPrettyPrint, insertChild, isContainer, isFragment, isHidden, isHidden, isIndexed, isInstalledLocaleAmbient, isLeaf, isNameSpaceAttr, isPropertySpecified, isPropertySpecified, isPropertyValid, isSpecified, isSpecified, isTransient, isTransparent, isValidAttr, isValidChild, isValidElement, loadXML, loadXML, makeDefault, makeNonDefault, newAttribute, optimizeNameSpace, peekAttribute, peekElement, peekOneOfChild, peekProperty, peekProperty, postSave, privateSetName, processTextChildrenDuringParse, removeAttr, removeAttr, removeChild, removePI, removePI, removeWhiteSpace, removeXsiNilAttribute, replaceChild, resetPostLoadXML, resolveAndEnumerateChildren, resolveNodeCreate, resolvePrefix, saveFilteredXML, saveXML, saveXML, serialize, setAttribute, setAttribute, setAttribute, setAttrProp, setDefaultFlag, setDOMProperties, setIsDataWindowRoot, setIsIndexed, setLineNumber, setLocalName, setModel, setName, setNS, setProperty, setProperty, setQName, setSaveXMLSaveTransient, setTransparent, setXMLName, setXsiNilAttribute, updateFromPeer
-
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, isDirty, isMapped, isPermsLockSet, isTransient, locateChildByClass, locateChildByName, logValueChangeHelper, performSOMAssignment, remove, resolveNode, resolveNode, resolveNode, resolveNodes, resolveNodes, sendMessenge, setDirty, setDocument, setLocked, setMapped, 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
-
-
-
-
Method Detail
-
clone
public Element clone(Element parent, boolean bDeep)
clone will establish any proto relationships
-
createProto
public ProtoableNode createProto(Element parent, boolean bFull)
-
elementGetAttribute
public Attribute elementGetAttribute(int eTag, boolean bPeek, boolean bValidate)
We need this method so that derived classes can explicitly call the getAttribute() method on Element.
-
externalProtoFailed
public final boolean externalProtoFailed()
-
fetchIDValues
public void fetchIDValues(java.util.List<java.lang.String> idValues)
-
getProtoed
public ProtoableNode getProtoed(int nIndex)
-
getScriptTable
public ScriptTable getScriptTable()
- Overrides:
getScriptTablein classElement
-
updateIDValues
public void updateIDValues(java.lang.String sPrefix, java.util.List<java.lang.String> oldReferenceList)
-
getAttribute
public Attribute getAttribute(int eTag, boolean bPeek, boolean bValidate)
Description copied from class:ElementGets 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.
- Overrides:
getAttributein classElement- 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
public Attribute getAttributeByName(java.lang.String aAttrName, boolean bSearchProto)
get the named attribute.- Overrides:
getAttributeByNamein classElement- Parameters:
aAttrName- - the attribute name.bSearchProto- - whether to search protos.- Returns:
- Attribute object, which may be null.
-
getElement
public Element getElement(int eTag, boolean bPeek, int nOccurrence, boolean bReturnDefault, boolean bValidate)
Description copied from class:ElementGets 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.
- Overrides:
getElementin classElement- 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.
-
getOneOfChild
public Node getOneOfChild(boolean bPeek, boolean bReturnDefault)
- Overrides:
getOneOfChildin classElement
-
getPI
public void getPI(java.lang.String aPiName, java.util.List<java.lang.String> pis, boolean bCheckProtos)Description copied from class:ElementGet 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.- Overrides:
getPIin classElement- 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.
-
getPI
public void getPI(java.lang.String aPiName, java.lang.String sPropName, java.util.List<java.lang.String> pis, boolean bCheckProtos)Description copied from class:ElementGet 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.- Overrides:
getPIin classElement- 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.
-
getProto
public ProtoableNode getProto()
Get the reference node for this node- Returns:
- a reference node, a null node if there is none.
-
getExternalProtoSource
public ProtoableNode getExternalProtoSource()
Get the external prototype reference node used in the creation of this node- Returns:
- a external reference node, a null node if there is none.
-
getText
public final TextNode getText(boolean bPeek, boolean bReturnDefault, boolean bValidate)
Gets the first text node child. New for the Java Port. Modeled on #getElement.
-
hasExternalProto
public boolean hasExternalProto()
-
hasProto
public boolean hasProto()
Check if this node has a reference node- Returns:
- true if this node has a reference node, else false
-
isContextSensitiveAttribute
public boolean isContextSensitiveAttribute(int eTag)
-
isDefault
public boolean isDefault(boolean bCheckProto)
- Overrides:
isDefaultin classNode- See Also:
Node.isDefault(boolean)
-
isSpecified
public boolean isSpecified(int eTag, int eType, boolean bCheckProtos, int nOccurrence)- Overrides:
isSpecifiedin classElement
-
notifyPeers
public void notifyPeers(int eventType, java.lang.String arg1, java.lang.Object arg2)This method will be called whenever its state changes. This will also modify the eventType and notify the parent of this tree- Specified by:
notifyPeersin interfacePeer- Overrides:
notifyPeersin classNode- Parameters:
eventType- the event type as enumerated in this classarg1- additional event informationarg2- additional event information
-
performResolveProtos
public boolean performResolveProtos(boolean bResolveExternalProtos)
-
preSave
public void preSave(boolean bSaveXMLScript)
- Overrides:
preSavein classElement- See Also:
Node.preSave(boolean)
-
reResolveProto
public final boolean reResolveProto(boolean bFull)
remove any existing proto children and re-resolve the proto- Parameters:
bFull- see resolveProto
-
resolveProto
public boolean resolveProto(ProtoableNode srcProto, boolean bFull, boolean bMarkTransient, boolean bSrcIsExternal)
-
setElement
public Node setElement(Node child, int eTag, int nOccurrence)
Description copied from class:ElementSet an element value. Must be a valid 0..1 element, (not a oneOfChild or a 0..n child)- Overrides:
setElementin classElement- Parameters:
child- the child to add or set.eTag- only used if oChild isNull -- in which case we remove the element- See Also:
Element.setElement(Node, int, int)
-
setOneOfChild
public Node setOneOfChild(Node child)
Description copied from class:ElementIn 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.- Overrides:
setOneOfChildin classElement- Parameters:
child- the child to set. If this is a null object, any any existing "oneOf" child will be deleted.- See Also:
Element.setOneOfChild(Node)
-
setAttribute
public void setAttribute(Attribute attr, int eTag)
Sets an attribute of this element.- Overrides:
setAttributein classElement- Parameters:
attr- the attribute.eTag- The XFA tag name of the attribute being set.
-
setPermsLock
public void setPermsLock(boolean bPermsLock)
Description copied from class:NodeSets the permissions state of this node. Locking a node will cause some attempts to invoke methods or set properties to throw an exception.- Overrides:
setPermsLockin classNode- Parameters:
bPermsLock- the permissions state to set this node to:truewill lock the node;falsewill unlock the node.
-
setProto
public void setProto(ProtoableNode refProto)
-
releaseExternalProtos
public static void releaseExternalProtos(ProtoableNode node)
Static helper method to help prevent memory leaks in the case of circular fragment references. Recurses through children clearing moExternalProto (Watson 1610012).
-
-