dk.brics.xmlgraph
Class TextNode

java.lang.Object
  extended by dk.brics.xmlgraph.Node
      extended by dk.brics.xmlgraph.NoContentNode
          extended by dk.brics.xmlgraph.TextNode
All Implemented Interfaces:
ConcreteNode, Serializable, Cloneable

public class TextNode
extends NoContentNode
implements ConcreteNode

Text node.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class dk.brics.xmlgraph.Node
index, origin
 
Constructor Summary
TextNode(Automaton text, Origin origin)
          Constructs a new text node (representing character data or attribute values)
 
Method Summary
protected  TextNode clone()
          Clones this node.
 Automaton getText()
          Returns possible values.
<T> T
process(NodeProcessor<T> v)
          Applies the given node processor on this node.
 void replaceText(Automaton text, XMLGraph xg)
          Sets the possible values.
 boolean setText(Automaton text, XMLGraph xg)
          Sets the possible values.
 
Methods inherited from class dk.brics.xmlgraph.Node
getIndex, getOrigin, setOrigin
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface dk.brics.xmlgraph.ConcreteNode
getIndex
 

Constructor Detail

TextNode

public TextNode(Automaton text,
                Origin origin)
Constructs a new text node (representing character data or attribute values)

Parameters:
text - possible values
origin - source information (null if not applicable)
Method Detail

clone

protected TextNode clone()
Description copied from class: Node
Clones this node.

Specified by:
clone in class NoContentNode

getText

public Automaton getText()
Returns possible values.

Returns:
automaton representing possible values

process

public <T> T process(NodeProcessor<T> v)
Description copied from class: Node
Applies the given node processor on this node.

Specified by:
process in class Node
Type Parameters:
T - return type
Parameters:
v - node processor
Returns:
result from processor

replaceText

public void replaceText(Automaton text,
                        XMLGraph xg)
Sets the possible values. This operation replaces the node in the XML graph.

Parameters:
text - possible values
xg - the current XML graph

setText

public boolean setText(Automaton text,
                       XMLGraph xg)
Sets the possible values. If changes are made, this operation replaces the node in the XML graph.

Parameters:
text - possible values
xg - the current XML graph
Returns:
true if any changes are made


Copyright © 2005-2010 Anders Møller.