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.
BeanItemContainer uses the beans themselves as identifiers. The {@link Object#hashCode()} of a bean is used when storing and looking up beansso it must not change during the lifetime of the bean (it should not depend on any part of the bean that can be modified). Typically this restricts the implementation of {@link Object#equals(Object)} as well in order for it tofulfill the contract between {@code equals()} and {@code hashCode()}.
To add items to the container, use the methods {@link #addBean(Object)}, {@link #addBeanAfter(Object,Object)} and {@link #addBeanAt(int,Object)}. Also {@link #addItem(Object)}, {@link #addItemAfter(Object,Object)} and{@link #addItemAt(int,Object)} can be used as synonyms for them.
It is not possible to add additional properties to the container.
@param < BEANTYPE> The type of the Bean @since 5.4
|
|
|
|