org.apache.commons.betwixt.io.read
Class ChainedBeanCreatorFactory

java.lang.Object
  extended byorg.apache.commons.betwixt.io.read.ChainedBeanCreatorFactory

public class ChainedBeanCreatorFactory
extends java.lang.Object

Group of factory methods for ChainedBeanCreator's. The standard implementations used by Betwixt are present here.

Since:
0.5
Author:
Robert Burrell Donkin

Field Summary
private static ChainedBeanCreator derivedBeanCreator
          Singleton instance for creating derived beans
private static ChainedBeanCreator elementTypeBeanCreator
          Singleton instance that creates beans based on type
private static java.lang.Class[] EMPTY_CLASS_ARRAY
           
private static java.lang.Object[] EMPTY_OBJECT_ARRAY
           
private static ChainedBeanCreator idRefBeanCreator
          Singleton instance that creates beans based on IDREF
 
Constructor Summary
ChainedBeanCreatorFactory()
           
 
Method Summary
static ChainedBeanCreator createDerivedBeanCreator()
          Creates a ChainedBeanCreator that constructs derived beans.
static ChainedBeanCreator createElementTypeBeanCreator()
          Creates a ChainedBeanCreator that constructs beans based on element type.
static ChainedBeanCreator createIDREFBeanCreator()
          Creates a ChainedBeanCreator that finds existing beans based on their IDREF.
private static java.lang.Object newInstance(java.lang.Class theClass, org.apache.commons.logging.Log log)
          Constructs a new instance of the given class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_CLASS_ARRAY

private static final java.lang.Class[] EMPTY_CLASS_ARRAY

EMPTY_OBJECT_ARRAY

private static final java.lang.Object[] EMPTY_OBJECT_ARRAY

derivedBeanCreator

private static final ChainedBeanCreator derivedBeanCreator
Singleton instance for creating derived beans


elementTypeBeanCreator

private static final ChainedBeanCreator elementTypeBeanCreator
Singleton instance that creates beans based on type


idRefBeanCreator

private static final ChainedBeanCreator idRefBeanCreator
Singleton instance that creates beans based on IDREF

Constructor Detail

ChainedBeanCreatorFactory

public ChainedBeanCreatorFactory()
Method Detail

createDerivedBeanCreator

public static final ChainedBeanCreator createDerivedBeanCreator()
Creates a ChainedBeanCreator that constructs derived beans. These have their classname set by an xml attribute.

Returns:
ChainedBeanCreator that implements Derived beans logic, not null

newInstance

private static final java.lang.Object newInstance(java.lang.Class theClass,
                                                  org.apache.commons.logging.Log log)
                                           throws java.lang.Exception
Constructs a new instance of the given class. Access is forced.

Parameters:
theClass - Class, not null
log - Log, not null
Returns:
Object, an instance of the given class
Throws:
java.lang.Exception

createElementTypeBeanCreator

public static final ChainedBeanCreator createElementTypeBeanCreator()
Creates a ChainedBeanCreator that constructs beans based on element type.

Returns:
ChainedBeanCreator that implements load by type beans logic, not null

createIDREFBeanCreator

public static final ChainedBeanCreator createIDREFBeanCreator()
Creates a ChainedBeanCreator that finds existing beans based on their IDREF.

Returns:
ChainedBeanCreator that implements IDREF beans logic, not null