public class DatasourceValueSource<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 boolean |
dataModelSecurityEnabled |
protected Datasource<E> |
datasource |
protected EventHub |
events |
protected MetaPropertyPath |
metaPropertyPath |
protected java.lang.String |
property |
protected BindingState |
state |
| Constructor and Description |
|---|
DatasourceValueSource(Datasource<E> datasource,
java.lang.String property) |
protected final Datasource<E extends Entity> datasource
protected MetaPropertyPath metaPropertyPath
protected java.lang.String property
protected BindingState state
protected EventHub events
protected boolean dataModelSecurityEnabled
public DatasourceValueSource(Datasource<E> datasource, java.lang.String property)
public void setDataModelSecurityEnabled(boolean enabled)
enabled - enabled flagpublic void setBeanLocator(BeanLocator beanLocator)
setBeanLocator in interface BeanLocatorAwarepublic void setState(BindingState state)
public Datasource getDatasource()
public MetaClass getEntityMetaClass()
getEntityMetaClass in interface EntityDataUnitMetaClass 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(java.lang.Object 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 boolean isModified()
public void setModified(boolean modified)
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)
DataUnitaddStateChangeListener in interface DataUnitlistener - the listener to be addedpublic Subscription addValueChangeListener(java.util.function.Consumer<ValueSource.ValueChangeEvent<V>> listener)
ValueSourceaddValueChangeListener in interface ValueSource<V>listener - the listener to be addedprotected void datasourceItemChanged(Datasource.ItemChangeEvent e)
protected void datasourceStateChanged(Datasource.StateChangeEvent<E> e)
protected void datasourceItemPropertyChanged(Datasource.ItemPropertyChangeEvent e)