public class BeanCreationList extends BeanCreationChain
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.
Constructor and Description |
---|
BeanCreationList() |
Modifier and Type | Method and Description |
---|---|
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.
|
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. |
createDefaultChain
public static final BeanCreationList createStandardChain()
BeanCreationChain
used when reading beans.BeanCreationList
with the default creators loader in order, not nullpublic Object create(ElementMapping elementMapping, ReadContext readContext)
create
in class BeanCreationChain
elementMapping
- the element mapping detailsreadContext
- create against this contextpublic int getSize()
ChainedBeanCreator
's in the current chainpublic void insertBeanCreator(int index, ChainedBeanCreator beanCreator) throws IndexOutOfBoundsException
BeanCreator
at the given position in the chain.
Shifts the object currently in that position - and any subsequent elements -
to the right.index
- index at which the creator should be insertedbeanCreator
- the BeanCreator
to be inserted, not nullIndexOutOfBoundsException
- if the index is out of the range
(index < 0 || index > getSize())
public void addBeanCreator(ChainedBeanCreator beanCreator)
BeanCreator
to the end of the chain.beanCreator
- the BeanCreator
to be inserted, not nullpublic void clearBeanCreators()
Copyright © 2002-2013 Apache Software Foundation. All Rights Reserved.