org.apache.commons.betwixt
Class BindingConfiguration

java.lang.Object
  |
  +--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.
 boolean getMapIDs()
          Should ID's and IDREF attributes be used to cross-reference matching objects?
 ObjectStringConverter getObjectStringConverter()
          Gets the Object <-> String converter.
 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 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.
 
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


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