gov.llnl.babel.parsers.xml
Class ParseSymbolXML
java.lang.Object
gov.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
.
static Symbol | convert(Document doc, Context context) - This is a convenience utility function that converts a DOM document
into a SIDL symbol.
|
static Symbol | convert(InputSource is, Context context) - 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.
|
ParseSymbolXML
public ParseSymbolXML(Document doc,
Context context)
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
.
doc
- The DOM document to be converted.
ParseSymbolXML
public ParseSymbolXML(InputSource is,
Context context)
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.
is
- The input stream to use for conversion.
convert
public static Symbol convert(Document doc,
Context context)
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.
doc
- The DOM document to be converted.
convert
public static Symbol convert(InputSource is,
Context context)
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.
is
- The input stream to use for conversion.
getSymbol
public Symbol getSymbol()
Return the SIDL symbol for the XML or DOM given in the constructor.