org.apache.commons.betwixt
Class XMLIntrospector

java.lang.Object
  extended by org.apache.commons.betwixt.XMLIntrospector

public class XMLIntrospector
extends java.lang.Object

XMLIntrospector an introspector of beans to create a XMLBeanInfo instance.

By default, XMLBeanInfo caching is switched on. This means that the first time that a request is made for a XMLBeanInfo for a particular class, the XMLBeanInfo is cached. Later requests for the same class will return the cached value.

Note :

This class makes use of the java.bean.Introspector class, which contains a BeanInfoSearchPath. To make sure betwixt can do his work correctly, this searchpath is completely ignored during processing. The original values will be restored after processing finished

Author:
James Strachan, Martin van den Bemt

Field Summary
protected  org.apache.commons.logging.Log log
          Deprecated. 0.6 use the getLog() property instead
 
Constructor Summary
XMLIntrospector()
          Base constructor
XMLIntrospector(IntrospectionConfiguration configuration)
          Construct allows a custom configuration to be set on construction.
 
Method Summary
protected  void addProperties(java.beans.BeanInfo beanInfo, java.util.List elements, java.util.List attributes)
          Deprecated. 0.5 this method does not support mixed content. Use addProperties(BeanInfo, List, List, List) instead.
protected  void addProperties(java.beans.BeanInfo beanInfo, java.util.List elements, java.util.List attributes, java.util.List contents)
          Deprecated. 0.5 use addProperties(BeanProperty[], List, List,List)
protected  void addProperties(BeanProperty[] beanProperties, java.util.List elements, java.util.List attributes, java.util.List contents)
          Loop through properties and process each one
protected  void addProperty(java.beans.BeanInfo beanInfo, java.beans.PropertyDescriptor propertyDescriptor, java.util.List elements, java.util.List attributes)
          Deprecated. 0.5 this method does not support mixed content. Use addProperty(BeanInfo, PropertyDescriptor, List, List, List) instead.
protected  void addProperty(java.beans.BeanInfo beanInfo, java.beans.PropertyDescriptor propertyDescriptor, java.util.List elements, java.util.List attributes, java.util.List contents)
          Deprecated. 0.5 BeanInfo is no longer required. Use addProperty(PropertyDescriptor, List, List, List) instead.
protected  void addProperty(BeanProperty beanProperty, java.util.List elements, java.util.List attributes, java.util.List contents)
          Process a property.
protected  void addProperty(java.beans.PropertyDescriptor propertyDescriptor, java.util.List elements, java.util.List attributes, java.util.List contents)
          Deprecated. 0.5 use addProperty(BeanProperty, List, List, List) instead
 void assignAdder(java.lang.reflect.Method twinParameterAdderMethod, ElementDescriptor matchingDescriptor)
          Assigns the given method as an adder method to the given descriptor.
 Descriptor createDescriptor(java.beans.PropertyDescriptor propertyDescriptor, boolean useAttributesForPrimitives)
          Deprecated. 0.5 use createXMLDescriptor(org.apache.commons.betwixt.BeanProperty).
protected  NameMapper createNameMapper()
          Deprecated. 0.6 this method has been moved into IntrospectionConfiguration. Those who need to vary this should subclass that class instead
protected  PluralStemmer createPluralStemmer()
          Deprecated. 0.6 this method has been moved into IntrospectionConfiguration. Those who need to vary this should subclass that class instead
protected  XMLBeanInfo createXMLBeanInfo(java.beans.BeanInfo beanInfo)
          Factory method to create XMLBeanInfo instances
protected  XMLBeanInfo createXMLBeanInfo(org.apache.commons.beanutils.DynaClass dynaClass)
          Creates XMLBeanInfo for the given DynaClass.
 Descriptor createXMLDescriptor(BeanProperty beanProperty)
          Create a XML descriptor from a bean one.
 void defaultAddMethods(ElementDescriptor rootDescriptor, java.lang.Class beanClass)
          Add any addPropety(PropertyType) methods as Updaters which are often used for 1-N relationships in beans.
 void defaultAddMethods(ElementDescriptor rootDescriptor, java.lang.Class beanClass, boolean preservePropertyName)
          Add any addPropety(PropertyType) methods as Updaters which are often used for 1-N relationships in beans.
protected  XMLBeanInfo findByXMLDescriptor(java.lang.Class aClass)
          Attempt to lookup the XML descriptor for the given class using the classname + ".betwixt" using the same ClassLoader used to load the class or return null if it could not be loaded
 void flushCache()
          Deprecated. 0.5 use flushable registry instead
 NameMapper getAttributeNameMapper()
          Deprecated. 0.6 getConfiguration().getAttributeNameMapper
 ClassNormalizer getClassNormalizer()
          Deprecated. 0.6 use getConfiguration().getClassNormalizer
 IntrospectionConfiguration getConfiguration()
          Gets the configuration to be used for introspection.
 NameMapper getElementNameMapper()
          Deprecated. 0.6 use getConfiguration().getElementNameMapper
 org.apache.commons.logging.Log getLog()
          Gets the current logging implementation.
 NameMapper getNameMapper()
          Deprecated. 0.5 getNameMapper is split up in getElementNameMapper() and getAttributeNameMapper()
 PluralStemmer getPluralStemmer()
          Deprecated. 0.6 use getConfiguration().getPluralStemmer
 PolymorphicReferenceResolver getPolymorphicReferenceResolver()
          Gets the resolver for polymorphic references.
 XMLBeanInfoRegistry getRegistry()
          Gets the current registry implementation.
 XMLBeanInfo introspect(java.beans.BeanInfo beanInfo)
          Create a standard XMLBeanInfo by introspection.
 XMLBeanInfo introspect(java.lang.Class aClass)
          Create a standard XMLBeanInfo by introspection.
 XMLBeanInfo introspect(java.lang.Class aClass, org.xml.sax.InputSource source)
          Introspects the given Class using the dot betwixt document in the given InputSource.
 XMLBeanInfo introspect(org.apache.commons.beanutils.DynaClass dynaClass)
          Creates XMLBeanInfo by reading the DynaProperties of a DynaBean.
 XMLBeanInfo introspect(java.lang.Object bean)
          Create a standard XMLBeanInfo by introspection The actual introspection depends only on the BeanInfo associated with the bean.
 boolean isAttributesForPrimitives()
          Deprecated. 0.6 use getConfiguration().isAttributesForPrimitives
 boolean isCachingEnabled()
          Deprecated. 0.5 replaced by XMlBeanInfoRegistry
 boolean isLoopType(java.lang.Class type)
          Is this class a loop?
 boolean isPrimitiveType(java.lang.Class type)
          Is this class a primitive?
 boolean isWrapCollectionsInElement()
          Deprecated. 0.6 use getConfiguration().isWrapCollectionsInElement
 void register(java.lang.Class aClass, org.xml.sax.InputSource source)
          Registers the class mapping specified in the standard dot-betwixt file.
 java.lang.Class[] register(org.xml.sax.InputSource source)
          Registers the class mappings specified in the multi-class document given by the InputSource.
 void setAttributeNameMapper(NameMapper nameMapper)
          Deprecated. 0.6 use getConfiguration().setAttributeNameMapper
 void setAttributesForPrimitives(boolean attributesForPrimitives)
          Deprecated. 0.6 use getConfiguration().setAttributesForPrimitives
 void setCachingEnabled(boolean cachingEnabled)
          Deprecated. 0.5 replaced by XMlBeanInfoRegistry
 void setClassNormalizer(ClassNormalizer classNormalizer)
          Deprecated. 0.6 use getConfiguration().setClassNormalizer
 void setConfiguration(IntrospectionConfiguration configuration)
          Sets the configuration to be used for introspection.
 void setElementNameMapper(NameMapper nameMapper)
          Deprecated. 0.6 use getConfiguration().setElementNameMapper
 void setLog(org.apache.commons.logging.Log log)
          Sets the current logging implementation.
 void setNameMapper(NameMapper nameMapper)
          Deprecated. 0.5 setNameMapper is split up in setElementNameMapper(NameMapper) and setAttributeNameMapper(NameMapper)
 void setPluralStemmer(PluralStemmer pluralStemmer)
          Deprecated. 0.6 use getConfiguration().setPluralStemmer
 void setPolymorphicReferenceResolver(PolymorphicReferenceResolver polymorphicReferenceResolver)
          Sets the resolver for polymorphic references.
 void setRegistry(XMLBeanInfoRegistry registry)
          Sets the XMLBeanInfoRegistry implementation.
 void setUseBeanInfoSearchPath(boolean useBeanInfoSearchPath)
          Deprecated. 0.6 use getConfiguration().setUseBeanInfoSearchPath
 void setWrapCollectionsInElement(boolean wrapCollectionsInElement)
          Deprecated. 0.6 use getConfiguration().setWrapCollectionsInElement
 boolean useBeanInfoSearchPath()
          Deprecated. 0.6 use getConfiguration().useBeanInfoSearchPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.apache.commons.logging.Log log
