de.intarsys.tools.dom
Class ElementTools
java.lang.Object
de.intarsys.tools.dom.ElementTools
public class ElementTools extends Object
Method Summary
static
createClass (Element element,
String classAttribute,
Class <T> expectedClass,
ClassLoader classLoader)
static IFunctor
createFunctor (Element element,
Object owner,
ClassLoader classLoader)
static
createObject (Element element,
Class <T> expectedClass,
ClassLoader classLoader)
static
createObject (Element element,
String role,
Class <T> expectedClass,
ClassLoader classLoader)
static
createObject (Object owner,
Element element,
Class <T> expectedClass,
ClassLoader classLoader)
static
createPropertyValue (Object owner,
Element element,
Class <T> expectedClass,
ClassLoader classLoader)
static boolean
getBoolean (Element element,
String attributeName,
boolean defaultValue)
static double
getDouble (Element element,
String attributeName,
double defaultValue)
static Iterator <Element >
getElementsIterator (Element parent)
static Iterator <Element >
getElementsIterator (Element parent,
String name)
static
getEnumItem (Element element,
String attributeName,
EnumMeta <T> meta)
static
getEnumItem (Element element,
String attributeName,
EnumMeta <T> meta,
T defaultValue)
static Element
getFirstElement (Element element,
String name)
static float
getFloat (Element element,
String attributeName,
float defaultValue)
static int
getInt (Element element,
String attributeName,
int defaultValue)
static boolean
getPathBoolean (Element element,
String path,
boolean defaultValue)
static double
getPathDouble (Element element,
String path,
double defaultValue)
static float
getPathFloat (Element element,
String path,
float defaultValue)
static int
getPathInt (Element element,
String path,
int defaultValue)
static String
getPathString (Element element,
String path,
String defaultValue)
static String
getString (Element element,
String name,
String defaultValue)
static void
setProperties (Object object,
Element element,
ClassLoader classLoader)
Set properties in object based on the list of property information
contained in element.
static void
setProperty (Object object,
Element element,
ClassLoader classLoader)
Set a property in object based on the property information contained in
element.
ElementTools
public ElementTools ()
createClass
public static <T> Class <T> createClass (Element element,
String classAttribute,
Class <T> expectedClass,
ClassLoader classLoader)
throws ObjectCreationException
Throws:
ObjectCreationException
createFunctor
public static IFunctor createFunctor (Element element,
Object owner,
ClassLoader classLoader)
throws ObjectCreationException
Throws:
ObjectCreationException
createObject
public static <T> T createObject (Element element,
Class <T> expectedClass,
ClassLoader classLoader)
throws ObjectCreationException
Throws:
ObjectCreationException
createObject
public static <T> T createObject (Element element,
String role,
Class <T> expectedClass,
ClassLoader classLoader)
throws ObjectCreationException
Throws:
ObjectCreationException
createObject
public static <T> T createObject (Object owner,
Element element,
Class <T> expectedClass,
ClassLoader classLoader)
throws ObjectCreationException
Throws:
ObjectCreationException
createPropertyValue
public static <T> T createPropertyValue (Object owner,
Element element,
Class <T> expectedClass,
ClassLoader classLoader)
throws ObjectCreationException
Throws:
ObjectCreationException
getBoolean
public static boolean getBoolean (Element element,
String attributeName,
boolean defaultValue)
getDouble
public static double getDouble (Element element,
String attributeName,
double defaultValue)
getElementsIterator
public static Iterator <Element > getElementsIterator (Element parent)
getElementsIterator
public static Iterator <Element > getElementsIterator (Element parent,
String name)
getEnumItem
public static <T extends EnumItem > T getEnumItem (Element element,
String attributeName,
EnumMeta <T> meta)
getEnumItem
public static <T extends EnumItem > T getEnumItem (Element element,
String attributeName,
EnumMeta <T> meta,
T defaultValue)
getFirstElement
public static Element getFirstElement (Element element,
String name)
getFloat
public static float getFloat (Element element,
String attributeName,
float defaultValue)
getInt
public static int getInt (Element element,
String attributeName,
int defaultValue)
getPathBoolean
public static boolean getPathBoolean (Element element,
String path,
boolean defaultValue)
getPathDouble
public static double getPathDouble (Element element,
String path,
double defaultValue)
getPathFloat
public static float getPathFloat (Element element,
String path,
float defaultValue)
getPathInt
public static int getPathInt (Element element,
String path,
int defaultValue)
getPathString
public static String getPathString (Element element,
String path,
String defaultValue)
getString
public static String getString (Element element,
String name,
String defaultValue)
setProperties
public static void setProperties (Object object,
Element element,
ClassLoader classLoader)
throws FieldException ,
ObjectCreationException ,
FunctorInvocationException
Set properties in object based on the list of property information
contained in element.
...
...
Parameters: object - element - classLoader -
Throws:
FieldException
ObjectCreationException
FunctorInvocationException
setProperty
public static void setProperty (Object object,
Element element,
ClassLoader classLoader)
throws FieldException ,
ObjectCreationException ,
FunctorInvocationException
Set a property in object based on the property information contained in
element.
Long form
...
...
Short form
...
...
Parameters: object - element - classLoader -
Throws:
FieldException
ObjectCreationException
FunctorInvocationException
Copyright © 2012 intarsys consulting GmbH . All Rights Reserved.