public class

BindingConfiguration

extends Object
implements Serializable
java.lang.Object
   ↳ org.apache.commons.betwixt.BindingConfiguration

Class Overview

Stores mapping 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 second phase.

These common settings have been collected into one class to make round tripping easier since the same BindingConfiguration can be shared.

Summary

Public Constructors
BindingConfiguration()
Constructs a BindingConfiguration with default properties.
BindingConfiguration(ObjectStringConverter objectStringConverter, boolean mapIDs)
Constructs a BindingConfiguration
Public Methods
String getClassNameAttribute()
The name of the attribute which can be specified in the XML to override the type of a bean used at a certain point in the schema.
IdStoringStrategy getIdMappingStrategy()
Gets the strategy used to manage storage and retrieval of id's.
boolean getMapIDs()
Should ID's and IDREF attributes be used to cross-reference matching objects?
ObjectStringConverter getObjectStringConverter()
Gets the Object <-> String converter.
ValueSuppressionStrategy getValueSuppressionStrategy()
Gets the ValueSuppressionStrategy.
void setClassNameAttribute(String classNameAttribute)
Sets the name of the attribute which can be specified in the XML to override the type of a bean used at a certain point in the schema.
void setIdMappingStrategy(IdStoringStrategy idMappingStrategy)
Sets the strategy used to manage storage and retrieval of id's.
void setMapIDs(boolean mapIDs)
Should ID's and IDREF attributes be used to cross-reference matching objects?
void setObjectStringConverter(ObjectStringConverter objectStringConverter)
Sets the Object <-> String converter.
void setValueSuppressionStrategy(ValueSuppressionStrategy valueSuppressionStrategy)
Sets the ValueSuppressionStrategy.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public BindingConfiguration ()

Constructs a BindingConfiguration with default properties.

public BindingConfiguration (ObjectStringConverter objectStringConverter, boolean mapIDs)

Constructs a BindingConfiguration

Parameters
objectStringConverter the ObjectStringConverter to be used to convert Objects <-> Strings
mapIDs should ID's and IDREF be used to cross-reference

Public Methods

public String getClassNameAttribute ()

The name of the attribute which can be specified in the XML to override the type of a bean used at a certain point in the schema.

The default value is 'className'.

Returns
  • The name of the attribute used to overload the class name of a bean

public IdStoringStrategy getIdMappingStrategy ()

Gets the strategy used to manage storage and retrieval of id's.

Returns
  • Returns the IdStoringStrategy, not null

public boolean getMapIDs ()

Should ID's and IDREF attributes be used to cross-reference matching objects?

Returns
  • true if ID and IDREF attributes should be used to cross-reference instances

public ObjectStringConverter getObjectStringConverter ()

Gets the Object <-> String converter.

Returns
  • the ObjectStringConverter to use, not null

public ValueSuppressionStrategy getValueSuppressionStrategy ()

Gets the ValueSuppressionStrategy. This is used to control the expression of attributes with certain values.

Returns
  • ValueSuppressionStrategy, not null

public void setClassNameAttribute (String classNameAttribute)

Sets the name of the attribute which can be specified in the XML to override the type of a bean used at a certain point in the schema.

The default value is 'className'.

Parameters
classNameAttribute The name of the attribute used to overload the class name of a bean

public void setIdMappingStrategy (IdStoringStrategy idMappingStrategy)

Sets the strategy used to manage storage and retrieval of id's.

Parameters
idMappingStrategy IdStoringStrategy to be set, not null

public void setMapIDs (boolean mapIDs)

Should ID's and IDREF attributes be used to cross-reference matching objects?

Parameters
mapIDs pass true if ID's should be used to cross-reference

public void setObjectStringConverter (ObjectStringConverter objectStringConverter)

Sets the Object <-> String converter.

Parameters
objectStringConverter the ObjectStringConverter to be used, not null

public void setValueSuppressionStrategy (ValueSuppressionStrategy valueSuppressionStrategy)

Sets the ValueSuppressionStrategy. This is used to control the expression of attributes with certain values.

Parameters
valueSuppressionStrategy ValueSuppressionStrategy, not null