Deprecated. 0.6 use the getLog() property instead
Log used for logging (Doh!)

Constructor Detail

XMLIntrospector

public XMLIntrospector()
Base constructor


XMLIntrospector

public XMLIntrospector(IntrospectionConfiguration configuration)
Construct allows a custom configuration to be set on construction. This allows IntrospectionConfiguration subclasses to be easily used.

Parameters:
configuration - IntrospectionConfiguration, not null
Method Detail

getLog

public org.apache.commons.logging.Log getLog()

Gets the current logging implementation.

Returns:
the Log implementation which this class logs to

setLog

public void setLog(org.apache.commons.logging.Log log)

Sets the current logging implementation.

Parameters:
log - the Log implementation to use for logging

getRegistry

public XMLBeanInfoRegistry getRegistry()

Gets the current registry implementation. The registry is checked to see if it has an XMLBeanInfo for a class before introspecting. After standard introspection is complete, the instance will be passed to the registry.

This allows finely grained control over the caching strategy. It also allows the standard introspection mechanism to be overridden on a per class basis.

Returns:
the XMLBeanInfoRegistry currently used

setRegistry

public void setRegistry(XMLBeanInfoRegistry registry)

Sets the XMLBeanInfoRegistry implementation. The registry is checked to see if it has an XMLBeanInfo for a class before introspecting. After standard introspection is complete, the instance will be passed to the registry.

This allows finely grained control over the caching strategy. It also allows the standard introspection mechanism to be overridden on a per class basis.

Note when using polymophic mapping with a custom registry, a call to setPolymorphicReferenceResolver(PolymorphicReferenceResolver) may be necessary.

Parameters:
registry - the XMLBeanInfoRegistry to use

getConfiguration

public IntrospectionConfiguration getConfiguration()
Gets the configuration to be used for introspection. The various introspection-time strategies and configuration variables have been consolidated as properties of this bean. This allows the configuration to be more easily shared.

Returns:
IntrospectionConfiguration, not null

setConfiguration

public void setConfiguration(IntrospectionConfiguration configuration)
Sets the configuration to be used for introspection. The various introspection-time strategies and configuration variables have been consolidated as properties of this bean. This allows the configuration to be more easily shared.

Parameters:
configuration - IntrospectionConfiguration, not null

getClassNormalizer

public ClassNormalizer getClassNormalizer()
Deprecated. 0.6 use getConfiguration().getClassNormalizer

Gets the ClassNormalizer strategy. This is used to determine the Class to be introspected (the normalized Class).

