Package com.adobe.xfa

Class Packet

    • Constructor Detail

      • Packet

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

      • 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.
      • 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.
      • 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.