|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | 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(org.apache.commons.betwixt.AttributeDescriptor attributeDescriptor,
java.beans.PropertyDescriptor propertyDescriptor)
Configure an AttributeDescriptor from a PropertyDescriptor |
static void |
configureProperty(org.apache.commons.betwixt.ElementDescriptor elementDescriptor,
java.beans.PropertyDescriptor propertyDescriptor)
Configure an ElementDescriptor from a PropertyDescriptor . |
static void |
configureProperty(org.apache.commons.betwixt.ElementDescriptor elementDescriptor,
java.beans.PropertyDescriptor propertyDescriptor,
java.lang.String updateMethodName,
java.lang.Class beanClass)
Configure an ElementDescriptor from a PropertyDescriptor . |
static org.apache.commons.betwixt.NodeDescriptor |
createDescriptor(java.beans.PropertyDescriptor propertyDescriptor,
boolean useAttributesForPrimitives,
org.apache.commons.betwixt.XMLIntrospector introspector)
Deprecated. 0.5 this method has been replaced by XMLIntrospector.createDescriptor(java.beans.PropertyDescriptor, boolean) |
static void |
defaultAddMethods(org.apache.commons.betwixt.XMLIntrospector introspector,
org.apache.commons.betwixt.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 org.apache.commons.betwixt.ElementDescriptor |
findGetCollectionDescriptor(org.apache.commons.betwixt.XMLIntrospector introspector,
org.apache.commons.betwixt.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(org.apache.commons.betwixt.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(org.apache.commons.betwixt.ElementDescriptor rootDescriptor,
org.apache.commons.betwixt.ElementDescriptor oldValue,
org.apache.commons.betwixt.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 org.apache.commons.betwixt.NodeDescriptor createDescriptor(java.beans.PropertyDescriptor propertyDescriptor, boolean useAttributesForPrimitives, org.apache.commons.betwixt.XMLIntrospector introspector) throws java.beans.IntrospectionException
XMLIntrospector.createDescriptor(java.beans.PropertyDescriptor, boolean)
propertyDescriptor
- create a NodeDescriptor
for this propertyuseAttributesForPrimitives
- write primitives as attributes (rather than elements)introspector
- use this XMLIntrospector
NodeDescriptor
for the property
java.beans.IntrospectionException
- when bean introspection failspublic static void configureProperty(org.apache.commons.betwixt.ElementDescriptor elementDescriptor, java.beans.PropertyDescriptor propertyDescriptor)
ElementDescriptor
from a PropertyDescriptor
.
This uses default element updater (the write method of the property).
elementDescriptor
- configure this ElementDescriptor
propertyDescriptor
- configure from this PropertyDescriptor
public static void configureProperty(org.apache.commons.betwixt.ElementDescriptor elementDescriptor, java.beans.PropertyDescriptor propertyDescriptor, java.lang.String updateMethodName, java.lang.Class beanClass)
ElementDescriptor
from a PropertyDescriptor
.
A custom update method may be set.
elementDescriptor
- configure this ElementDescriptor
propertyDescriptor
- configure from this PropertyDescriptor
updateMethodName
- the name of the custom updater method to user.
If null, then thenbeanClass
- the Class
from which the update method should be found.
This may be null only when updateMethodName
is also null.public static void configureProperty(org.apache.commons.betwixt.AttributeDescriptor attributeDescriptor, java.beans.PropertyDescriptor propertyDescriptor)
AttributeDescriptor
from a PropertyDescriptor
attributeDescriptor
- configure this AttributeDescriptor
propertyDescriptor
- configure from this PropertyDescriptor
public static void defaultAddMethods(org.apache.commons.betwixt.XMLIntrospector introspector, org.apache.commons.betwixt.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 org.apache.commons.betwixt.ElementDescriptor findGetCollectionDescriptor(org.apache.commons.betwixt.XMLIntrospector introspector, org.apache.commons.betwixt.ElementDescriptor rootDescriptor, java.lang.String propertyName)
introspector
- use this XMLIntrospector
rootDescriptor
- the ElementDescriptor
whose child element will be
searched for a matchpropertyName
- the name of the 'adder' method to match
ElementDescriptor
for the matching getterprotected static void makeElementDescriptorMap(org.apache.commons.betwixt.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 addedprotected static void swapDescriptor(org.apache.commons.betwixt.ElementDescriptor rootDescriptor, org.apache.commons.betwixt.ElementDescriptor oldValue, org.apache.commons.betwixt.ElementDescriptor newValue)
rootDescriptor
- traverse child graph for this ElementDescriptor
oldValue
- replace this ElementDescriptor
newValue
- replace with this ElementDescriptor
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |