|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.gsfc.drl.rtstps.core.Convert
public final class Convert
This class contains some static conversion utility methods to convert XML element attributes to useable values.
Constructor Summary | |
---|---|
Convert()
|
Method Summary | |
---|---|
static boolean |
toBoolean(org.w3c.dom.Element element,
java.lang.String key,
boolean defaultValue)
Convert an XML element's attribute value to a boolean. |
static int |
toHexInteger(org.w3c.dom.Element element,
java.lang.String key,
int defaultValue)
Convert an XML element's attribute value to an integer. |
static int |
toInteger(org.w3c.dom.Element element,
java.lang.String key,
int defaultValue)
Convert an XML element's attribute value to an integer. |
static int |
toInteger(org.w3c.dom.Element element,
java.lang.String key,
int defaultValue,
int minimum)
Convert an XML element's attribute value to an integer. |
static int |
toInteger(org.w3c.dom.Element element,
java.lang.String key,
int defaultValue,
int minimum,
int maximum)
Convert an XML element's attribute value to an integer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Convert()
Method Detail |
---|
public static int toInteger(org.w3c.dom.Element element, java.lang.String key, int defaultValue) throws RtStpsException
element
- The XML elementkey
- The attribute name (key=value)defaultValue
- The returned value if the attribute was not
specified with the element.
RtStpsException
- If the value could not be converted
to an integer.public static int toInteger(org.w3c.dom.Element element, java.lang.String key, int defaultValue, int minimum) throws RtStpsException
element
- The XML elementkey
- The attribute name (key=value)defaultValue
- The returned value if the attribute was not
specified with the element.
minimum The minimum integer value the value can take.
RtStpsException
- If the value could not be converted
to an integer, or the value is less than the minimum.public static int toInteger(org.w3c.dom.Element element, java.lang.String key, int defaultValue, int minimum, int maximum) throws RtStpsException
element
- The XML elementkey
- The attribute name (key=value)defaultValue
- The returned value if the attribute was not
specified with the element.
minimum The minimum integer value the value can take.
maximum The maximum integer value the value can take.
RtStpsException
- If the value could not be converted
to an integer, or the value is less than the minimum, or the
value is greater than the maximum.public static int toHexInteger(org.w3c.dom.Element element, java.lang.String key, int defaultValue) throws RtStpsException
element
- The XML elementkey
- The attribute name (key=value)defaultValue
- The returned value if the attribute was not
specified with the element.
RtStpsException
- If the value could not be converted
to an integer.public static boolean toBoolean(org.w3c.dom.Element element, java.lang.String key, boolean defaultValue) throws RtStpsException
element
- The XML elementkey
- The attribute name (key=value)defaultValue
- The returned value if the attribute was not
specified with the element.
RtStpsException
- If the value could not be
converted to a boolean.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |