public abstract class AbstractInstance extends java.lang.Object implements Instance
Instance.BeanPropertyPath, Instance.PropertyChangeEvent, Instance.PropertyChangeListener
Modifier and Type | Field and Description |
---|---|
protected java.util.Collection<java.lang.ref.WeakReference<Instance.PropertyChangeListener>> |
__propertyChangeListeners |
protected static int |
PROPERTY_CHANGE_LISTENERS_INITIAL_CAPACITY |
Constructor and Description |
---|
AbstractInstance() |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(Instance.PropertyChangeListener listener)
Add listener to track attributes changes.
|
java.lang.String |
getInstanceName()
Deprecated.
|
protected MethodsCache |
getMethodsCache() |
protected RelatedPropertiesCache |
getRelatedPropertiesCache() |
protected java.util.Collection<java.lang.String> |
getRelatedReadOnlyProperties(java.lang.String propertyName) |
<T> T |
getValue(java.lang.String name)
Get an attribute value.
|
<T> T |
getValueEx(Instance.BeanPropertyPath propertyPath)
Get an attribute value.
|
<T> T |
getValueEx(java.lang.String name)
Get an attribute value.
|
protected void |
propertyChanged(java.lang.String s,
java.lang.Object prev,
java.lang.Object curr) |
void |
removeAllListeners()
Remove all
Instance.PropertyChangeListener s. |
void |
removePropertyChangeListener(Instance.PropertyChangeListener listener)
Remove listener.
|
void |
setValue(java.lang.String name,
java.lang.Object value)
Set an attribute value.
|
void |
setValue(java.lang.String name,
java.lang.Object value,
boolean checkEquals)
Set value to property in instance
For internal use only.
|
void |
setValueEx(Instance.BeanPropertyPath propertyPath,
java.lang.Object value)
Set an attribute value.
|
void |
setValueEx(java.lang.String name,
java.lang.Object value)
Set an attribute value.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMetaClass
protected static final int PROPERTY_CHANGE_LISTENERS_INITIAL_CAPACITY
protected transient java.util.Collection<java.lang.ref.WeakReference<Instance.PropertyChangeListener>> __propertyChangeListeners
protected void propertyChanged(java.lang.String s, java.lang.Object prev, java.lang.Object curr)
@Deprecated public java.lang.String getInstanceName()
MetadataTools.getInstanceName(com.haulmont.chile.core.model.Instance)
instead.getInstanceName
in interface Instance
NamePattern
or toString()
.public void addPropertyChangeListener(Instance.PropertyChangeListener listener)
Instance
addPropertyChangeListener
in interface Instance
listener
- listenerpublic void removePropertyChangeListener(Instance.PropertyChangeListener listener)
Instance
removePropertyChangeListener
in interface Instance
listener
- listener to removepublic void removeAllListeners()
Instance
Instance.PropertyChangeListener
s.removeAllListeners
in interface Instance
public <T> T getValue(java.lang.String name)
Instance
protected MethodsCache getMethodsCache()
protected java.util.Collection<java.lang.String> getRelatedReadOnlyProperties(java.lang.String propertyName)
protected RelatedPropertiesCache getRelatedPropertiesCache()
public void setValue(java.lang.String name, @Nullable java.lang.Object value)
Instance
Instance.PropertyChangeListener
s only if the attribute
was actually changed.public void setValue(java.lang.String name, java.lang.Object value, boolean checkEquals)
setValue(String, Object)
name
- property namevalue
- valuecheckEquals
- check equals for previous and new value.
If flag is true and objects equals, then setter will not be invokedpublic <T> T getValueEx(java.lang.String name)
Instance
car.driver.name
.getValueEx
in interface Instance
name
- path to an attributeInstance
, this method
stops here and returns this value.@Nullable public <T> T getValueEx(Instance.BeanPropertyPath propertyPath)
Instance
car.driver.name
.getValueEx
in interface Instance
propertyPath
- path to an attributeInstance
, this method
stops here and returns this value.public void setValueEx(java.lang.String name, java.lang.Object value)
Instance
car.driver.name
.
car.driver
attribute, and if it is not
null and is an Instance
, sets value of name
attribute in it.
Instance.PropertyChangeListener
s only if the attribute
was actually changed.setValueEx
in interface Instance
name
- path to an attributevalue
- attribute valuepublic void setValueEx(Instance.BeanPropertyPath propertyPath, java.lang.Object value)
Instance
car.driver.name
.
car.driver
attribute, and if it is not
null and is an Instance
, sets value of name
attribute in it.
Instance.PropertyChangeListener
s only if the attribute
was actually changed.setValueEx
in interface Instance
propertyPath
- path to an attributevalue
- attribute value