Package com.adobe.xfa

Class Packet

    • Constructor Detail

      • Packet

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

      • getAttribute

        public java.lang.String getAttribute​(java.lang.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 java.lang.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 java.lang.String getName()
        Gets this packet's name.
        Overrides:
        getName in class Element
        Returns:
        the name of the element.
      • isValidAttr

        public boolean isValidAttr​(int eTag,
                                   boolean bReport,
                                   java.lang.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:
        Element.isValidAttr(int, boolean, String)
      • 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​(java.io.OutputStream outStream,
                              DOMSaveOptions options,
                              int level,
                              Node prevSibling)
                       throws java.io.IOException,
                              java.io.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:
        java.io.IOException
        See Also:
        Node.serialize(OutputStream, DOMSaveOptions, int, Node)
      • removeAttribute

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

        public void setAttribute​(java.lang.String sValue,
                                 java.lang.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​(java.lang.String sContent)
        Sets this packet's content.
        Parameters:
        sContent - the text content value.