| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objectnu.xom.Node
nu.xom.ProcessingInstruction
This class represents an XML processing instruction. Each processing instruction has two key properties:
?>
. The syntax of the data
depends completely on the processing instruction.
Other than forbidding ?>
, XML defines
no rules for processing instruction data.
Constructor Summary | |
ProcessingInstruction(ProcessingInstruction instruction)
Create a copy of a processing instruction. | |
ProcessingInstruction(String target,
String data)
Create a processing instruction with a certain target and data. |
Method Summary | |
Node | copy()
Returns a deep copy of this processing instruction with no parent, that can be added to this document or a different one. |
Node | getChild(int position)
Throws IndexOutOfBoundsException because
processing instructions do not have children. |
int | getChildCount()
Returns 0 because processing instructions do not have children. |
String | getTarget()
Returns the processing instruction target. |
String | getValue()
Returns the processing instruction data. |
void | setTarget(String target)
Sets the target. |
void | setValue(String data)
Sets the data. |
String | toString()
Returns a String representation
of this processing instruction suitable for
debugging and diagnosis. |
String | toXML()
Returns the actual XML form of this processing instruction, such as might be copied and pasted from the original document. |
Methods inherited from class nu.xom.Node |
detach, equals, getBaseURI, getDocument, getParent, hashCode |
Methods inherited from class Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ProcessingInstruction(String target,
String data)
Create a processing instruction with a certain target and data.
target
- the target of the processing instructiondata
- the processing instruction data
IllegalTargetException
- if the target is not a
non-colonized name or is the string "xml" in any case
IllegalDataException
- if data contains "?>" or any
other illegal characters
public ProcessingInstruction(ProcessingInstruction instruction)
Create a copy of a processing instruction.
instruction
- the processing instruction to copyMethod Detail |
public final String getTarget()
Returns the processing instruction target.
public void setTarget(String target)
Sets the target.
target
- the new target
IllegalTargetException
- if the proposed target
is not an XML 1.0 non-colonized name or is the string
"xml" in any case
public void setValue(String data)
Sets the data.
data
- the data to set
IllegalDataException
- if data
is null
or otherwise not legal XML processing instruction data
public final String getValue()
Returns the processing instruction data.
getValue
in class Node
public final Node getChild(int position)
Throws IndexOutOfBoundsException
because
processing instructions do not have children.
getChild
in class Node
position
- the index of the child node to return
IndexOutOfBoundsException
- because processing
instructions do not have children
public final int getChildCount()
Returns 0 because processing instructions do not have children.
getChildCount
in class Node
public final String toXML()
Returns the actual XML form of this processing instruction, such as might be copied and pasted from the original document.
toXML
in class Node
String
public Node copy()
Returns a deep copy of this processing instruction with no parent, that can be added to this document or a different one.
copy
in class Node
ProcessingInstruction
with no parent
public final String toString()
Returns a String
representation
of this processing instruction suitable for
debugging and diagnosis. This is not
the XML representation of this processing instruction.
ProcessingInstruction
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |