|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.apache.commons.betwixt.digester.XMLIntrospectorHelper
XMLIntrospectorHelper a helper class for
common code shared between the digestor and introspector.
| Field Summary | |
protected static org.apache.commons.logging.Log |
log
Log used for logging (Doh!) |
| Constructor Summary | |
XMLIntrospectorHelper()
Base constructor |
|
| Method Summary | |
static void |
configureProperty(AttributeDescriptor attributeDescriptor,
java.beans.PropertyDescriptor propertyDescriptor)
Configure an AttributeDescriptor from a PropertyDescriptor |
static void |
configureProperty(ElementDescriptor elementDescriptor,
java.beans.PropertyDescriptor propertyDescriptor)
Configure an ElementDescriptor from a PropertyDescriptor |
static NodeDescriptor |
createDescriptor(java.beans.PropertyDescriptor propertyDescriptor,
boolean useAttributesForPrimitives,
XMLIntrospector introspector)
Process a property. |
static void |
defaultAddMethods(XMLIntrospector introspector,
ElementDescriptor rootDescriptor,
java.lang.Class beanClass)
Add any addPropety(PropertyType) methods as Updaters which are often used for 1-N relationships in beans. |
protected static ElementDescriptor |
findGetCollectionDescriptor(XMLIntrospector introspector,
ElementDescriptor rootDescriptor,
java.lang.String propertyName)
Attempts to find the element descriptor for the getter property that typically matches a collection or array. |
static org.apache.commons.logging.Log |
getLog()
Gets the current logging implementation. |
static boolean |
isLoopType(java.lang.Class type)
Is this a loop type class? |
static boolean |
isPrimitiveType(java.lang.Class type)
Is this a primitive type? |
protected static void |
makeElementDescriptorMap(ElementDescriptor rootDescriptor,
java.util.Map map)
Creates a map where the keys are the property names and the values are the ElementDescriptors |
static void |
setLog(org.apache.commons.logging.Log aLog)
Sets the current logging implementation. |
protected static void |
swapDescriptor(ElementDescriptor rootDescriptor,
ElementDescriptor oldValue,
ElementDescriptor newValue)
Traverse the tree of element descriptors and find the oldValue and swap it with the newValue. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static org.apache.commons.logging.Log log
| Constructor Detail |
public XMLIntrospectorHelper()
| Method Detail |
public static org.apache.commons.logging.Log getLog()
Gets the current logging implementation.
public static void setLog(org.apache.commons.logging.Log aLog)
Sets the current logging implementation.
aLog - use this Log
public static NodeDescriptor createDescriptor(java.beans.PropertyDescriptor propertyDescriptor,
boolean useAttributesForPrimitives,
XMLIntrospector introspector)
throws java.beans.IntrospectionException
propertyDescriptor - create a NodeDescriptor for this propertyuseAttributesForPrimitives - write primitives as attributes (rather than elements)introspector - use this XMLIntrospectorNodeDescriptor for the propertyjava.beans.IntrospectionException - when bean introspection fails
public static void configureProperty(ElementDescriptor elementDescriptor,
java.beans.PropertyDescriptor propertyDescriptor)
ElementDescriptor from a PropertyDescriptorelementDescriptor - configure this ElementDescriptorpropertyDescriptor - configure from this PropertyDescriptor
public static void configureProperty(AttributeDescriptor attributeDescriptor,
java.beans.PropertyDescriptor propertyDescriptor)
AttributeDescriptor from a PropertyDescriptorattributeDescriptor - configure this AttributeDescriptorpropertyDescriptor - configure from this PropertyDescriptor
public static void defaultAddMethods(XMLIntrospector introspector,
ElementDescriptor rootDescriptor,
java.lang.Class beanClass)
introspector - use this XMLIntrospector for introspectionrootDescriptor - add defaults to this descriptorbeanClass - the Class to which descriptor correspondspublic static boolean isLoopType(java.lang.Class type)
type - is this Class a loop type?public static boolean isPrimitiveType(java.lang.Class type)
type - is this Class a primitive type?- Returns:
- true for primitive types
protected static ElementDescriptor findGetCollectionDescriptor(XMLIntrospector introspector,
ElementDescriptor rootDescriptor,
java.lang.String propertyName)
introspector - use this XMLIntrospectorrootDescriptor - the ElementDescriptor whose child element will be
searched for a matchpropertyName - the name of the 'adder' method to matchElementDescriptor for the matching getter
protected static void makeElementDescriptorMap(ElementDescriptor rootDescriptor,
java.util.Map map)
rootDescriptor - the values of the maps are the children of this
ElementDescriptor index by their property namesmap - the map to which the elements will be added
protected static void swapDescriptor(ElementDescriptor rootDescriptor,
ElementDescriptor oldValue,
ElementDescriptor newValue)
rootDescriptor - traverse child graph for this ElementDescriptoroldValue - replace this ElementDescriptornewValue - replace with this ElementDescriptor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||