|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.betwixt.IntrospectionConfiguration
public class IntrospectionConfiguration
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 XMLIntrospector
s.
Field Summary | |
---|---|
private NameMapper |
attributeNameMapper
The strategy used to convert bean type names into attribute names It will default to the normal nameMapper. |
private boolean |
attributesForPrimitives
should attributes or elements be used for primitive types |
private AttributeSuppressionStrategy |
attributeSuppressionStrategy
Strategy for suppressing attributes |
private ClassNormalizer |
classNormalizer
Strategy normalizes the Class of the Object before introspection |
private CollectiveTypeStrategy |
collectiveTypeStrategy
Strategy used for determining which types are collective |
private NameMapper |
elementNameMapper
The strategy used to convert bean type names into element names |
private ElementSuppressionStrategy |
elementSuppressionStrategy
Strategy for suppressing elements |
private boolean |
ignoreAllBeanInfo
Should existing BeanInfo classes be used at all for java.reflect.Introspector |
private org.apache.commons.logging.Log |
introspectionLog
Log for introspection messages |
private MappingDerivationStrategy |
mappingDerivationStrategy
Strategy used to determine whether the bind or introspection time type is to be used to determine the mapping. |
private PluralStemmer |
pluralStemmer
The strategy used to detect matching singular and plural properties |
private NamespacePrefixMapper |
prefixMapper
Prefix naming strategy |
private PropertySuppressionStrategy |
propertySuppressionStrategy
Strategy used to determine which properties should be ignored |
private SimpleTypeMapper |
simpleTypeMapper
Mapping strategy for simple types |
private TypeBindingStrategy |
typeBindingStrategy
Binding strategy for Java type |
private boolean |
useBeanInfoSearchPath
Should the existing bean info search path for java.reflect.Introspector be used? |
private boolean |
wrapCollectionsInElement
should we wrap collections in an extra element? |
Constructor Summary | |
---|---|
IntrospectionConfiguration()
|
Method Summary | |
---|---|
protected NameMapper |
createNameMapper()
A Factory method to lazily create a strategy used to convert bean type names into element names. |
protected PluralStemmer |
createPluralStemmer()
A Factory method to lazily create a new strategy to detect matching singular and plural properties. |
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 . |
org.apache.commons.logging.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(java.lang.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 |
setAttributesForPrimitives(boolean attributesForPrimitives)
Set whether attributes (or elements) should be used for primitive types. |
void |
setAttributeSuppressionStrategy(AttributeSuppressionStrategy attributeSuppressionStrategy)
Sets the AttributeSuppressionStrategy . |
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(org.apache.commons.logging.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? |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private boolean attributesForPrimitives
private boolean wrapCollectionsInElement
private boolean useBeanInfoSearchPath
private boolean ignoreAllBeanInfo
private PluralStemmer pluralStemmer
private NameMapper elementNameMapper
private ClassNormalizer classNormalizer
private org.apache.commons.logging.Log introspectionLog
private NameMapper attributeNameMapper
private NamespacePrefixMapper prefixMapper
private SimpleTypeMapper simpleTypeMapper
private TypeBindingStrategy typeBindingStrategy
private CollectiveTypeStrategy collectiveTypeStrategy
private AttributeSuppressionStrategy attributeSuppressionStrategy
private ElementSuppressionStrategy elementSuppressionStrategy
private MappingDerivationStrategy mappingDerivationStrategy
private PropertySuppressionStrategy propertySuppressionStrategy
Constructor Detail |
---|
public IntrospectionConfiguration()
Method Detail |
---|
public ClassNormalizer getClassNormalizer()
ClassNormalizer
strategy.
This is used to determine the Class to be introspected
(the normalized Class).
ClassNormalizer
used to determine the Class to be introspected
for a given Object.public void setClassNormalizer(ClassNormalizer classNormalizer)
ClassNormalizer
strategy.
This is used to determine the Class to be introspected
(the normalized Class).
classNormalizer
- the ClassNormalizer
to be used to determine
the Class to be introspected for a given Object.public boolean isAttributesForPrimitives()
public void setAttributesForPrimitives(boolean attributesForPrimitives)
attributesForPrimitives
- pass trus to map primitives to attributes,
pass false to map primitives to elementspublic boolean isWrapCollectionsInElement()
public void setWrapCollectionsInElement(boolean wrapCollectionsInElement)
wrapCollectionsInElement
- pass true if collections should be wrapped in a
parent elementpublic PluralStemmer getPluralStemmer()
public void setPluralStemmer(PluralStemmer pluralStemmer)
pluralStemmer
- the PluralStemmer used to match singular and pluralpublic NameMapper getElementNameMapper()
public void setElementNameMapper(NameMapper nameMapper)
nameMapper
- the NameMapper to use for the conversionpublic NameMapper getAttributeNameMapper()
public void setAttributeNameMapper(NameMapper nameMapper)
nameMapper
- the NameMapper to use for the convertionpublic boolean useBeanInfoSearchPath()
Should the original java.reflect.Introspector
bean info search path be used?
Default is false.
public void setUseBeanInfoSearchPath(boolean useBeanInfoSearchPath)
useBeanInfoSearchPath
- for more details
public boolean ignoreAllBeanInfo()
Should existing BeanInfo classes be ignored by java.reflect.Introspector
.
Default is false.
public void setIgnoreAllBeanInfo(boolean ignoreAllBeanInfo)
ignoreAllBeanInfo
- set to true to ignore all BeanInfo classesfor more details
protected PluralStemmer createPluralStemmer()
protected NameMapper createNameMapper()
public org.apache.commons.logging.Log getIntrospectionLog()
public void setIntrospectionLog(org.apache.commons.logging.Log log)
log
- Log, not nullpublic NamespacePrefixMapper getPrefixMapper()
NamespacePrefixMapper
used to convert namespace URIs
into prefixes.
public void setPrefixMapper(NamespacePrefixMapper mapper)
NamespacePrefixMapper
used to convert namespave URIs
into prefixes.
mapper
- NamespacePrefixMapper, not nullpublic SimpleTypeMapper getSimpleTypeMapper()
public void setSimpleTypeMapper(SimpleTypeMapper mapper)
mapper
- SimpleTypeMapper, not nullpublic TypeBindingStrategy getTypeBindingStrategy()
TypeBindingStrategy
to be used
to determine the binding for Java types.
TypeBindingStrategy
to be used,
not nullpublic void setTypeBindingStrategy(TypeBindingStrategy typeBindingStrategy)
TypeBindingStrategy
to be used
to determine the binding for Java types.
typeBindingStrategy
- the TypeBindingStrategy
to be used,
not nullpublic MappingDerivationStrategy getMappingDerivationStrategy()
MappingDerivationStrategy
used to determine whether the bind or introspection time
type should determine the mapping.
MappingDerivationStrategy
, not nullpublic void setMappingDerivationStrategy(MappingDerivationStrategy mappingDerivationStrategy)
MappingDerivationStrategy
used to determine whether the bind or introspection time
type should determine the mapping.
mappingDerivationStrategy
- MappingDerivationStrategy
, not nullpublic PropertySuppressionStrategy getPropertySuppressionStrategy()
PropertySuppressionStrategy
to be used for introspection, not nullpublic void setPropertySuppressionStrategy(PropertySuppressionStrategy propertySuppressionStrategy)
propertySuppressionStrategy
- the PropertySuppressionStrategy
to be used for introspection, not nullpublic CollectiveTypeStrategy getCollectiveTypeStrategy()
CollectiveTypeStrategy
, not nullpublic void setCollectiveTypeStrategy(CollectiveTypeStrategy collectiveTypeStrategy)
collectiveTypeStrategy
- CollectiveTypeStrategy
, not nullpublic boolean isLoopType(java.lang.Class type)
type
- is this Class
a loop type?
public AttributeSuppressionStrategy getAttributeSuppressionStrategy()
AttributeSuppressionStrategy
.
This is used to suppress attributes, e.g. for versioning.
public void setAttributeSuppressionStrategy(AttributeSuppressionStrategy attributeSuppressionStrategy)
AttributeSuppressionStrategy
.
This is used to suppress attributes, e.g. for versioning.
attributeSuppressionStrategy
- the strategypublic ElementSuppressionStrategy getElementSuppressionStrategy()
ElementSuppressionStrategy
.
This is used to suppress elements, e.g. for versioning.
public void setElementSuppressionStrategy(ElementSuppressionStrategy elementSuppressionStrategy)
ElementSuppressionStrategy
.
This is used to suppress elements, e.g. for versioning.
elementSuppressionStrategy
- the strategy
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |