public class

IntrospectionConfiguration

extends Object
java.lang.Object
   ↳ org.apache.commons.betwixt.IntrospectionConfiguration

Class Overview

Stores introspection phase binding configuration.

There are two phase in Betwixt's processing. The first phase is the introspection of the bean. Strutural configuration settings effect this phase. The second phase comes when Betwixt dynamically uses reflection to execute the mapping. This object stores configuration settings pertaining to the first phase.

These common settings have been collected into one class so that they can be more easily shared not only between the objects that execute the introspection but also (by a user) between different XMLIntrospectors.

Summary

Public Constructors
IntrospectionConfiguration()
Public Methods
NameMapper getAttributeNameMapper()
Gets the name mapping strategy used to convert bean names into attributes.
AttributeSuppressionStrategy getAttributeSuppressionStrategy()
Returns the AttributeSuppressionStrategy.
ClassNormalizer getClassNormalizer()
Gets the ClassNormalizer strategy.
CollectiveTypeStrategy getCollectiveTypeStrategy()
Gets the strategy used to determine which types are collective.
NameMapper getElementNameMapper()
Gets the name mapping strategy used to convert bean names into elements.
ElementSuppressionStrategy getElementSuppressionStrategy()
Returns the ElementSuppressionStrategy.
Log getIntrospectionLog()
Gets the common Log used for introspection.
MappingDerivationStrategy getMappingDerivationStrategy()
Gets the MappingDerivationStrategy used to determine whether the bind or introspection time type should determine the mapping.
PluralStemmer getPluralStemmer()
Get singular and plural matching strategy.
NamespacePrefixMapper getPrefixMapper()
Gets the NamespacePrefixMapper used to convert namespace URIs into prefixes.
PropertySuppressionStrategy getPropertySuppressionStrategy()
Gets the strategy which determines the properties to be ignored.
SimpleTypeMapper getSimpleTypeMapper()
Gets the simple type binding strategy.
TypeBindingStrategy getTypeBindingStrategy()
Gets the TypeBindingStrategy to be used to determine the binding for Java types.
boolean ignoreAllBeanInfo()

Should existing BeanInfo classes be ignored by java.reflect.Introspector.

boolean isAttributesForPrimitives()
Should attributes (or elements) be used for primitive types.
boolean isLoopType(Class type)
Is this a loop type class?
boolean isWrapCollectionsInElement()
Should collections be wrapped in an extra element?
void setAttributeNameMapper(NameMapper nameMapper)
Sets the strategy used to convert bean type names into attribute names
void setAttributeSuppressionStrategy(AttributeSuppressionStrategy attributeSuppressionStrategy)
Sets the AttributeSuppressionStrategy.
void setAttributesForPrimitives(boolean attributesForPrimitives)
Set whether attributes (or elements) should be used for primitive types.
void setClassNormalizer(ClassNormalizer classNormalizer)
Sets the ClassNormalizer strategy.
void setCollectiveTypeStrategy(CollectiveTypeStrategy collectiveTypeStrategy)
Sets the strategy used to determine which types are collective.
void setElementNameMapper(NameMapper nameMapper)
Sets the strategy used to convert bean type names into element names
void setElementSuppressionStrategy(ElementSuppressionStrategy elementSuppressionStrategy)
Sets the ElementSuppressionStrategy.
void setIgnoreAllBeanInfo(boolean ignoreAllBeanInfo)
Specifies if you want to ignore existing BeanInfo classes at all for introspection
void setIntrospectionLog(Log log)
Sets the common Log used by introspection.
void setMappingDerivationStrategy(MappingDerivationStrategy mappingDerivationStrategy)
Sets the MappingDerivationStrategy used to determine whether the bind or introspection time type should determine the mapping.
void setPluralStemmer(PluralStemmer pluralStemmer)
Sets the strategy used to detect matching singular and plural properties
void setPrefixMapper(NamespacePrefixMapper mapper)
Sets the NamespacePrefixMapper used to convert namespave URIs into prefixes.
void setPropertySuppressionStrategy(PropertySuppressionStrategy propertySuppressionStrategy)
Sets the strategy which determines the properties to be ignored.
void setSimpleTypeMapper(SimpleTypeMapper mapper)
Sets the simple type binding strategy.
void setTypeBindingStrategy(TypeBindingStrategy typeBindingStrategy)
Sets the TypeBindingStrategy to be used to determine the binding for Java types.
void setUseBeanInfoSearchPath(boolean useBeanInfoSearchPath)
Specifies if you want to use the beanInfoSearchPath
void setWrapCollectionsInElement(boolean wrapCollectionsInElement)
Sets whether we should we wrap collections in an extra element.
boolean useBeanInfoSearchPath()

Should the original java.reflect.Introspector bean info search path be used?

Default is false.

Protected Methods
NameMapper createNameMapper()
A Factory method to lazily create a strategy used to convert bean type names into element names.
PluralStemmer createPluralStemmer()
A Factory method to lazily create a new strategy to detect matching singular and plural properties.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public IntrospectionConfiguration ()

Public Methods

public NameMapper 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

public AttributeSuppressionStrategy getAttributeSuppressionStrategy ()

Returns the AttributeSuppressionStrategy. This is used to suppress attributes, e.g. for versioning.

Returns
  • the strategy

public ClassNormalizer 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.

public CollectiveTypeStrategy getCollectiveTypeStrategy ()

Gets the strategy used to determine which types are collective.

Returns
  • CollectiveTypeStrategy, not null