Returns:
the ClassNormalizer used to determine the Class to be introspected for a given Object.
Since:
0.5

setClassNormalizer

public void setClassNormalizer(ClassNormalizer classNormalizer)
Deprecated. 0.6 use getConfiguration().setClassNormalizer

Sets the ClassNormalizer strategy. This is used to determine the Class to be introspected (the normalized Class).

Parameters:
classNormalizer - the ClassNormalizer to be used to determine the Class to be introspected for a given Object.
Since:
0.5

getPolymorphicReferenceResolver

public PolymorphicReferenceResolver getPolymorphicReferenceResolver()

Gets the resolver for polymorphic references.

Though this is used only at bind time, it is typically tightly couple to the xml registry. It is therefore convenient to keep both references together.

Note: though the implementation is set initially to the default registry, this reference is not updated when setRegistry(XMLBeanInfoRegistry) is called. Therefore, a call to setPolymorphicReferenceResolver(PolymorphicReferenceResolver) with the instance may be necessary.

Returns:
PolymorphicReferenceResolver, not null
Since:
0.7

setPolymorphicReferenceResolver

public void setPolymorphicReferenceResolver(PolymorphicReferenceResolver polymorphicReferenceResolver)

Sets the resolver for polymorphic references.

Though this is used only at bind time, it is typically tightly couple to the xml registry. It is therefore convenient to keep both references together.

Note: though the implementation is set initially to the default registry, this reference is not updated when setRegistry(XMLBeanInfoRegistry) is called. Therefore, a call to setPolymorphicReferenceResolver(PolymorphicReferenceResolver) with the instance may be necessary.

Parameters:
polymorphicReferenceResolver - The polymorphicReferenceResolver to set.
Since:
0.7

isCachingEnabled

public boolean isCachingEnabled()
Deprecated. 0.5 replaced by XMlBeanInfoRegistry

Is XMLBeanInfo caching enabled?

Returns:
true if caching is enabled

setCachingEnabled

public void setCachingEnabled(boolean cachingEnabled)
Deprecated. 0.5 replaced by XMlBeanInfoRegistry

Set whether XMLBeanInfo caching should be enabled.

Parameters:
cachingEnabled - ignored

isAttributesForPrimitives

public boolean isAttributesForPrimitives()
Deprecated. 0.6 use getConfiguration().isAttributesForPrimitives

Should attributes (or elements) be used for primitive types.

Returns:
true if primitive types will be mapped to attributes in the introspection

setAttributesForPrimitives

public void setAttributesForPrimitives(boolean attributesForPrimitives)
Deprecated. 0.6 use getConfiguration().setAttributesForPrimitives

Set whether attributes (or elements) should be used for primitive types.

Parameters:
attributesForPrimitives - pass trus to map primitives to attributes, pass false to map primitives to elements

isWrapCollectionsInElement

public boolean isWrapCollectionsInElement()
Deprecated. 0.6 use getConfiguration().isWrapCollectionsInElement

Should collections be wrapped in an extra element?

Returns:
whether we should we wrap collections in an extra element?

setWrapCollectionsInElement

public void setWrapCollectionsInElement(boolean wrapCollectionsInElement)
Deprecated. 0.6 use getConfiguration().setWrapCollectionsInElement

Sets whether we should we wrap collections in an extra element.

Parameters:
wrapCollectionsInElement - pass true if collections should be wrapped in a parent element

getPluralStemmer

public PluralStemmer getPluralStemmer()
Deprecated. 0.6 use getConfiguration().getPluralStemmer

Get singular and plural matching strategy.

Returns:
the strategy used to detect matching singular and plural properties

setPluralStemmer

public void setPluralStemmer(PluralStemmer pluralStemmer)
Deprecated. 0.6 use getConfiguration().setPluralStemmer

Sets the strategy used to detect matching singular and plural properties

Parameters:
pluralStemmer - the PluralStemmer used to match singular and plural

