uk.org.ogsadai.client.toolkit.properties
Class PropertyUtilities
java.lang.Object
|
+--uk.org.ogsadai.client.toolkit.properties.PropertyUtilities
- public class PropertyUtilities
- extends java.lang.Object
Utilities for converting property values that are org.w3c.dom.Element
objects into other objects.
The methods assume that Property.getValue
returns a org.w3c.dom.Element
that corresponds to an XML fragment with a single root element and that the child of this element (whether it be an element or a text node is the desired value).
For example, the property value MyValue
will be converted into MyValue
by the method getAsString
.
- Author:
- The OGSA-DAI Team.
Field Summary |
private static?java.lang.String |
COPYRIGHT_NOTICE
??????????Copyright statement |
?
?
Method Summary |
static?boolean |
getAsBoolean(Property?property)
??????????Retrieves the boolean value from a property. |
static?float |
getAsFloat(Property?property)
??????????Retrieves the float value from a property. |
static?int |
getAsInt(Property?property)
??????????Retrieves the integer value from a property. |
static?javax.xml.namespace.QName |
getAsQName(Property?property)
??????????Retrieves the qualified name value from a property. |
static?java.lang.String |
getAsString(Property?property)
??????????Retrieves a string value from a property. |
?
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
?
COPYRIGHT_NOTICE
private static final java.lang.String COPYRIGHT_NOTICE
-
Copyright statement
- See Also:
- Constant Field Values
PropertyUtilities
public PropertyUtilities()
getAsString
public static java.lang.String getAsString(Property?property)
throws DataFormatException
-
Retrieves a string value from a property.
-
- Parameters:
-
property
- Property whose value is to be parsed.
- Returns:
- the string value
- Throws:
-
DataFormatException
- if the property value is not an org.w3c.dom.Element
or this element does not contain a single text node child that can be converted to a string.
getAsInt
public static int getAsInt(Property?property)
throws DataFormatException
-
Retrieves the integer value from a property.
-
- Parameters:
-
property
- Property whose value is to be parsed.
- Returns:
- the integer value
- Throws:
-
DataFormatException
- if the property value is not an org.w3c.dom.Element
or this element does not contain a single text node child that can be converted to an integer.
getAsFloat
public static float getAsFloat(Property?property)
throws DataFormatException
-
Retrieves the float value from a property.
-
- Parameters:
-
property
- Property whose value is to be parsed.
- Returns:
- the float value
- Throws:
-
DataFormatException
- if the property value is not an org.w3c.dom.Element
or this element does not contain a single text node child that can be converted to a float.
getAsBoolean
public static boolean getAsBoolean(Property?property)
throws DataFormatException
-
Retrieves the boolean value from a property.
-
- Parameters:
-
property
- Property whose value is to be parsed.
- Returns:
- the boolean value
- Throws:
-
DataFormatException
- if the property value is not an org.w3c.dom.Element
or this element does not contain a single text node child that can be converted to a boolean.
getAsQName
public static javax.xml.namespace.QName getAsQName(Property?property)
throws DataFormatException
-
Retrieves the qualified name value from a property.
-
- Parameters:
-
property
- Property whose value is to be parsed.
- Returns:
- the qualified name value
- Throws:
-
DataFormatException
- if the property value is not an org.w3c.dom.Element
or this element does not contain a single text node child that can be converted to a qualified name.