Top Description Fields Constructors Methods
org.dom4j.tree

public Class FlyweightProcessingInstruction

extends AbstractProcessingInstruction
Class Inheritance
Known Direct Subclasses
org.dom4j.tree.DefaultProcessingInstruction
Imports
org.dom4j.Element, .Node, java.util.Collections, .Map

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.

Author
James Strachan
Version
$Revision: 1.7 $

Field Summary

Modifier and TypeField and 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

Constructor Summary

AccessConstructor and Description
public
FlyweightProcessingInstruction()

A default constructor for implementors to use.

public
FlyweightProcessingInstruction(String
is the name of the PI
target
,
Map<String, String>
is the Map of the values for the PI
values
)

This will create a new PI with the given target and values

public
FlyweightProcessingInstruction(String
is the name of the PI
target
,
String
is the values for the PI as text
text
)

This will create a new PI with the given target and values

Method Summary

Modifier and TypeMethod and Description
protected Node
public String
getTarget()

Implements org.dom4j.ProcessingInstruction.getTarget.

This method is the equivalent to the getNamemethod.
public String
public String
getValue(String
is the name of the attribute to lookup.
name
)

Implements org.dom4j.ProcessingInstruction.getValue.

Returns the value of a specific name in the PI.

public Map<String, String>
public void
setTarget(String
DOCUMENT ME!
target
)

Implements org.dom4j.ProcessingInstruction.setTarget.

This method is the equivalent to the setNamemethod.
Inherited from org.dom4j.tree.AbstractProcessingInstruction:
acceptasXMLgetNamegetNodeTypegetPathgetUniquePathparseValuesremoveValuesetNamesetValuesetValuestoStringtoStringwrite

Field Detail

targetback to summary
protected String target

The target of the PI

textback to summary
protected String text

The values for the PI as a String

valuesback to summary
protected Map<String, String> values

The values for the PI in name/value pairs

Constructor Detail

FlyweightProcessingInstructionback to summary
public FlyweightProcessingInstruction()

A default constructor for implementors to use.

FlyweightProcessingInstructionback to summary
public FlyweightProcessingInstruction(String target, Map<String, String> values)

This will create a new PI with the given target and values

Parameters
target:String

is the name of the PI

values:Map<String, String>

is the Map of the values for the PI

FlyweightProcessingInstructionback to summary
public FlyweightProcessingInstruction(String target, String text)

This will create a new PI with the given target and values

Parameters
target:String

is the name of the PI

text:String

is the values for the PI as text

Method Detail

createXPathResultback to summary
protected Node createXPathResult(Element parent)

Overrides org.dom4j.tree.AbstractNode.createXPathResult.

getTargetback to summary
public String getTarget()

Implements org.dom4j.ProcessingInstruction.getTarget.

Doc from org.dom4j.ProcessingInstruction.getTarget.

This method is the equivalent to the getNamemethod. It is added for clarity.

Returns:String

the target of this PI

getTextback to summary
public String getText()

Overrides org.dom4j.tree.AbstractNode.getText.

Implements org.dom4j.ProcessingInstruction.getText, org.dom4j.Node.getText.

Doc from org.dom4j.ProcessingInstruction.getText.

DOCUMENT ME!

Returns:String

the text for all the data associated with the processing instruction

getValueback to summary
public String getValue(String name)

Implements org.dom4j.ProcessingInstruction.getValue.

Doc from org.dom4j.ProcessingInstruction.getValue.

Returns the value of a specific name in the PI.

Parameters
name:String

is the name of the attribute to lookup.

Returns:String

the value of the named attribute

getValuesback to summary
public Map<String, String> getValues()

Implements org.dom4j.ProcessingInstruction.getValues.

Doc from org.dom4j.ProcessingInstruction.getValues.

DOCUMENT ME!

Returns:Map<String, String>

the values for this processing instruction as a Map

setTargetback to summary
public void setTarget(String target)

Implements org.dom4j.ProcessingInstruction.setTarget.

Doc from org.dom4j.ProcessingInstruction.setTarget.

This method is the equivalent to the setNamemethod. It is added for clarity.

Parameters
target:String

DOCUMENT ME!