getNameMapper

public NameMapper getNameMapper()
Deprecated. 0.5 getNameMapper is split up in getElementNameMapper() and getAttributeNameMapper()

Gets the name mapper strategy.

Returns:
the strategy used to convert bean type names into element names

setNameMapper

public void setNameMapper(NameMapper nameMapper)
Deprecated. 0.5 setNameMapper is split up in setElementNameMapper(NameMapper) and setAttributeNameMapper(NameMapper)

Sets the strategy used to convert bean type names into element names

Parameters:
nameMapper - the NameMapper strategy to be used

getElementNameMapper

public NameMapper getElementNameMapper()
Deprecated. 0.6 use getConfiguration().getElementNameMapper

Gets the name mapping strategy used to convert bean names into elements.

Returns:
the strategy used to convert bean type names into element names. If no element mapper is currently defined then a default one is created.

setElementNameMapper

public void setElementNameMapper(NameMapper nameMapper)
Deprecated. 0.6 use getConfiguration().setElementNameMapper

Sets the strategy used to convert bean type names into element names

Parameters:
nameMapper - the NameMapper to use for the conversion

getAttributeNameMapper

public NameMapper getAttributeNameMapper()
Deprecated. 0.6 getConfiguration().getAttributeNameMapper

Gets the name mapping strategy used to convert bean names into attributes.

Returns:
the strategy used to convert bean type names into attribute names. If no attributeNamemapper is known, it will default to the ElementNameMapper

setAttributeNameMapper

public void setAttributeNameMapper(NameMapper nameMapper)
Deprecated. 0.6 use getConfiguration().setAttributeNameMapper

Sets the strategy used to convert bean type names into attribute names

Parameters:
nameMapper - the NameMapper to use for the convertion

useBeanInfoSearchPath

public boolean useBeanInfoSearchPath()
Deprecated. 0.6 use getConfiguration().useBeanInfoSearchPath

Should the original java.reflect.Introspector bean info search path be used? By default it will be false.

Returns:
boolean if the beanInfoSearchPath should be used.

setUseBeanInfoSearchPath

public void setUseBeanInfoSearchPath(boolean useBeanInfoSearchPath)
Deprecated. 0.6 use getConfiguration().setUseBeanInfoSearchPath

Specifies if you want to use the beanInfoSearchPath

Parameters:
useBeanInfoSearchPath -
See Also:
for more details

flushCache

public void flushCache()
Deprecated. 0.5 use flushable registry instead

Flush existing cached XMLBeanInfo's.


introspect

public XMLBeanInfo introspect(java.lang.Object bean)
                       throws java.beans.IntrospectionException
Create a standard XMLBeanInfo by introspection The actual introspection depends only on the BeanInfo associated with the bean.

Parameters:
bean - introspect this bean
Returns:
XMLBeanInfo describing bean-xml mapping
Throws:
java.beans.IntrospectionException - when the bean introspection fails

introspect

public XMLBeanInfo introspect(org.apache.commons.beanutils.DynaClass dynaClass)
Creates XMLBeanInfo by reading the DynaProperties of a DynaBean. Customizing DynaBeans using betwixt is not supported.

Parameters:
dynaClass - the DynaBean to introspect
Returns:
XMLBeanInfo for the DynaClass

introspect

public XMLBeanInfo introspect(java.lang.Class aClass,
                              org.xml.sax.InputSource source)
                       throws java.io.IOException,
                              org.xml.sax.SAXException

Introspects the given Class using the dot betwixt document in the given InputSource.

Note: that the given mapping will not be registered by this method. Use register(Class, InputSource) instead.

Parameters:
aClass - Class, not null
source - InputSource, not null
Returns:
XMLBeanInfo describing the mapping.
Throws:
org.xml.sax.SAXException - when the input source cannot be parsed
java.io.IOException
Since:
0.7

introspect

