dk.brics.xmlgraph
Class ElementNode

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

public class ElementNode
extends SingleContentNode
implements ConcreteNode

Element node.

For convenience, whitespace status may be expressed by a flag on the element node.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class dk.brics.xmlgraph.SingleContentNode
content
 
Fields inherited from class dk.brics.xmlgraph.Node
index, origin
 
Constructor Summary
ElementNode(Automaton name, int content, boolean ws, Origin origin)
          Constructs a new element node.
 
Method Summary
protected  ElementNode clone()
          Clones this node.
 Automaton getName()
          Returns possible attribute names.
 boolean isWs()
          Returns whitespace status.
<T> T
process(NodeProcessor<T> v)
          Applies the given node processor on this node.
 void setName(Automaton name, XMLGraph xg)
          Sets the possible names.
 
Methods inherited from class dk.brics.xmlgraph.SingleContentNode
getContent, setContent
 
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

ElementNode

public ElementNode(Automaton name,
                   int content,
                   boolean ws,
                   Origin origin)
Constructs a new element node.

Parameters:
name - possible names
content - index of node representing element content
ws - if true, the element may be surrounded by arbitrary whitespace (in addition to what else is declared)
origin - source information (null if not applicable)
Method Detail

clone

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

Specified by:
clone in class SingleContentNode

getName

public Automaton getName()
Returns possible attribute names.

Returns:
automaton representing possible names

isWs

public boolean isWs()
Returns whitespace status.

Returns:
true if the element may be surrounded by arbitrary whitespace

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

setName

public void setName(Automaton name,
                    XMLGraph xg)
Sets the possible names. This operation replaces the node in the XML graph.

Parameters:
name - possible names
xg - the current XML graph


Copyright © 2005-2010 Anders Møller.