Package org.dom4j.tree
Class FlyweightProcessingInstruction
- java.lang.Object
-
- org.dom4j.tree.AbstractNode
-
- org.dom4j.tree.AbstractProcessingInstruction
-
- org.dom4j.tree.FlyweightProcessingInstruction
-
- All Implemented Interfaces:
Serializable,Cloneable,Node,ProcessingInstruction
- Direct Known Subclasses:
DefaultProcessingInstruction
public class FlyweightProcessingInstruction extends AbstractProcessingInstruction
FlyweightProcessingInstructionis 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.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected StringtargetThe target of the PIprotected StringtextThe values for the PI as a Stringprotected Map<String,String>valuesThe values for the PI in name/value pairs-
Fields inherited from class org.dom4j.tree.AbstractNode
NODE_TYPE_NAMES
-
Fields inherited from interface org.dom4j.Node
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 Summary
Constructors 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 valuesFlyweightProcessingInstruction(String target, Map<String,String> values)This will create a new PI with the given target and values
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected NodecreateXPathResult(Element parent)StringgetTarget()This method is the equivalent to theNode.getName()method.StringgetText()Returns the text of this node.StringgetValue(String name)Returns the value of a specific name in the PI.Map<String,String>getValues()DOCUMENT ME!voidsetTarget(String target)This method is the equivalent to theNode.setName(java.lang.String)method.-
Methods inherited from class org.dom4j.tree.AbstractProcessingInstruction
accept, asXML, getName, getNodeType, getPath, getUniquePath, parseValues, removeValue, setName, setValue, setValues, toString, toString, write
-
Methods inherited from class org.dom4j.tree.AbstractNode
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
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.dom4j.Node
asXPathResult, clone, createXPath, detach, getDocument, getNodeTypeName, getParent, getPath, getStringValue, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setParent, setText, supportsParent, valueOf
-
-
-
-
Constructor Detail
-
FlyweightProcessingInstruction
public FlyweightProcessingInstruction()
A default constructor for implementors to use.
-
FlyweightProcessingInstruction
public FlyweightProcessingInstruction(String target, Map<String,String> values)
This will create a new PI with the given target and values
- Parameters:
target- is the name of the PIvalues- is theMapof the values for the PI
-
-
Method Detail
-
getTarget
public String getTarget()
Description copied from interface:ProcessingInstructionThis method is the equivalent to theNode.getName()method. It is added for clarity.- Returns:
- the target of this PI
-
setTarget
public void setTarget(String target)
Description copied from interface:ProcessingInstructionThis method is the equivalent to theNode.setName(java.lang.String)method. It is added for clarity.- Parameters:
target- DOCUMENT ME!
-
getText
public String getText()
Description copied from interface:NodeReturns the text of this node.
- Specified by:
getTextin interfaceNode- Specified by:
getTextin interfaceProcessingInstruction- Overrides:
getTextin classAbstractNode- Returns:
- the text for this node.
-
getValue
public String getValue(String name)
Description copied from interface:ProcessingInstructionReturns the value of a specific name in the PI.
- Parameters:
name- is the name of the attribute to lookup.- Returns:
- the value of the named attribute
-
getValues
public Map<String,String> getValues()
Description copied from interface:ProcessingInstructionDOCUMENT ME!- Returns:
- the values for this processing instruction as a Map
-
createXPathResult
protected Node createXPathResult(Element parent)
- Overrides:
createXPathResultin classAbstractNode
-
-