XML Parser for Java 1.1.16

com.ibm.xml.parser
Class TXPI

java.lang.Object
  |
  +--com.ibm.xml.parser.Child
        |
        +--com.ibm.xml.parser.TXPI
Direct Known Subclasses:
StylesheetPI, TreeFactory.TreePI

public class TXPI
extends Child
implements ProcessingInstruction

The TXPI class implements the PI interface as defined by the Document Object Model (DOM), and implements the Namespace interface as defined by the W3C.

A PI Node is a "processing instruction" for use by XML4J or an application. The content of the PI Node is the entire content between the delimiters of the processing instruction.

Version:
Revision: 40 1.15 src/com/ibm/xml/parser/TXPI.java, xml4jsrc, xml4j-jtcsv, xml4j_1_1_16
See Also:
ProcessingInstruction, Child, Serialized Form

Fields inherited from class com.ibm.xml.parser.Child
ATTDEF, ATTLIST, ELEMENT_DECL, NAME_ATTDEF, NAME_ATTLIST, NAME_CDATA, NAME_COMMENT, NAME_DOCFRAGMENT, NAME_DOCUMENT, NAME_ELEMENT_DECL, NAME_PSEUDONODE, NAME_TEXT, PSEUDONODE
 
Constructor Summary
TXPI(java.lang.String name, java.lang.String data)
          Constructor.
 
Method Summary
 void acceptPost(Visitor visitor)
          Implements the accept operation of the visitor design pattern when the end of a TXPI Node is recognized when traversing the document object tree.
 void acceptPre(Visitor visitor)
          Implements the accept operation of the visitor design pattern when the start of a TXPI Node is recognized when traversing the document object tree.
 java.lang.Object clone()
          Clone this PI Node using the appropriate factory.
 boolean equals(Node arg, boolean deep)
           
 java.lang.String getData()
          Returns the data of the PI.
 java.lang.String getName()
          Deprecated. Use getNodeName()
 java.lang.String getNodeName()
          This method is defined by DOM.
 short getNodeType()
          Returns that this object is a PI Node.
 java.lang.String getNodeValue()
          Returns the data of the PI.
 java.lang.String getTarget()
          This method is defined by DOM.
 java.lang.String getText()
          Return all text associated with this Node without considering entities.
 void setData(java.lang.String data)
          Sets the data of the PI.
 void setNodeValue(java.lang.String data)
          Sets the data of the PI.
 void setTarget(java.lang.String arg)
          This method is defined by DOM.
 
Methods inherited from class com.ibm.xml.parser.Child
appendChild, clearDigest, cloneNode, getAttributes, getChildNodes, getDigest, getFactory, getFirstChild, getFirstWithoutReference, getLastChild, getLastWithoutReference, getNextSibling, getNextWithoutReference, getOwnerDocument, getParentNode, getParentWithoutReference, getPreviousSibling, getPreviousWithoutReference, getUserData, hasChildNodes, insertBefore, makeXPointer, print, print, removeChild, replaceChild, searchAncestors, searchAncestors, setFactory, setUserData, toXMLString, toXMLString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TXPI

public TXPI(java.lang.String name,
            java.lang.String data)
Constructor.
Parameters:
name - The first token following the markup.
data - From the first non white space character after PI target (name) to the character immediately preceding the ?>.
Method Detail

clone

public java.lang.Object clone()
Clone this PI Node using the appropriate factory.

This method is defined by Child.

Returns:
Cloned PI Node.
Overrides:
clone in class Child
See Also:
Child.clone()

equals

public boolean equals(Node arg,
                      boolean deep)
Parameters:
deep - Ignored.
Overrides:
equals in class Child

getNodeType

public short getNodeType()
Returns that this object is a PI Node.

This method is defined by DOM.

Returns:
PI Node indicator.

getNodeName

public java.lang.String getNodeName()

This method is defined by DOM.


getName

public java.lang.String getName()
Deprecated. Use getNodeName()
Returns the qualified name of this PI. The name is the first token following the markup. If this PI's name has a namespace prefix, the prefix will still be attached.
Returns:
The PI name, or null if no name.

getTarget

public java.lang.String getTarget()

This method is defined by DOM.

Specified by:
getTarget in interface ProcessingInstruction
See Also:
getName()

setTarget

public void setTarget(java.lang.String arg)

This method is defined by DOM.


getData

public java.lang.String getData()
Returns the data of the PI. The PI data is from the character immediately after the PI name to the character immediately preceding the ?>.

This method is defined by DOM.

Specified by:
getData in interface ProcessingInstruction
Returns:
The PI data.
See Also:
setData(java.lang.String)

getNodeValue

public java.lang.String getNodeValue()
Returns the data of the PI. The PI data is from the character immediately after the PI name to the character immediately preceding the ?>.

This method is defined by DOM.

Overrides:
getNodeValue in class Child

setData

public void setData(java.lang.String data)
Sets the data of the PI. The PI data is from the character immediately after the PI name to the character immediately preceding the ?>.

This method is defined by DOM.

Specified by:
setData in interface ProcessingInstruction
Parameters:
data - The PI data.
See Also:
getData()

setNodeValue

public void setNodeValue(java.lang.String data)
Sets the data of the PI. The PI data is from the character immediately after the PI name to the character immediately preceding the ?>.

This method is defined by DOM.

Parameters:
data - The PI data.
Overrides:
setNodeValue in class Child
See Also:
getNodeValue()

getText

public java.lang.String getText()
Return all text associated with this Node without considering entities.

This method is defined by Child.

Returns:
Always returns "".
Overrides:
getText in class Child
See Also:
Child.toXMLString(java.io.Writer, java.lang.String)

acceptPre

public void acceptPre(Visitor visitor)
               throws java.lang.Exception
Implements the accept operation of the visitor design pattern when the start of a TXPI Node is recognized when traversing the document object tree.
Parameters:
visitor - The implemention of the Visitor operation (toXMLString, digest, ...)
Throws:
java.lang.Exception - Thrown if this Node can not be visitted, or traversal modification is requested.
See Also:
Visitor, TreeTraversal, NonRecursivePreorderTreeTraversal, TreeTraversalException

acceptPost

public void acceptPost(Visitor visitor)
                throws java.lang.Exception
Implements the accept operation of the visitor design pattern when the end of a TXPI Node is recognized when traversing the document object tree.
Parameters:
visitor - The implemention of the Visitor operation (toXMLString, digest, ...)
Throws:
java.lang.Exception - Thrown if this Node can not be visitted, or traversal modification is requested.
See Also:
Visitor, TreeTraversal, NonRecursivePreorderTreeTraversal, TreeTraversalException

XML Parser for Java 1.1.16