org.apache.commons.betwixt
Class BindingConfiguration

java.lang.Object
  extended by org.apache.commons.betwixt.BindingConfiguration
All Implemented Interfaces:
java.io.Serializable

public class BindingConfiguration
extends java.lang.Object
implements java.io.Serializable

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.

Since:
0.5
Author:
Robert Burrell Donkin
See Also:
Serialized Form

Constructor Summary
BindingConfiguration()
          Constructs a BindingConfiguration with default properties.
BindingConfiguration(ObjectStringConverter objectStringConverter, boolean mapIDs)
          Constructs a BindingConfiguration
 
Method Summary
 java.lang.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(java.lang.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BindingConfiguration

public BindingConfiguration()
Constructs a BindingConfiguration with default properties.


BindingConfiguration

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
Method Detail

getObjectStringConverter

public ObjectStringConverter getObjectStringConverter()
Gets the Object <-> String converter.

Returns:
the ObjectStringConverter to use, not null

setObjectStringConverter

public void setObjectStringConverter(ObjectStringConverter objectStringConverter)
Sets the Object <-> String converter.

Parameters:
objectStringConverter - the ObjectStringConverter to be used, not null

getMapIDs

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

setMapIDs

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

getClassNameAttribute

public java.lang.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

setClassNameAttribute

public void setClassNameAttribute(java.lang.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

getValueSuppressionStrategy

public ValueSuppressionStrategy getValueSuppressionStrategy()
Gets the ValueSuppressionStrategy. This is used to control the expression of attributes with certain values.

Returns:
ValueSuppressionStrategy, not null
Since:
0.7

setValueSuppressionStrategy

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
Since:
0.7

getIdMappingStrategy

public IdStoringStrategy getIdMappingStrategy()
Gets the strategy used to manage storage and retrieval of id's.

Returns:
Returns the IdStoringStrategy, not null
Since:
0.7

setIdMappingStrategy

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
Since:
0.7


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