Package com.adobe.xfa

Class 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.
  • Constructor Details

    • ProtoableNode

      public ProtoableNode()
  • Method Details

    • clone

      public Element clone(Element parent, boolean bDeep)
      clone will establish any proto relationships
      Overrides:
      clone in class Element
    • 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.
      See Also:
    • externalProtoFailed

      public final boolean externalProtoFailed()
    • fetchIDValues

      public void fetchIDValues(List<String> idValues)
    • getProtoed

      public ProtoableNode getProtoed(int nIndex)
    • getScriptTable

      public ScriptTable getScriptTable()
      Overrides:
      getScriptTable in class Element
    • updateIDValues

      public void updateIDValues(String sPrefix, List<String> oldReferenceList)
    • getAttribute

      public Attribute getAttribute(int eTag, boolean bPeek, boolean bValidate)
      Description copied from class: Element
      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.

      Overrides:
      getAttribute in class Element
      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(String aAttrName, boolean bSearchProto)
      get the named attribute.
      Overrides:
      getAttributeByName in class Element
      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: Element
      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.

      Overrides:
      getElement in class Element
      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:
      getOneOfChild in class Element
    • getPI

      public void getPI(String aPiName, List<String> pis, boolean bCheckProtos)
      Description copied from class: Element
      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.
      Overrides:
      getPI in class Element
      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(String aPiName, String sPropName, List<String> pis, boolean bCheckProtos)
      Description copied from class: Element
      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.
      Overrides:
      getPI in class Element
      Parameters:
      aPiName - the processing instructions target name
      sPropName - the processing instructions property name
      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.
    • 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.
      Overrides:
      getText in class Element
      Parameters:
      bPeek -
      bReturnDefault -
      bValidate -
      Returns:
      A TextNode if found (or created). null otherwise.
    • 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:
      isDefault in class Node
      See Also:
    • isSpecified

      public boolean isSpecified(int eTag, int eType, boolean bCheckProtos, int nOccurrence)
      Overrides:
      isSpecified in class Element
    • notifyPeers

      public void notifyPeers(int eventType, String arg1, 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:
      notifyPeers in interface Peer
      Overrides:
      notifyPeers in class Node
      Parameters:
      eventType - the event type as enumerated in this class
      arg1 - additional event information
      arg2 - additional event information
    • performResolveProtos

      public boolean performResolveProtos(boolean bResolveExternalProtos)
    • preSave

      public void preSave(boolean bSaveXMLScript)
      Overrides:
      preSave in class Element
      See Also:
    • 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: Element
      Set an element value. Must be a valid 0..1 element, (not a oneOfChild or a 0..n child)
      Overrides:
      setElement in class Element
      Parameters:
      child - the child to add or set.
      eTag - only used if oChild isNull -- in which case we remove the element
      See Also:
    • setOneOfChild

      public Node setOneOfChild(Node child)
      Description copied from class: Element
      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.
      Overrides:
      setOneOfChild in class Element
      Parameters:
      child - the child to set. If this is a null object, any any existing "oneOf" child will be deleted.
      See Also:
    • setAttribute

      public void setAttribute(Attribute attr, int eTag)
      Sets an attribute of this element.
      Overrides:
      setAttribute in class Element
      Parameters:
      attr - the attribute.
      eTag - The XFA tag name of the attribute being set.
    • setPermsLock

      public void setPermsLock(boolean bPermsLock)
      Description copied from class: Node
      Sets the permissions state of this node. Locking a node will cause some attempts to invoke methods or set properties to throw an exception.
      Overrides:
      setPermsLock in class Node
      Parameters:
      bPermsLock - the permissions state to set this node to: true will lock the node; false will 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).