com.inxar.affirm
Class DOM
java.lang.Object
|
+--com.inxar.affirm.DOM
- public class DOM
- extends java.lang.Object
Simple collection of utilities that fetch typed element attributes.
Method Summary |
static boolean |
getBoolean(java.lang.String name,
org.w3c.dom.Element e)
|
static byte |
getByte(java.lang.String name,
org.w3c.dom.Element e)
|
static org.w3c.dom.Document |
getDocument(java.lang.String uri)
Attempts to instantiate an XML document from the given URI
using three different parsers. |
static double |
getDouble(java.lang.String name,
org.w3c.dom.Element e)
|
static float |
getFloat(java.lang.String name,
org.w3c.dom.Element e)
|
static int |
getInt(java.lang.String name,
org.w3c.dom.Element e)
|
static long |
getLong(java.lang.String name,
org.w3c.dom.Element e)
|
static short |
getShort(java.lang.String name,
org.w3c.dom.Element e)
|
static java.lang.String |
getString(java.lang.String name,
org.w3c.dom.Element e)
|
static java.lang.String |
getText(org.w3c.dom.Node e)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getString
public static java.lang.String getString(java.lang.String name,
org.w3c.dom.Element e)
getBoolean
public static boolean getBoolean(java.lang.String name,
org.w3c.dom.Element e)
getByte
public static byte getByte(java.lang.String name,
org.w3c.dom.Element e)
throws java.lang.NumberFormatException
getShort
public static short getShort(java.lang.String name,
org.w3c.dom.Element e)
throws java.lang.NumberFormatException
getInt
public static int getInt(java.lang.String name,
org.w3c.dom.Element e)
throws java.lang.NumberFormatException
getLong
public static long getLong(java.lang.String name,
org.w3c.dom.Element e)
throws java.lang.NumberFormatException
getFloat
public static float getFloat(java.lang.String name,
org.w3c.dom.Element e)
throws java.lang.NumberFormatException
getDouble
public static double getDouble(java.lang.String name,
org.w3c.dom.Element e)
throws java.lang.NumberFormatException
getText
public static java.lang.String getText(org.w3c.dom.Node e)
throws java.lang.ClassCastException
getDocument
public static org.w3c.dom.Document getDocument(java.lang.String uri)
throws java.lang.ClassNotFoundException
- Attempts to instantiate an XML document from the given URI
using three different parsers. The first attempt is for Sun's
JAXP-1.0.1's
javax.xml.parsers.DocumentBuilderFactory
, the
second attempt is for Xerces-1.2.3's
org.apache.xerces.parsers.DOMParser
, and the third
attempt is for Sun's xml-tr2's
com.sun.xml.tree.XmlDocument
. If all attempts
fail, a ClassNotFoundException
will be thrown.