org.infohazard.maverick.util
Class XML

java.lang.Object
  |
  +--org.infohazard.maverick.util.XML

public class XML
extends java.lang.Object

Version:
$Revision: 1.7 $ $Date: 2002/07/27 02:10:56 $
Author:
Jeff Schnitzer

Field Summary
static java.lang.String ATTR_PARAM_NAME
          The attribute for a parameter name
static java.lang.String ATTR_VALUE
          The attribute which represents the "value" of an element.
protected static org.jdom.output.XMLOutputter outputter
           
static java.lang.String TAG_PARAM
          The tag for a parameter node
 
Constructor Summary
XML()
           
 
Method Summary
static java.lang.String escape(java.lang.String in)
          Escapes any html characters in the input string.
static java.util.Map getParams(org.jdom.Element node)
          Extracts a set of param child nodes from the specified node.
static java.lang.String getValue(org.jdom.Element node, java.lang.String name)
          Extracts the named value from the element, by checking (in order):
static java.lang.String toString(org.jdom.Element node)
          Converts the specified node (and subnodes) to a nice, pretty, html escaped XML string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTR_VALUE

public static final java.lang.String ATTR_VALUE
The attribute which represents the "value" of an element.

See Also:
Constant Field Values

TAG_PARAM

public static final java.lang.String TAG_PARAM
The tag for a parameter node

See Also:
Constant Field Values

ATTR_PARAM_NAME

public static final java.lang.String ATTR_PARAM_NAME
The attribute for a parameter name

See Also:
Constant Field Values

outputter

protected static org.jdom.output.XMLOutputter outputter
Constructor Detail

XML

public XML()
Method Detail

getValue

public static java.lang.String getValue(org.jdom.Element node,
                                        java.lang.String name)

Extracts the named value from the element, by checking (in order):

  1. A system property whose name is constructed like this: "maverick." + node.getName() + "." + name
  2. An attribute with the specified name.
  3. The "value" attribute of a subelement with the specified name.

Parameters:
node -
name -
Returns:
null if a value with that name is not defined.

toString

public static java.lang.String toString(org.jdom.Element node)
Converts the specified node (and subnodes) to a nice, pretty, html escaped XML string.

Parameters:
node -
Returns:

escape

public static java.lang.String escape(java.lang.String in)
Escapes any html characters in the input string.

Parameters:
in -
Returns:

getParams

public static java.util.Map getParams(org.jdom.Element node)
Extracts a set of param child nodes from the specified node. Expects that param nodes will look like: <param name="theName" value="theValue"/>

Parameters:
node - Parent element.
Returns:
null if no parameters are found.