public NameMapper 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.

public ElementSuppressionStrategy getElementSuppressionStrategy ()

Returns the ElementSuppressionStrategy. This is used to suppress elements, e.g. for versioning.

Returns
  • the strategy

public Log getIntrospectionLog ()

Gets the common Log used for introspection. It is more convenient to use a single Log that can be easily configured.

Returns
  • Log, not null

public MappingDerivationStrategy getMappingDerivationStrategy ()

Gets the MappingDerivationStrategy used to determine whether the bind or introspection time type should determine the mapping.

Returns
  • MappingDerivationStrategy, not null

public PluralStemmer getPluralStemmer ()

Get singular and plural matching strategy.

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

public NamespacePrefixMapper getPrefixMapper ()

Gets the NamespacePrefixMapper used to convert namespace URIs into prefixes.

Returns
  • NamespacePrefixMapper, not null

public PropertySuppressionStrategy getPropertySuppressionStrategy ()

Gets the strategy which determines the properties to be ignored.

Returns
  • the PropertySuppressionStrategy to be used for introspection, not null

public SimpleTypeMapper getSimpleTypeMapper ()

Gets the simple type binding strategy.

Returns
  • SimpleTypeMapper, not null

public TypeBindingStrategy getTypeBindingStrategy ()

Gets the TypeBindingStrategy to be used to determine the binding for Java types.

Returns
  • the TypeBindingStrategy to be used, not null

public boolean ignoreAllBeanInfo ()

Should existing BeanInfo classes be ignored by java.reflect.Introspector.

Default is false.

Returns
  • boolean if the BeanInfo classes should be used.

public boolean isAttributesForPrimitives ()

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

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

public boolean isLoopType (Class type)

Is this a loop type class?

Parameters
type is this Class a loop type?
Returns
  • true if the type is a loop type, or if type is null

public boolean isWrapCollectionsInElement ()

Should collections be wrapped in an extra element?

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

public void setAttributeNameMapper (NameMapper nameMapper)

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

Parameters
nameMapper the NameMapper to use for the convertion

public void setAttributeSuppressionStrategy (AttributeSuppressionStrategy attributeSuppressionStrategy)

Sets the AttributeSuppressionStrategy. This is used to suppress attributes, e.g. for versioning.

Parameters
attributeSuppressionStrategy the strategy

public void setAttributesForPrimitives (boolean attributesForPrimitives)

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

public void setClassNormalizer (ClassNormalizer classNormalizer)

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.

public void setCollectiveTypeStrategy (CollectiveTypeStrategy collectiveTypeStrategy)

Sets the strategy used to determine which types are collective.

Parameters
collectiveTypeStrategy CollectiveTypeStrategy, not null

public void setElementNameMapper (NameMapper nameMapper)

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

Parameters
nameMapper the NameMapper to use for the conversion

public void setElementSuppressionStrategy (ElementSuppressionStrategy elementSuppressionStrategy)

Sets the ElementSuppressionStrategy. This is used to suppress elements, e.g. for versioning.

Parameters
elementSuppressionStrategy the strategy

public void setIgnoreAllBeanInfo (boolean ignoreAllBeanInfo)

Specifies if you want to ignore existing BeanInfo classes at all for introspection

Parameters
ignoreAllBeanInfo set to true to ignore all BeanInfo classes
See Also
  • java.beans.Introspector for more details

public void setIntrospectionLog (Log log)

Sets the common Log used by introspection. It is more convenient to use a single Log that can be easily configured.

Parameters
log Log, not null

public void setMappingDerivationStrategy (MappingDerivationStrategy mappingDerivationStrategy)

Sets the MappingDerivationStrategy used to determine whether the bind or introspection time type should determine the mapping.

Parameters
mappingDerivationStrategy MappingDerivationStrategy, not null

public void setPluralStemmer (PluralStemmer pluralStemmer)

Sets the strategy used to detect matching singular and plural properties

Parameters
pluralStemmer the PluralStemmer used to match singular and plural

public void setPrefixMapper (NamespacePrefixMapper mapper)

Sets the NamespacePrefixMapper used to convert namespave URIs into prefixes.

Parameters
mapper NamespacePrefixMapper, not null

public void setPropertySuppressionStrategy (PropertySuppressionStrategy propertySuppressionStrategy)

Sets the strategy which determines the properties to be ignored.

Parameters
propertySuppressionStrategy the PropertySuppressionStrategy to be used for introspection, not null

public void setSimpleTypeMapper (SimpleTypeMapper mapper)

Sets the simple type binding strategy.

Parameters
mapper SimpleTypeMapper, not null

public void setTypeBindingStrategy (TypeBindingStrategy typeBindingStrategy)

Sets the TypeBindingStrategy to be used to determine the binding for Java types.

Parameters
typeBindingStrategy the TypeBindingStrategy to be used, not null

public void setUseBeanInfoSearchPath (boolean useBeanInfoSearchPath)

Specifies if you want to use the beanInfoSearchPath

See Also
  • java.beans.Introspector for more details

public void setWrapCollectionsInElement (boolean wrapCollectionsInElement)

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

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

public boolean useBeanInfoSearchPath ()

Should the original java.reflect.Introspector bean info search path be used?

Default is false.

Returns
  • boolean if the beanInfoSearchPath should be used.

Protected Methods

protected NameMapper createNameMapper ()

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

Returns
  • new default NameMapper implementation

protected PluralStemmer createPluralStemmer ()

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

Returns
  • new defualt PluralStemmer implementation