|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.logabit.utils.Dom4jHelper
public class Dom4jHelper
This helper class provides some utility methods to extract attribute values from Dom4j objects and convert them into the appropriate datatype.
| Constructor Summary | |
|---|---|
Dom4jHelper()
|
|
| Method Summary | |
|---|---|
static boolean |
getAsBoolean(org.dom4j.Element elem,
java.lang.String attributeName,
boolean defaultValue)
Looks for an attribute with given name in the given dom4j element and if found, converts it to boolean. |
static int |
getAsInteger(org.dom4j.Element elem,
java.lang.String attributeName,
int defaultValue)
Looks for an attribute with given name in the given dom4j element and if found, converts it to integer. |
static java.lang.String |
getAsString(org.dom4j.Element elem,
java.lang.String attributeName,
java.lang.String defaultValue)
Looks for an attribute with given name in the given dom4j element and if found, converts it to string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Dom4jHelper()
| Method Detail |
|---|
public static int getAsInteger(org.dom4j.Element elem,
java.lang.String attributeName,
int defaultValue)
ConvertHelper.convertToInteger(String, int).
elem - - The dom4j element wich contains the attributes.attributeName - - The name of the attribute to extract.defaultValue - - The default value to return if no attribute
with given could be found or the conversion to integer was failed.
public static boolean getAsBoolean(org.dom4j.Element elem,
java.lang.String attributeName,
boolean defaultValue)
ConvertHelper.convertToBoolean(String, boolean).
elem - - The dom4j element wich contains the attributes.attributeName - - The name of the attribute to extract.defaultValue - - The default value to return if no attribute
with given could be found or the conversion to boolean was failed.
public static java.lang.String getAsString(org.dom4j.Element elem,
java.lang.String attributeName,
java.lang.String defaultValue)
ConvertHelper.convertToString(String, String).
elem - - The dom4j element wich contains the attributes.attributeName - - The name of the attribute to extract.defaultValue - - The default value to return if no attribute
with given could be found or the conversion to string was failed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||