Serializable
, Cloneable
, Node
, ProcessingInstruction
DefaultProcessingInstruction
public class FlyweightProcessingInstruction extends AbstractProcessingInstruction
FlyweightProcessingInstruction
is a Flyweight pattern
implementation of a singly linked, read-only XML Processing Instruction.
This node could be shared across documents and elements though it does not support the parent relationship.
Modifier and Type | Field | Description |
---|---|---|
protected String |
target |
The target of the PI
|
protected String |
text |
The values for the PI as a String
|
protected Map<String,String> |
values |
The values for the PI in name/value pairs
|
NODE_TYPE_NAMES
ANY_NODE, ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, MAX_NODE_TYPE, NAMESPACE_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE, UNKNOWN_NODE
Constructor | Description |
---|---|
FlyweightProcessingInstruction() |
A default constructor for implementors to use.
|
FlyweightProcessingInstruction(String target,
String text) |
This will create a new PI with the given target and values
|
FlyweightProcessingInstruction(String target,
Map<String,String> values) |
This will create a new PI with the given target and values
|
Modifier and Type | Method | Description |
---|---|---|
protected Node |
createXPathResult(Element parent) |
|
String |
getTarget() |
This method is the equivalent to the
Node.getName() method. |
String |
getText() |
Returns the text of this node.
|
String |
getValue(String name) |
Returns the value of a specific name in the PI.
|
Map<String,String> |
getValues() |
DOCUMENT ME!
|
void |
setTarget(String target) |
This method is the equivalent to the
Node.setName(java.lang.String) method. |
asXPathResult, clone, createPattern, createXPath, createXPathFilter, detach, getDocument, getDocumentFactory, getNodeTypeName, getParent, getPath, getStringValue, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setParent, setText, supportsParent, valueOf
accept, asXML, getName, getNodeType, getPath, getUniquePath, parseValues, removeValue, setName, setValue, setValues, toString, toString, write
asXPathResult, clone, createXPath, detach, getDocument, getNodeTypeName, getParent, getPath, getStringValue, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setParent, setText, supportsParent, valueOf
protected String target
protected String text
public FlyweightProcessingInstruction()
public FlyweightProcessingInstruction(String target, Map<String,String> values)
This will create a new PI with the given target and values
target
- is the name of the PIvalues
- is the Map
of the values for the PIpublic String getTarget()
ProcessingInstruction
Node.getName()
method. It is added
for clarity.public void setTarget(String target)
ProcessingInstruction
Node.setName(java.lang.String)
method. It is added
for clarity.target
- DOCUMENT ME!public String getText()
Node
Returns the text of this node.
getText
in interface Node
getText
in interface ProcessingInstruction
getText
in class AbstractNode
public String getValue(String name)
ProcessingInstruction
Returns the value of a specific name in the PI.
name
- is the name of the attribute to lookup.public Map<String,String> getValues()
ProcessingInstruction
protected Node createXPathResult(Element parent)
createXPathResult
in class AbstractNode