public XMLBeanInfo introspect(java.lang.Class aClass)
                       throws java.beans.IntrospectionException
Create a standard XMLBeanInfo by introspection. The actual introspection depends only on the BeanInfo associated with the bean.

Parameters:
aClass - introspect this class
Returns:
XMLBeanInfo describing bean-xml mapping
Throws:
java.beans.IntrospectionException - when the bean introspection fails

introspect

public XMLBeanInfo introspect(java.beans.BeanInfo beanInfo)
                       throws java.beans.IntrospectionException
Create a standard XMLBeanInfo by introspection. The actual introspection depends only on the BeanInfo associated with the bean.

Parameters:
beanInfo - the BeanInfo the xml-bean mapping is based on
Returns:
XMLBeanInfo describing bean-xml mapping
Throws:
java.beans.IntrospectionException - when the bean introspection fails

register

public java.lang.Class[] register(org.xml.sax.InputSource source)
                           throws java.beans.IntrospectionException,
                                  java.io.IOException,
                                  org.xml.sax.SAXException

Registers the class mappings specified in the multi-class document given by the InputSource.

Note: that this method will override any existing mapping for the speficied classes.

Parameters:
source - InputSource, not null
Returns:
Class array containing all mapped classes
Throws:
java.beans.IntrospectionException
org.xml.sax.SAXException
java.io.IOException
Since:
0.7

register

public void register(java.lang.Class aClass,
                     org.xml.sax.InputSource source)
              throws java.io.IOException,
                     org.xml.sax.SAXException

Registers the class mapping specified in the standard dot-betwixt file. Subsequent introspections will use this registered mapping for the class.

Note: that this method will override any existing mapping for this class.

Parameters:
aClass - Class, not null
source - InputSource, not null
Throws:
org.xml.sax.SAXException - when the source cannot be parsed
java.io.IOException
Since:
0.7

createXMLBeanInfo

protected XMLBeanInfo createXMLBeanInfo(org.apache.commons.beanutils.DynaClass dynaClass)
Creates XMLBeanInfo for the given DynaClass.

Parameters:
dynaClass - the class describing a DynaBean
Returns:
XMLBeanInfo that describes the properties of the given DynaClass

createDescriptor

public Descriptor createDescriptor(java.beans.PropertyDescriptor propertyDescriptor,
                                   boolean useAttributesForPrimitives)
                            throws java.beans.IntrospectionException
Deprecated. 0.5 use createXMLDescriptor(org.apache.commons.betwixt.BeanProperty).

Create a XML descriptor from a bean one. Go through and work out whether it's a loop property, a primitive or a standard. The class property is ignored.

Parameters:
propertyDescriptor - create a NodeDescriptor for this property
useAttributesForPrimitives - write primitives as attributes (rather than elements)
Returns:
a correctly configured NodeDescriptor for the property
Throws:
java.beans.IntrospectionException - when bean introspection fails

createXMLDescriptor

public Descriptor createXMLDescriptor(BeanProperty beanProperty)
Create a XML descriptor from a bean one. Go through and work out whether it's a loop property, a primitive or a standard. The class property is ignored.

Parameters:
beanProperty - the BeanProperty specifying the property
Returns:
a correctly configured NodeDescriptor for the property
Since:
0.5

defaultAddMethods

public void defaultAddMethods(ElementDescriptor rootDescriptor,
                              java.lang.Class beanClass)
