jaxe.equations
Class DOMMathBuilder

java.lang.Object
  extended by jaxe.equations.DOMMathBuilder

public class DOMMathBuilder
extends java.lang.Object

The builder for creating a MathElement tree

Version:
%I%, %G%
Author:
Stephan Michels

Field Summary
private static org.apache.log4j.Logger LOG
          Logger for this class
private  MathRootElement rootElement
           
 
Constructor Summary
DOMMathBuilder(org.w3c.dom.Document document)
          Constructs a builder
 
Method Summary
private  java.lang.String getAttribute(org.w3c.dom.NamedNodeMap attributes, java.lang.String attribute, java.lang.String alt)
          Help method to get the value of a attribute
private  boolean getBoolean(org.w3c.dom.NamedNodeMap attributes, java.lang.String attribute, java.lang.String alt)
          Help method to get boolean value of a attribute
private  int getInteger(org.w3c.dom.NamedNodeMap attributes, java.lang.String attribute, java.lang.String alt)
          Help method to get the integer value of a attribute
 MathRootElement getMathRootElement()
          Return the root element of a math tree
private  void traverse(org.w3c.dom.Node node, MathElement parent)
          Creates a MathElement through traversing the DOM tree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final org.apache.log4j.Logger LOG
Logger for this class


rootElement

private final MathRootElement rootElement
Constructor Detail

DOMMathBuilder

public DOMMathBuilder(org.w3c.dom.Document document)
Constructs a builder

Parameters:
document - The MathML document
Method Detail

getMathRootElement

public MathRootElement getMathRootElement()
Return the root element of a math tree

Returns:
Root element

getAttribute

private java.lang.String getAttribute(org.w3c.dom.NamedNodeMap attributes,
                                      java.lang.String attribute,
                                      java.lang.String alt)
Help method to get the value of a attribute

Parameters:
attributes - Attribute list
attribute - Name of the attribute
alt - Alternative value
Returns:
String value

getInteger

private int getInteger(org.w3c.dom.NamedNodeMap attributes,
                       java.lang.String attribute,
                       java.lang.String alt)
Help method to get the integer value of a attribute

Parameters:
attributes - Attribute list
attribute - Name of the attribute
alt - Alternative value
Returns:
Integer value

getBoolean

private boolean getBoolean(org.w3c.dom.NamedNodeMap attributes,
                           java.lang.String attribute,
                           java.lang.String alt)
Help method to get boolean value of a attribute

Parameters:
attributes - Attribute list
attribute - Name of the attribute
alt - Alternative value
Returns:
Integer value

traverse

private void traverse(org.w3c.dom.Node node,
                      MathElement parent)
Creates a MathElement through traversing the DOM tree

Parameters:
node - Current element of the DOM tree
parent - Current element of the MathElement tree