An in-memory container for JavaBeans.
The properties of the container are determined automatically by introspecting
the used JavaBean class. Only beans of the same type can be added to the
container.
In BeanContainer (unlike
BeanItemContainer), the item IDs do not have
to be the beans themselves. The container can be used either with explicit
item IDs or the item IDs can be generated when adding beans.
To use explicit item IDs, use the methods
#addItem(Object,Object),
#addItemAfter(Object,Object,Object) and
#addItemAt(int,Object,Object).
If a bean id resolver is set using
#setBeanIdResolver(AbstractBeanContainer.BeanIdResolver) or
#setBeanIdProperty(Object), the methods
#addBean(Object),
#addBeanAfter(Object,Object),
#addBeanAt(int,Object) and
#addAll(java.util.Collection) can be used to add items to the
container. If one of these methods is called, the resolver is used to
generate an identifier for the item (must not return null).
Note that explicit item identifiers can also be used when a resolver has been
set by calling the addItem*() methods - the resolver is only used when adding
beans using the addBean*() or
#addAll(Collection) methods.
It is not possible to add additional properties to the container.