|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.cdmckay.coffeedom.Content org.cdmckay.coffeedom.ProcessingInstruction
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.
Field Summary | |
---|---|
protected Map<String,String> |
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 |
Fields inherited from class org.cdmckay.coffeedom.Content |
---|
parent |
Constructor Summary | |
---|---|
protected |
ProcessingInstruction()
Default, no-args constructor for implementations to use if needed. |
|
ProcessingInstruction(String target,
Map<String,String> 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. |
Method Summary | |
---|---|
ProcessingInstruction |
clone()
This will return a clone of this ProcessingInstruction . |
ProcessingInstruction |
detach()
Detaches this child from its parent or does nothing if the child has no parent. |
String |
getData()
This will return the raw data from all instructions. |
List<String> |
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<String,String> 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. |
protected ProcessingInstruction |
setParent(Parent parent)
Sets the parent of this Content. |
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. |
Methods inherited from class org.cdmckay.coffeedom.Content |
---|
equals, getDocument, getParent, getParentElement, hashCode |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected String target
protected String rawData
protected Map<String,String> mapData
Constructor Detail |
---|
protected ProcessingInstruction()
public ProcessingInstruction(String target, Map<String,String> data)
ProcessingInstruction
with the specified target and data.
target
- String
target of PI.data
- Map
data for PI, in name/value pairs
IllegalTargetException
- if the given target is illegal as a processing instruction name.public ProcessingInstruction(String target, String data)
ProcessingInstruction
with the specified target and data.
target
- String
target of PI.data
- String
data for PI.
IllegalTargetException
- if the given target is illegal as a processing instruction name.Method Detail |
---|
public ProcessingInstruction setTarget(String newTarget)
newTarget
- String
new target of PI.
ProcessingInstruction
- this PI modified.public String getValue()
getValue
in class Content
public String getTarget()
String
- target of PI.public String getData()
String
- data of PI.public List<String> getPseudoAttributeNames()
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.public ProcessingInstruction setData(String data)
data
- String
data of PI.
ProcessingInstruction
- this PI modified.public ProcessingInstruction setData(Map<String,String> data)
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.public String getPseudoAttributeValue(String name)
name
- String
name of name/value pair to lookup value for.
String
- value of name/value pair.public ProcessingInstruction setPseudoAttribute(String name, String value)
name
- String
name of pair.value
- String
value for pair.
ProcessingInstruction
this PI modified.public boolean removePseudoAttribute(String name)
name
- name of pseudo attribute to remove
boolean
- whether the requested instruction was removed.protected ProcessingInstruction setParent(Parent parent)
Content
setParent
in class Content
parent
- new parent element
public ProcessingInstruction clone()
ProcessingInstruction
.
clone
in class Content
Object
- clone of this ProcessingInstruction
.public ProcessingInstruction detach()
Content
detach
in class Content
public String toString()
String
representation of the ProcessingInstruction
, suitable for
debugging. If the XML representation of the ProcessingInstruction
is desired, XMLOutputter.outputString(ProcessingInstruction)
should be used.
toString
in class Object
String
- information about the ProcessingInstruction
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |