public class ContainerValueSource<E extends Entity,V> extends java.lang.Object implements EntityValueSource<E,V>, BeanLocatorAware
EntityValueSource.InstanceChangeEvent<E extends Entity>
ValueSource.ValueChangeEvent<V>
DataUnit.StateChangeEvent
Modifier and Type | Field and Description |
---|---|
protected InstanceContainer<E> |
container |
protected boolean |
dataModelSecurityEnabled |
protected EventHub |
events |
protected MetaPropertyPath |
metaPropertyPath |
protected java.lang.String |
property |
protected BindingState |
state |
Constructor and Description |
---|
ContainerValueSource(InstanceContainer<E> container,
java.lang.String property) |
protected final InstanceContainer<E extends Entity> container
protected MetaPropertyPath metaPropertyPath
protected java.lang.String property
protected BindingState state
protected EventHub events
protected boolean dataModelSecurityEnabled
public ContainerValueSource(InstanceContainer<E> container, java.lang.String property)
public void setDataModelSecurityEnabled(boolean enabled)
enabled
- enabled flagpublic void setBeanLocator(BeanLocator beanLocator)
setBeanLocator
in interface BeanLocatorAware
public MetaClass getEntityMetaClass()
getEntityMetaClass
in interface EntityDataUnit
MetaClass
of an entity contained in the sourcepublic MetaPropertyPath getMetaPropertyPath()
getMetaPropertyPath
in interface EntityValueSource<E extends Entity,V>
public E getItem()
getItem
in interface EntityValueSource<E extends Entity,V>
public boolean isDataModelSecurityEnabled()
isDataModelSecurityEnabled
in interface EntityValueSource<E extends Entity,V>
public V getValue()
getValue
in interface ValueSource<V>
public void setValue(V value)
setValue
in interface ValueSource<V>
public boolean isReadOnly()
isReadOnly
in interface ValueSource<V>
public java.lang.Class<V> getType()
getType
in interface ValueSource<V>
public BindingState getState()
public Subscription addInstanceChangeListener(java.util.function.Consumer<EntityValueSource.InstanceChangeEvent<E>> listener)
addInstanceChangeListener
in interface EntityValueSource<E extends Entity,V>
public Subscription addStateChangeListener(java.util.function.Consumer<DataUnit.StateChangeEvent> listener)
DataUnit
addStateChangeListener
in interface DataUnit
listener
- the listener to be addedpublic Subscription addValueChangeListener(java.util.function.Consumer<ValueSource.ValueChangeEvent<V>> listener)
ValueSource
addValueChangeListener
in interface ValueSource<V>
listener
- the listener to be addedprotected void setState(BindingState state)
protected void containerItemChanged(InstanceContainer.ItemChangeEvent e)
protected void containerItemPropertyChanged(InstanceContainer.ItemPropertyChangeEvent e)
protected boolean canUpdateMasterRefs()
protected void updateMasterRefs(V value)
@Nullable protected java.util.Collection<? extends V> copyPropertyCollection(java.util.Collection<? extends V> propertyValue)
@Nullable protected DataContext getDataContext()
@Nullable protected MetaProperty getInverseProperty()
public InstanceContainer<E> getContainer()