public class

BeanCreationList

extends BeanCreationChain
java.lang.Object
   ↳ org.apache.commons.betwixt.io.read.BeanCreationChain
     ↳ org.apache.commons.betwixt.io.read.BeanCreationList

Class Overview

Chain implementation that's backed by a list. This is the default implementation used by Betwixt.

Note this implementation is not intended to allow multiple threads of execution to perform modification operations concurrently with traversal of the chain. Users who require this behaviour are advised to create their own implementation.

Summary

Public Constructors
BeanCreationList()
Public Methods
void addBeanCreator(ChainedBeanCreator beanCreator)
Adds a BeanCreator to the end of the chain.
void clearBeanCreators()
Clears the creator chain.
Object create(ElementMapping elementMapping, ReadContext readContext)
Creates an Object based on the given element mapping and read context.
final static BeanCreationList createStandardChain()
Creates the default BeanCreationChain used when reading beans.
int getSize()
Gets the number of BeanCreators in the wrapped chain.
void insertBeanCreator(int index, ChainedBeanCreator beanCreator)
Inserts a BeanCreator at the given position in the chain.
[Expand]
Inherited Methods
From class org.apache.commons.betwixt.io.read.BeanCreationChain
From class java.lang.Object

Public Constructors

public BeanCreationList ()

Public Methods

public void addBeanCreator (ChainedBeanCreator beanCreator)

Adds a BeanCreator to the end of the chain.

Parameters
beanCreator the BeanCreator to be inserted, not null

public void clearBeanCreators ()

Clears the creator chain.

public Object create (ElementMapping elementMapping, ReadContext readContext)

Creates an Object based on the given element mapping and read context. Delegates to chain.

Parameters
elementMapping the element mapping details
readContext create against this context
Returns
  • the created bean, possibly null

public static final BeanCreationList createStandardChain ()

Creates the default BeanCreationChain used when reading beans.

Returns
  • a BeanCreationList with the default creators loader in order, not null

public int getSize ()

Gets the number of BeanCreators in the wrapped chain.

Returns
  • the number of ChainedBeanCreator's in the current chain

public void insertBeanCreator (int index, ChainedBeanCreator beanCreator)

Inserts a BeanCreator at the given position in the chain. Shifts the object currently in that position - and any subsequent elements - to the right.

Parameters
index index at which the creator should be inserted
beanCreator the BeanCreator to be inserted, not null
Throws
IndexOutOfBoundsException if the index is out of the range (index < 0 || index > getSize())