edu.northwestern.at.wordhoard.tools.cm
Class Utils

java.lang.Object
  extended by edu.northwestern.at.wordhoard.tools.cm.Utils

public class Utils
extends java.lang.Object

Static utilities.


Constructor Summary
Utils()
           
 
Method Summary
static void checkAttributeNames(org.w3c.dom.Element el, java.lang.String[] vals)
          Checks attribute names for a parameter file element.
static void checkNoAttributes(org.w3c.dom.Element el)
          Checks that a parameter file element has no attributes.
static void checkNoChildren(org.w3c.dom.Element el)
          Checks that a parameter file element has no children.
static void paramErr(java.lang.String msg)
          Issues a fatal parameter file parsing error message and exits.
static boolean parseBooleanAttribute(org.w3c.dom.Element el, java.lang.String name, boolean def)
          Parses a boolean attribute for a parameter file element.
static int parseIntegerAttribute(org.w3c.dom.Element el, java.lang.String name, int def)
          Parses an integer attribute for a parameter file element.
static void writeTaggingData(XMLWriter out)
          Writes WordHoard tagging data flags.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

paramErr

public static void paramErr(java.lang.String msg)
Issues a fatal parameter file parsing error message and exits.

Parameters:
msg - Message.

checkAttributeNames

public static void checkAttributeNames(org.w3c.dom.Element el,
                                       java.lang.String[] vals)
Checks attribute names for a parameter file element.

Parameters:
el - Element.
vals - Array of legal values.

checkNoAttributes

public static void checkNoAttributes(org.w3c.dom.Element el)
Checks that a parameter file element has no attributes.

Parameters:
el - Element

checkNoChildren

public static void checkNoChildren(org.w3c.dom.Element el)
Checks that a parameter file element has no children.

Parameters:
el - Element

parseBooleanAttribute

public static boolean parseBooleanAttribute(org.w3c.dom.Element el,
                                            java.lang.String name,
                                            boolean def)
Parses a boolean attribute for a parameter file element.

Parameters:
el - Element.
name - Attribute name.
def - Default value.
Returns:
Attribute value.

parseIntegerAttribute

public static int parseIntegerAttribute(org.w3c.dom.Element el,
                                        java.lang.String name,
                                        int def)
Parses an integer attribute for a parameter file element.

Parameters:
el - Element.
name - Attribute name.
def - Default value.
Returns:
Attribute value.

writeTaggingData

public static void writeTaggingData(XMLWriter out)
Writes WordHoard tagging data flags.

Parameters:
out - WordHoard XML output file writer.