gov.llnl.babel.parsers.xml
Class ParseSymbolXML

java.lang.Object
  extended bygov.llnl.babel.parsers.xml.ParseSymbolXML

public class ParseSymbolXML
extends java.lang.Object

Class ParseSymbolXML converts an XML document into a sidl symbol. Utility function convert takes either an input stream or a validated DOM tree and generates a sidl symbol. Any errors in format generate a ParseSymbolException.


Constructor Summary
ParseSymbolXML(org.w3c.dom.Document doc)
          Create a DOM document to sidl symbol converter object.
ParseSymbolXML(org.xml.sax.InputSource is)
          Create an XML input stream to sidl symbol converter object.
 
Method Summary
static Symbol convert(org.w3c.dom.Document doc)
          This is a convenience utility function that converts a DOM document into a sidl symbol.
static Symbol convert(org.xml.sax.InputSource is)
          This is a convenience utility function that converts an XML input stream into a sidl symbol.
 Symbol getSymbol()
          Return the sidl symbol for the XML or DOM given in the constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParseSymbolXML

public ParseSymbolXML(org.xml.sax.InputSource is)
               throws ParseSymbolException
Create an XML input stream to sidl symbol converter object. The constructor parses the XML input stream and then converts the DOM structure into a symbol. The resulting symbol may be read by a call to getSymbol. Any errors will throw a parse symbol exception.


ParseSymbolXML

public ParseSymbolXML(org.w3c.dom.Document doc)
               throws ParseSymbolException
Create a DOM document to sidl symbol converter object. The DOM document must be a valid representation of a sidl symbol. The resulting symbol may be read by a call to getSymbol. Any errors will throw a parse symbol exception.

Method Detail

convert

public static Symbol convert(org.xml.sax.InputSource is)
                      throws ParseSymbolException
This is a convenience utility function that converts an XML input stream into a sidl symbol. Any errors detected in the XML input are converted into a ParseSymbolException. Since this method is static, it may be called without explicity creating an object.

Throws:
ParseSymbolException

convert

public static Symbol convert(org.w3c.dom.Document doc)
                      throws ParseSymbolException
This is a convenience utility function that converts a DOM document into a sidl symbol. This method assumes that the DOM document is a valid symbol representation. Any errors detected in the DOM input are converted into a ParseSymbolException. Since this method is static, it may be called without explicity creating an object.

Throws:
ParseSymbolException

getSymbol

public Symbol getSymbol()
Return the sidl symbol for the XML or DOM given in the constructor.