gov.llnl.babel.parsers.xml
Class StringXML

java.lang.Object
  extended by gov.llnl.babel.parsers.xml.StringXML

public class StringXML
extends java.lang.Object

Class StringXML is a simple utility class that converts between symbol types (integers or enumerated identifiers) and symbol strings. Invalid integer identifiers or string types will result in exceptions or null return values.


Constructor Summary
StringXML()
           
 
Method Summary
static int fromAssertionXML(java.lang.String assertion)
          Convert the assertion XML into its integer value.
static int fromBinaryOpXML(java.lang.String literal)
          Convert the binary expression operator XML into its integer value.
static int fromComXML(java.lang.String modifier)
          Convert the communication modifier XML into its integer value.
static int fromDefXML(java.lang.String modifier)
          Conver the definition modifier XML into its integer value.
static int fromModeXML(java.lang.String mode)
          Convert the argument XML mode string into an integer.
static int fromOrderXML(java.lang.String order)
          Convert the array order XML into its integer value.
static int fromSymbolXML(java.lang.String symbol)
          Convert the Symbol XML type string into its integer type.
static int fromTypeXML(java.lang.String type)
          Convert the Type XML type string into its integer type.
static int fromUnaryOpXML(java.lang.String literal)
          Convert the unary expression operator XML into its integer value.
static java.lang.String toAssertionXML(int assertion)
          Convert the assertion integer into an XML string.
static java.lang.String toBinaryOpXML(int literal)
          Convert the binary expression operator integer into an XML string.
static java.lang.String toComXML(int modifier)
          Convert the communication modifier integer into an XML string.
static java.lang.String toDefXML(int modifier)
          Convert the definition modifier integer into an XML string.
static java.lang.String toModeXML(int mode)
          Convert the argument mode integer into an XML string.
static java.lang.String toOrderXML(int order)
          Convert the array order integer into an XML string.
static java.lang.String toSymbolXML(int symbol)
          Convert the Symbol type integer into an XML string.
static java.lang.String toTypeXML(int type)
          Convert the Type type integer into an XML string.
static java.lang.String toUnaryOpXML(int literal)
          Convert the unary expression operator integer into an XML string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringXML

public StringXML()
Method Detail

toSymbolXML

public static java.lang.String toSymbolXML(int symbol)
Convert the Symbol type integer into an XML string. A null string is returned if the integer type is invalid.


fromSymbolXML

public static int fromSymbolXML(java.lang.String symbol)
                         throws ParseSymbolException
Convert the Symbol XML type string into its integer type. An exception is thrown if the string type is invalid.

Throws:
ParseSymbolException

toTypeXML

public static java.lang.String toTypeXML(int type)
Convert the Type type integer into an XML string. A null string is returned if the integer type is invalid.


fromTypeXML

public static int fromTypeXML(java.lang.String type)
                       throws ParseSymbolException
Convert the Type XML type string into its integer type. An exception is thrown if the string type is invalid.

Throws:
ParseSymbolException

toModeXML

public static java.lang.String toModeXML(int mode)
Convert the argument mode integer into an XML string. A null string is returned if the integer type is invalid.


fromModeXML

public static int fromModeXML(java.lang.String mode)
                       throws ParseSymbolException
Convert the argument XML mode string into an integer. An exception is thrown if the string type is invalid.

Throws:
ParseSymbolException

toDefXML

public static java.lang.String toDefXML(int modifier)
Convert the definition modifier integer into an XML string. A null string is returned if the integer type is invalid.


fromDefXML

public static int fromDefXML(java.lang.String modifier)
                      throws ParseSymbolException
Conver the definition modifier XML into its integer value. An exception is thrown if the string type is invalid.

Throws:
ParseSymbolException

toComXML

public static java.lang.String toComXML(int modifier)
Convert the communication modifier integer into an XML string. A null string is returned if the integer type is invalid.


fromComXML

public static int fromComXML(java.lang.String modifier)
                      throws ParseSymbolException
Convert the communication modifier XML into its integer value. An exception is thrown if the string type is invalid.

Throws:
ParseSymbolException

toOrderXML

public static java.lang.String toOrderXML(int order)
Convert the array order integer into an XML string. A null string is returned if the integer type is invalid.


fromOrderXML

public static int fromOrderXML(java.lang.String order)
                        throws ParseSymbolException
Convert the array order XML into its integer value. An exception is thrown if the string type is invalid.

Throws:
ParseSymbolException

toAssertionXML

public static java.lang.String toAssertionXML(int assertion)
Convert the assertion integer into an XML string. A null string is returned if the integer is invalid.


fromAssertionXML

public static int fromAssertionXML(java.lang.String assertion)
                            throws ParseSymbolException
Convert the assertion XML into its integer value. An exception is thrown if the string type is invalid.

Throws:
ParseSymbolException

toUnaryOpXML

public static java.lang.String toUnaryOpXML(int literal)
Convert the unary expression operator integer into an XML string. A null string is returned if the integer is invalid.


fromUnaryOpXML

public static int fromUnaryOpXML(java.lang.String literal)
                          throws ParseSymbolException
Convert the unary expression operator XML into its integer value. An exception is thrown if the string type is invalid.

Throws:
ParseSymbolException

toBinaryOpXML

public static java.lang.String toBinaryOpXML(int literal)
Convert the binary expression operator integer into an XML string. A null string is returned if the integer is invalid.


fromBinaryOpXML

public static int fromBinaryOpXML(java.lang.String literal)
                           throws ParseSymbolException
Convert the binary expression operator XML into its integer value. An exception is thrown if the string type is invalid.

Throws:
ParseSymbolException