public class DynamicAttributesEntity extends java.lang.Object implements Entity
Instance.PropertyChangeEvent, Instance.PropertyChangeListener| Constructor and Description |
|---|
DynamicAttributesEntity(BaseGenericIdEntity mainItem,
java.util.Collection<CategoryAttribute> attributes) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(ValueListener listener)
Add listener to track attributes changes.
|
void |
addPropertyChangeListener(Instance.PropertyChangeListener listener)
Add listener to track attributes changes.
|
java.util.UUID |
getId() |
java.lang.String |
getInstanceName() |
MetaClass |
getMetaClass() |
<T> T |
getValue(java.lang.String name)
Get an attribute value.
|
<T> T |
getValueEx(java.lang.String propertyPath)
Get an attribute value.
|
void |
removeAllListeners()
Remove all
Instance.PropertyChangeListeners. |
void |
removeListener(ValueListener listener)
Remove listener.
|
void |
removePropertyChangeListener(Instance.PropertyChangeListener listener)
Remove listener.
|
void |
setValue(java.lang.String name,
java.lang.Object value)
Set an attribute value.
|
void |
setValueEx(java.lang.String propertyPath,
java.lang.Object value)
Set an attribute value.
|
public DynamicAttributesEntity(BaseGenericIdEntity mainItem, java.util.Collection<CategoryAttribute> attributes)
public MetaClass getMetaClass()
getMetaClass in interface Instancepublic java.lang.String getInstanceName()
getInstanceName in interface InstanceNamePattern
or toString().public void addListener(ValueListener listener)
InstanceaddListener in interface Instancelistener - listenerpublic void removeListener(ValueListener listener)
InstanceremoveListener in interface Instancelistener - listener to removepublic void addPropertyChangeListener(Instance.PropertyChangeListener listener)
InstanceaddPropertyChangeListener in interface Instancelistener - listenerpublic void removePropertyChangeListener(Instance.PropertyChangeListener listener)
InstanceremovePropertyChangeListener in interface Instancelistener - listener to removepublic void removeAllListeners()
InstanceInstance.PropertyChangeListeners.removeAllListeners in interface Instancepublic <T> T getValue(java.lang.String name)
Instancepublic void setValue(java.lang.String name,
java.lang.Object value)
InstanceInstance.PropertyChangeListeners only if the attribute
was actually changed.public <T> T getValueEx(java.lang.String propertyPath)
Instancecar.driver.name.getValueEx in interface InstancepropertyPath - path to an attributeInstance, this method
stops here and returns this value.public void setValueEx(java.lang.String propertyPath,
java.lang.Object value)
Instancecar.driver.name.
car.driver attribute, and if it is not
null and is an Instance, sets value of name attribute in it. If the value returned from
getValueEx("car.driver") is null or is not an Instance, this method throws
IllegalStateException.
Instance.PropertyChangeListeners only if the attribute
was actually changed.setValueEx in interface InstancepropertyPath - path to an attributevalue - attribute value