Add any addPropety(PropertyType) methods as Updaters which are often used for 1-N relationships in beans. This method does not preserve null property names.
The tricky part here is finding which ElementDescriptor corresponds to the method. e.g. a property 'items' might have an Element descriptor which the method addItem() should match to.
So the algorithm we'll use by default is to take the decapitalized name of the property being added and find the first ElementDescriptor that matches the property starting with the string. This should work for most use cases. e.g. addChild() would match the children property.
TODO this probably needs refactoring. It probably belongs in the bean wrapper (so that it'll work properly with dyna-beans) and so that the operations can be optimized by caching. Multiple hash maps are created and getMethods is called multiple times. This is relatively expensive and so it'd be better to push into a proper class and cache.

Parameters:
rootDescriptor - add defaults to this descriptor
beanClass - the Class to which descriptor corresponds

defaultAddMethods

public void defaultAddMethods(ElementDescriptor rootDescriptor,
                              java.lang.Class beanClass,
                              boolean preservePropertyName)
Add any addPropety(PropertyType) methods as Updaters which are often used for 1-N relationships in beans.
The tricky part here is finding which ElementDescriptor corresponds to the method. e.g. a property 'items' might have an Element descriptor which the method addItem() should match to.
So the algorithm we'll use by default is to take the decapitalized name of the property being added and find the first ElementDescriptor that matches the property starting with the string. This should work for most use cases. e.g. addChild() would match the children property.
TODO this probably needs refactoring. It probably belongs in the bean wrapper (so that it'll work properly with dyna-beans) and so that the operations can be optimized by caching. Multiple hash maps are created and getMethods is called multiple times. This is relatively expensive and so it'd be better to push into a proper class and cache.

Parameters:
rootDescriptor - add defaults to this descriptor
beanClass - the Class to which descriptor corresponds
Since:
0.8

assignAdder

public void assignAdder(java.lang.reflect.Method twinParameterAdderMethod,
                        ElementDescriptor matchingDescriptor)
Assigns the given method as an adder method to the given descriptor.

Parameters:
twinParameterAdderMethod - adder Method, not null
matchingDescriptor - ElementDescriptor describing the element
Since:
0.8

createPluralStemmer

protected PluralStemmer createPluralStemmer()
Deprecated. 0.6 this method has been moved into IntrospectionConfiguration. Those who need to vary this should subclass that class instead

A Factory method to lazily create a new strategy to detect matching singular and plural properties.

Returns:
new defualt PluralStemmer implementation

createNameMapper

protected NameMapper createNameMapper()
Deprecated. 0.6 this method has been moved into IntrospectionConfiguration. Those who need to vary this should subclass that class instead

A Factory method to lazily create a strategy used to convert bean type names into element names.

Returns:
new default NameMapper implementation

findByXMLDescriptor

protected XMLBeanInfo findByXMLDescriptor(java.lang.Class aClass)
Attempt to lookup the XML descriptor for the given class using the classname + ".betwixt" using the same ClassLoader used to load the class or return null if it could not be loaded

Parameters:
aClass - digester .betwixt file for this class
Returns:
XMLBeanInfo digested from the .betwixt file if one can be found. Otherwise null.

addProperties

protected void addProperties(java.beans.BeanInfo beanInfo,
                             java.util.List elements,
                             java.util.List attributes,
                             java.util.List contents)
                      throws java.beans.IntrospectionException
Deprecated. 0.5 use addProperties(BeanProperty[], List, List,List)

Loop through properties and process each one

Parameters:
beanInfo - the BeanInfo whose properties will be processed
elements - ElementDescriptor list to which elements will be added
attributes - AttributeDescriptor list to which attributes will be added
contents - Descriptor list to which mixed content will be added
Throws:
java.beans.IntrospectionException - if the bean introspection fails

addProperties

protected void addProperties(BeanProperty[] beanProperties,
                             java.util.List elements,
                             java.util.List attributes,
                             java.util.List contents)
Loop through properties and process each one

Parameters:
beanProperties - the properties to be processed
elements - ElementDescriptor list to which elements will be added
attributes - AttributeDescriptor list to which attributes will be added
contents - Descriptor list to which mixed content will be added
Since:
0.5

addProperty

protected void addProperty(java.beans.BeanInfo beanInfo,
                           java.beans.PropertyDescriptor propertyDescriptor,
                           java.util.List elements,
                           java.util.List attributes,
                           java.util.List contents)
                    throws java.beans.IntrospectionException
Deprecated. 0.5 BeanInfo is no longer required. Use addProperty(PropertyDescriptor, List, List, List) instead.

Process a property. Go through and work out whether it's a loop property, a primitive or a standard. The class property is ignored.

Parameters:
beanInfo - the BeanInfo whose property is being processed
propertyDescriptor - the PropertyDescriptor to process
elements - ElementDescriptor list to which elements will be added
attributes - AttributeDescriptor list to which attributes will be added
contents - Descriptor list to which mixed content will be added
Throws:
java.beans.IntrospectionException - if the bean introspection fails

addProperty

protected void addProperty(java.beans.PropertyDescriptor propertyDescriptor,
                           java.util.List elements,
                           java.util.List attributes,
                           java.util.List contents)
                    throws java.beans.IntrospectionException
Deprecated. 0.5 use addProperty(BeanProperty, List, List, List) instead

Process a property. Go through and work out whether it's a loop property, a primitive or a standard. The class property is ignored.

Parameters:
propertyDescriptor - the PropertyDescriptor to process
elements - ElementDescriptor list to which elements will be added
attributes - AttributeDescriptor list to which attributes will be added
contents - Descriptor list to which mixed content will be added
Throws:
java.beans.IntrospectionException - if the bean introspection fails

addProperty

protected void addProperty(BeanProperty beanProperty,
                           java.util.List elements,
                           java.util.List attributes,
                           java.util.List contents)
Process a property. Go through and work out whether it's a loop property, a primitive or a standard. The class property is ignored.

Parameters:
beanProperty - the bean property to process
elements - ElementDescriptor list to which elements will be added
attributes - AttributeDescriptor list to which attributes will be added
contents - Descriptor list to which mixed content will be added
Since:
0.5

addProperties

protected void addProperties(java.beans.BeanInfo beanInfo,
                             java.util.List elements,
                             java.util.List attributes)
                      throws java.beans.IntrospectionException
Deprecated. 0.5 this method does not support mixed content. Use addProperties(BeanInfo, List, List, List) instead.

Loop through properties and process each one

Parameters:
beanInfo - the BeanInfo whose properties will be processed
elements - ElementDescriptor list to which elements will be added
attributes - AttributeDescriptor list to which attributes will be added
Throws:
java.beans.IntrospectionException - if the bean introspection fails

addProperty

protected void addProperty(java.beans.BeanInfo beanInfo,
                           java.beans.PropertyDescriptor propertyDescriptor,
                           java.util.List elements,
                           java.util.List attributes)
                    throws java.beans.IntrospectionException
Deprecated. 0.5 this method does not support mixed content. Use addProperty(BeanInfo, PropertyDescriptor, List, List, List) instead.

Process a property. Go through and work out whether it's a loop property, a primitive or a standard. The class property is ignored.

Parameters:
beanInfo - the BeanInfo whose property is being processed
propertyDescriptor - the PropertyDescriptor to process
elements - ElementDescriptor list to which elements will be added
attributes - AttributeDescriptor list to which attributes will be added
Throws:
java.beans.IntrospectionException - if the bean introspection fails

createXMLBeanInfo

protected XMLBeanInfo createXMLBeanInfo(java.beans.BeanInfo beanInfo)
Factory method to create XMLBeanInfo instances

Parameters:
beanInfo - the BeanInfo from which the XMLBeanInfo will be created
Returns:
XMLBeanInfo describing the bean-xml mapping

isLoopType

public boolean isLoopType(java.lang.Class type)
Is this class a loop?

Parameters:
type - the Class to test
Returns:
true if the type is a loop type

isPrimitiveType

public boolean isPrimitiveType(java.lang.Class type)
Is this class a primitive?

Parameters:
type - the Class to test
Returns:
true for primitive types


Copyright 2002-2008 The Apache Software Foundation. All Rights Reserved.