edu.unh.sdb.common
Class XMLReader

java.lang.Object
  extended by edu.unh.sdb.common.XMLReader
Direct Known Subclasses:
XDDLReader, XFDLReader, XLDLReader, XTDLReader

public abstract class XMLReader
extends java.lang.Object


Field Summary
protected  org.w3c.dom.Document doc
           
protected  java.lang.String inputFileName
          the file/url to be parsed and processed
protected  java.lang.String keyElement
          the key element to be processed
protected  org.apache.xerces.parsers.DOMParser parser
          the parsing object
protected  boolean verbose
          flag to set verbose on/off
 
Constructor Summary
XMLReader(java.lang.String inf)
          Takes an argument name of a file or URL as a String
XMLReader(java.lang.String inf, boolean v)
          Takes an argument name of a file or URL as a String and verbose indicator
 
Method Summary
protected static java.lang.Float makeChildrenFloat(org.w3c.dom.Node node)
          converts a node from the XML parsed tree into a Float object
protected static java.lang.Integer makeChildrenInteger(org.w3c.dom.Node node)
          processes a child node from the XML parsed tree int an Integer object
protected static java.lang.String makeChildrenText(org.w3c.dom.Node node)
          converts a node from the XML parsed tree into a String
protected static java.lang.String makeChildrenText1(org.w3c.dom.Node node, java.lang.StringBuffer buffer)
          recursive method to support makeChildrenText(Node node) method
protected  void parse()
          instantiates the main parser
 int[] processArrayOfInt(java.lang.String axisString)
           
protected abstract  boolean processDoc()
          process the main document in the xml file
protected  void setDefaults()
          Sets all pending values to null and sets the join flag to FALSE
protected  void setInputFileName(java.lang.String inf)
          sets the input file name to the string argument passed
protected  void start(java.lang.String inf, boolean v)
          Sets the initial values and calls the parser
protected static java.lang.Float sToF(java.lang.String s)
          converts a string to a Float object
protected static int sToi(java.lang.String s)
          converts a string to an integer
protected static java.lang.Integer sToI(java.lang.String s)
          converts a string to and Integer object
protected static float[] vectorToFloatArray(java.util.Vector v)
          converts a vector to an array of floats and defaults to a 1 item array of 0 if vector is empty
protected static int[] vectorToIntArray(java.util.Vector v)
          converts a vector to an array of integers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inputFileName

protected java.lang.String inputFileName
the file/url to be parsed and processed


parser

protected org.apache.xerces.parsers.DOMParser parser
the parsing object


keyElement

protected java.lang.String keyElement
the key element to be processed


verbose

protected boolean verbose
flag to set verbose on/off


doc

protected org.w3c.dom.Document doc
Constructor Detail

XMLReader

public XMLReader(java.lang.String inf,
                 boolean v)
Takes an argument name of a file or URL as a String and verbose indicator


XMLReader

public XMLReader(java.lang.String inf)
Takes an argument name of a file or URL as a String

Method Detail

start

protected void start(java.lang.String inf,
                     boolean v)
Sets the initial values and calls the parser


setInputFileName

protected void setInputFileName(java.lang.String inf)
sets the input file name to the string argument passed


setDefaults

protected void setDefaults()
Sets all pending values to null and sets the join flag to FALSE


processDoc

protected abstract boolean processDoc()
process the main document in the xml file


sToI

protected static java.lang.Integer sToI(java.lang.String s)
converts a string to and Integer object


sToi

protected static int sToi(java.lang.String s)
converts a string to an integer


vectorToIntArray

protected static int[] vectorToIntArray(java.util.Vector v)
converts a vector to an array of integers


parse

protected void parse()
instantiates the main parser


makeChildrenInteger

protected static java.lang.Integer makeChildrenInteger(org.w3c.dom.Node node)
processes a child node from the XML parsed tree int an Integer object


sToF

protected static java.lang.Float sToF(java.lang.String s)
converts a string to a Float object


vectorToFloatArray

protected static float[] vectorToFloatArray(java.util.Vector v)
converts a vector to an array of floats and defaults to a 1 item array of 0 if vector is empty


makeChildrenFloat

protected static java.lang.Float makeChildrenFloat(org.w3c.dom.Node node)
converts a node from the XML parsed tree into a Float object


makeChildrenText

protected static java.lang.String makeChildrenText(org.w3c.dom.Node node)
converts a node from the XML parsed tree into a String


makeChildrenText1

protected static java.lang.String makeChildrenText1(org.w3c.dom.Node node,
                                                    java.lang.StringBuffer buffer)
recursive method to support makeChildrenText(Node node) method


processArrayOfInt

public int[] processArrayOfInt(java.lang.String axisString)