org.jdom
Class ProcessingInstruction
- Cloneable, Serializable
public class ProcessingInstruction
An XML processing instruction. Methods allow the user to obtain the target of
the PI as well as its data. The data can always be accessed as a String or,
if the data appears akin to an attribute list, can be retrieved as name/value
pairs.
Version:
- Brett McLaughlin
- Jason Hunter
- Steven Gould
protected Map | mapData - The data for the PI in name/value pairs
|
protected String | rawData - The data for the PI as a String
|
protected String | target - The target of the PI
|
ProcessingInstruction() - Default, no-args constructor for implementations
to use if needed.
|
ProcessingInstruction(String target, Map data) - This will create a new
ProcessingInstruction
with the specified target and data.
|
ProcessingInstruction(String target, String data) - This will create a new
ProcessingInstruction
with the specified target and data.
|
Object | clone() - This will return a clone of this
ProcessingInstruction .
|
String | getData() - This will return the raw data from all instructions.
|
List | getPseudoAttributeNames() - This will return a
List containing the names of the
"attribute" style pieces of name/value pairs in this PI's data.
|
String | getPseudoAttributeValue(String name) - This will return the value for a specific
name/value pair on the PI.
|
String | getTarget() - This will retrieve the target of the PI.
|
String | getValue() - Returns the XPath 1.0 string value of this element, which is the
data of this PI.
|
boolean | removePseudoAttribute(String name) - This will remove the pseudo attribute with the specified name.
|
ProcessingInstruction | setData(Map data) - This will set the name/value pairs within the passed
Map as the pairs for the data of
this PI.
|
ProcessingInstruction | setData(String data) - This will set the raw data for the PI.
|
ProcessingInstruction | setPseudoAttribute(String name, String value) - This will set a pseudo attribute with the given name and value.
|
ProcessingInstruction | setTarget(String newTarget) - This will set the target for the PI.
|
String | toString() - This returns a
String representation of the
ProcessingInstruction , suitable for debugging.
|
mapData
protected Map mapData
The data for the PI in name/value pairs
rawData
protected String rawData
The data for the PI as a String
target
protected String target
The target of the PI
ProcessingInstruction
protected ProcessingInstruction()
Default, no-args constructor for implementations
to use if needed.
ProcessingInstruction
public ProcessingInstruction(String target,
Map data)
This will create a new ProcessingInstruction
with the specified target and data.
target
- String
target of PI.data
- Map
data for PI, in
name/value pairs
ProcessingInstruction
public ProcessingInstruction(String target,
String data)
This will create a new ProcessingInstruction
with the specified target and data.
target
- String
target of PI.data
- String
data for PI.
clone
public Object clone()
This will return a clone of this ProcessingInstruction
.
- clone in interface Content
Object
- clone of this
ProcessingInstruction
.
getData
public String getData()
This will return the raw data from all instructions.
String
- data of PI.
getPseudoAttributeNames
public List getPseudoAttributeNames()
This will return a List
containing the names of the
"attribute" style pieces of name/value pairs in this PI's data.
List
- the List
containing the
"attribute" names.
getPseudoAttributeValue
public String getPseudoAttributeValue(String name)
This will return the value for a specific
name/value pair on the PI. If no such pair is
found for this PI, null is returned.
name
- String
name of name/value pair
to lookup value for.
String
- value of name/value pair.
getTarget
public String getTarget()
This will retrieve the target of the PI.
String
- target of PI.
getValue
public String getValue()
Returns the XPath 1.0 string value of this element, which is the
data of this PI.
- getValue in interface Content
- the data of this PI
removePseudoAttribute
public boolean removePseudoAttribute(String name)
This will remove the pseudo attribute with the specified name.
name
- name of pseudo attribute to remove
boolean
- whether the requested
instruction was removed.
setData
public ProcessingInstruction setData(Map data)
This will set the name/value pairs within the passed
Map
as the pairs for the data of
this PI. The keys should be the pair name
and the values should be the pair values.
data
- new map data to use
ProcessingInstruction
- modified PI.
setData
public ProcessingInstruction setData(String data)
This will set the raw data for the PI.
data
- String
data of PI.
ProcessingInstruction
- this PI modified.
setPseudoAttribute
public ProcessingInstruction setPseudoAttribute(String name,
String value)
This will set a pseudo attribute with the given name and value.
If the PI data is not already in a pseudo-attribute format, this will
replace the existing data.
name
- String
name of pair.value
- String
value for pair.
ProcessingInstruction
this PI modified.
setTarget
public ProcessingInstruction setTarget(String newTarget)
This will set the target for the PI.
newTarget
- String
new target of PI.
ProcessingInstruction
- this PI modified.
toString
public String toString()
String
- information about the
ProcessingInstruction
Copyright B) 2004 Jason Hunter, Brett McLaughlin. All Rights Reserved.