Package com.adobe.xfa

Class Packet

All Implemented Interfaces:
Element.DualDomNode, Peer

public final class Packet extends Element implements Element.DualDomNode
A class to represent the children of the XFA app model that are not otherwise represented by a model.
  • Constructor Details

    • Packet

      public Packet(Element parent, Node prevSibling)
      Instantiates a packet node.
  • Method Details

    • getAttribute

      public String getAttribute(String sAttrName)
      XFAPackets have no formal schema, so getProperty does not work to return attributes. Instead, provide an accessor to return arbitrary attribute values.
      Parameters:
      sAttrName - The name of the attribute to return
      Returns:
      the attribute value, or the empty string if it doesn't exist or is empty.
    • getContent

      public String getContent()
      Gets this packet's content. If this packet has content, return it. Note that for packets that contain XML content, this should return an empty string.
      Returns:
      the packet content. If this packet has text content, the text is returned. Note that for packets that contain XML content, an empty string is returned.
    • getName

      public String getName()
      Gets this packet's name.
      Overrides:
      getName in class Element
      Returns:
      the name of the element.
    • getScriptTable

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

      public boolean isValidAttr(int eTag, boolean bReport, String value)
      Determines if the given attribute tag is a valid attribute of this packet.
      Overrides:
      isValidAttr in class Element
      Parameters:
      eTag - the XFA tag to check
      Returns:
      true if valid.
      See Also:
    • getFirstXFAChild

      public Node getFirstXFAChild()
      Gets this element's first child that is an XFA node.
      Overrides:
      getFirstXFAChild in class Element
      Returns:
      null -- the children of packet nodes are not exposed.
    • serialize

      public void serialize(OutputStream outStream, DOMSaveOptions options, int level, Node prevSibling) throws IOException, IOException
      Description copied from class: Node
      The helper function used by saveXML()
      Overrides:
      serialize in class Element
      Parameters:
      outStream - Streamfile to write to
      options - save options
      level - the indent level
      prevSibling - our previous sibling -- needed for some markup options.
      Throws:
      IOException
      See Also:
    • removeAttribute

      public void removeAttribute(String sAttrName)
      Removes the specified attribute.
      Parameters:
      sAttrName - the name of the attribute to remove.
    • setAttribute

      public void setAttribute(String sValue, String sAttrName)
      XFAPackets have no formal schema, so setProperty does not work to set attributes. Instead, this sets arbitrary attribute values. If the attribute exists, we populate it, if it doesn't exist we create it.
      Parameters:
      sValue - The value of the attribute to set
      sAttrName - The name of the attribute to set
    • setContent

      public void setContent(String sContent)
      Sets this packet's content.
      Parameters:
      sContent - the text content value.
    • setXmlPeer

      public void setXmlPeer(Node peer)
      Specified by:
      setXmlPeer in interface Element.DualDomNode
    • getXmlPeer

      public Node getXmlPeer()
      Specified by:
      getXmlPeer in interface Element.DualDomNode