|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnu.xom.Node
nu.xom.LeafNode
nu.xom.ProcessingInstruction
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(java.lang.String target,
java.lang.String data)
Create a processing instruction with a certain target and data. |
Method Summary | |
protected void |
checkTarget(java.lang.String target)
Subclasses can override this method to perform additional checks on the data beyond what XML 1.0 requires. |
protected void |
checkValue(java.lang.String data)
Subclasses can override this method to perform additional checks on the data beyond what XML 1.0 requires. |
Node |
copy()
Returns a deep copy of this processing instruction with no parent, that can be added to this document or a different one. |
java.lang.String |
getTarget()
Returns the processing instruction target. |
java.lang.String |
getValue()
Returns the processing instruction data. |
void |
setTarget(java.lang.String target)
Sets the target. |
void |
setValue(java.lang.String data)
Sets the data. |
java.lang.String |
toString()
Returns a String representation
of this processing instruction suitable for
debugging and diagnosis. |
java.lang.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.LeafNode |
getChild, getChildCount, hasChildren |
Methods inherited from class nu.xom.Node |
checkDetach, detach, equals, getBaseURI, getDocument, getParent, hashCode |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ProcessingInstruction(java.lang.String target, java.lang.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 made of the string "xml"
in any case.
IllegalDataException
- if data contains "?>" or any
other illegal characterspublic ProcessingInstruction(ProcessingInstruction instruction)
Create a copy of a processing instruction.
instruction
- the processing instruction to copyMethod Detail |
public final java.lang.String getTarget()
Returns the processing instruction target.
public final void setTarget(java.lang.String target)
Sets the target.
target
- the new target
IllegalTargetException
- if the proposed target
is not an XML 1.0 non-colonized name
XMLException
- if the proposed target does not
satisfy the local constraintsprotected void checkTarget(java.lang.String target)
Subclasses can override this method to perform additional checks on the data beyond what XML 1.0 requires. For example, an XMLStylesheet subclass might throw an exception if the target were not xml-stylesheet.
target
- the potential target to check.
XMLException
- if the proposed target
does not satisfy the local constraintspublic final void setValue(java.lang.String data)
Sets the data.
data
- the data to set
IllegalDataException
- if data
is null
or otherwise not legal XML processingInstrcution data
XMLException
- if the proposed data does not satisfy
the local constraintspublic final java.lang.String getValue()
Returns the processing instruction data.
getValue
in class Node
Node.getValue()
protected void checkValue(java.lang.String data)
Subclasses can override this method to perform
additional checks on the data beyond what XML 1.0 requires.
For example, an XMLStylesheet
subclass might
throw an exception if the data did not have a pseudo-attribute
format.
data
- the potential data to check.
XMLException
- if the proposed data does not
satisfy the local constraintspublic final java.lang.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
Node.toXML()
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 parentNode.copy()
public final java.lang.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.
toString
in class Node
ProcessingInstruction
Object.toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |