cwi.GraphXML
Class InterpretDocument

java.lang.Object
  extended by cwi.GraphXML.InterpretDocument

public class InterpretDocument
extends java.lang.Object

Interpret a full GraphXML document. This class is a collection of convenience routines, which go through the full GraphXML document tree, manage each of the different types of elements separately, and invoke the corresponding semantic methods.

The class has to be initialized with a GraphSemantics instance. In fact, this class is never used in isolation; it is initialized and used by the AbstractParser internally.

Author:
Ivan Herman
See Also:
GraphSemantics, AbstractParser

Field Summary
(package private)  GraphSemantics sem
           
 
Constructor Summary
InterpretDocument(GraphSemantics sema, ParserError p)
           
 
Method Summary
protected  void editEdge(org.w3c.dom.Node edge, boolean remove)
           
protected  void editNode(org.w3c.dom.Node node, boolean remove)
          Edit a node.
protected  void interpretEdge(org.w3c.dom.Node edge)
          Interpret an edge.
protected  void interpretEdit(org.w3c.dom.Node edit)
          Interpret an edit block
protected  void interpretEditBundle(org.w3c.dom.Node child)
          An edit bundle.
protected  void interpretGraph(org.w3c.dom.Node graph)
          A full graph.
protected  void interpretNode(org.w3c.dom.Node node)
          Interpret a node.
(package private)  void setFileLevelStyle(Style style)
          Set the file level style.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sem

GraphSemantics sem
Constructor Detail

InterpretDocument

InterpretDocument(GraphSemantics sema,
                  ParserError p)
Parameters:
sema - the semantics methods which will be used during interpretation
Method Detail

setFileLevelStyle

void setFileLevelStyle(Style style)
Set the file level style.

Parameters:
style - the file level style.

interpretGraph

protected void interpretGraph(org.w3c.dom.Node graph)
A full graph. It has its own attributes and application data; apart from this it is a bunch of nodes and edges.

Parameters:
graph - the full graph

interpretNode

protected void interpretNode(org.w3c.dom.Node node)
Interpret a node. It may have a bunch of application data, and attributes, too.


editNode

protected void editNode(org.w3c.dom.Node node,
                        boolean remove)
Edit a node. It may have a bunch of application data, and attributes, too.

Parameters:
node - the node element itself
remove - if true, the action is remove; if false, the action is replace

interpretEdge

protected void interpretEdge(org.w3c.dom.Node edge)
Interpret an edge. It may have a bunch of application data, and attributes, too.


editEdge

protected void editEdge(org.w3c.dom.Node edge,
                        boolean remove)

interpretEdit

protected void interpretEdit(org.w3c.dom.Node edit)
Interpret an edit block


interpretEditBundle

protected void interpretEditBundle(org.w3c.dom.Node child)
An edit bundle. This is just a list of edit elements, preceeded and followed by a call to the semantic routines.

Parameters:
child - the edit bundle