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 and Description |
|---|---|
protected java.lang.String |
target
The target of the PI
|
protected java.lang.String |
text
The values for the PI as a String
|
protected java.util.Map<java.lang.String,java.lang.String> |
values
The values for the PI in name/value pairs
|
NODE_TYPE_NAMESANY_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 and Description |
|---|
FlyweightProcessingInstruction()
A default constructor for implementors to use.
|
FlyweightProcessingInstruction(java.lang.String target,
java.util.Map<java.lang.String,java.lang.String> values)
This will create a new PI with the given target and values
|
FlyweightProcessingInstruction(java.lang.String target,
java.lang.String text)
This will create a new PI with the given target and values
|
| Modifier and Type | Method and Description |
|---|---|
protected Node |
createXPathResult(Element parent) |
java.lang.String |
getTarget()
This method is the equivalent to the
Node.getName()method. |
java.lang.String |
getText()
Returns the text of this node.
|
java.lang.String |
getValue(java.lang.String name)
Returns the value of a specific name in the PI.
|
java.util.Map<java.lang.String,java.lang.String> |
getValues()
DOCUMENT ME!
|
void |
setTarget(java.lang.String target)
This method is the equivalent to the
Node.setName(java.lang.String)method. |
accept, asXML, getName, getNodeType, getPath, getUniquePath, parseValues, removeValue, setName, setValue, setValues, toString, toString, writeasXPathResult, 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, valueOfequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitasXPathResult, clone, createXPath, detach, getDocument, getNodeTypeName, getParent, getPath, getStringValue, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setParent, setText, supportsParent, valueOfprotected java.lang.String target
protected java.lang.String text
protected java.util.Map<java.lang.String,java.lang.String> values
public FlyweightProcessingInstruction()
public FlyweightProcessingInstruction(java.lang.String target,
java.util.Map<java.lang.String,java.lang.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 FlyweightProcessingInstruction(java.lang.String target,
java.lang.String text)
This will create a new PI with the given target and values
target - is the name of the PItext - is the values for the PI as textpublic java.lang.String getTarget()
ProcessingInstructionNode.getName()method. It is added
for clarity.public void setTarget(java.lang.String target)
ProcessingInstructionNode.setName(java.lang.String)method. It is added
for clarity.target - DOCUMENT ME!public java.lang.String getText()
NodeReturns the text of this node.
getText in interface NodegetText in interface ProcessingInstructiongetText in class AbstractNodepublic java.lang.String getValue(java.lang.String name)
ProcessingInstructionReturns the value of a specific name in the PI.
name - is the name of the attribute to lookup.public java.util.Map<java.lang.String,java.lang.String> getValues()
ProcessingInstructionprotected Node createXPathResult(Element parent)
createXPathResult in class AbstractNode