gov.llnl.babel.parsers.xml

Class SymbolToDOM


public class SymbolToDOM
extends java.lang.Object

Class SymbolToDOM converts a SIDL symbol into an XML DOM document. Utility function converttakes a symbol and returns a DOM document. The DOM representation is formatted with white space such that a straight-forward DOM printer will generate pretty XML output.

Constructor Summary

SymbolToDOM(Symbol symbol, Context context)
Create a symbol to DOM converter object.

Method Summary

static Document
convert(Symbol symbol, Context context)
This is a convenience utility function that converts the symbol into a DOM document.
Node
convertExpr(AssertionExpression ae, Node parent)
static String
convertToString(Symbol symbol, Context context)
This is a convenience utilility function that converts the symbol directly into a string.
String
getDTDPath(String dtd)
Document
getDocument()
Return the DOM document for the symbol specified in the constructor.

Constructor Details

SymbolToDOM

public SymbolToDOM(Symbol symbol,
                   Context context)
Create a symbol to DOM converter object. The constructor creates a DOM document node with the appropriate document type to validate the symbol input. The resulting document may be read by a call to method getDocument.
Parameters:
symbol - The symbol associated with an instance of this class.

Method Details

convert

public static Document convert(Symbol symbol,
                               Context context)
This is a convenience utility function that converts the symbol into a DOM document. Since this method is static, it may be called without explicitly creating an instance of object SymbolToDOM.
Parameters:
symbol - The symbol to be converted.

convertExpr

public Node convertExpr(AssertionExpression ae,
                        Node parent)

convertToString

public static String convertToString(Symbol symbol,
                                     Context context)
This is a convenience utilility function that converts the symbol directly into a string.
Parameters:
symbol - The symbol to be converted.

getDTDPath

public String getDTDPath(String dtd)

getDocument

public Document getDocument()
Return the DOM document for the symbol specified in the constructor.