Class ConstrainedArbitraryBean
- java.lang.Object
-
- jmri.beans.UnboundBean
-
- jmri.beans.Bean
-
- jmri.beans.ConstrainedBean
-
- jmri.beans.ConstrainedArbitraryBean
-
- All Implemented Interfaces:
BeanInterface
,PropertyChangeFirer
,PropertyChangeProvider
,VetoableChangeProvider
public class ConstrainedArbitraryBean extends ConstrainedBean
A Bean with support forVetoableChangeListener
s.
-
-
Field Summary
Fields Modifier and Type Field Description protected ArbitraryPropertySupport
arbitraryPropertySupport
-
Fields inherited from class jmri.beans.ConstrainedBean
vetoableChangeSupport
-
Fields inherited from class jmri.beans.Bean
propertyChangeSupport
-
-
Constructor Summary
Constructors Constructor Description ConstrainedArbitraryBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getIndexedProperty(java.lang.String key, int index)
Get value of element at index of property array key.java.lang.Object
getProperty(java.lang.String key)
Get the value of property key.java.util.Set<java.lang.String>
getPropertyNames()
Return a list of property names.boolean
hasIndexedProperty(java.lang.String key)
Test that a property exists and is indexed.boolean
hasProperty(java.lang.String key)
Test if a property exists.void
setIndexedProperty(java.lang.String key, int index, java.lang.Object value)
Set element at index of property array key to value.void
setProperty(java.lang.String key, java.lang.Object value)
Set property key to value.-
Methods inherited from class jmri.beans.ConstrainedBean
addVetoableChangeListener, addVetoableChangeListener, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getIndexedPropertyOrNull, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
-
Methods inherited from class jmri.beans.Bean
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, isNotifyOnEDT, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Field Detail
-
arbitraryPropertySupport
protected final ArbitraryPropertySupport arbitraryPropertySupport
-
-
Constructor Detail
-
ConstrainedArbitraryBean
public ConstrainedArbitraryBean()
-
-
Method Detail
-
setProperty
public void setProperty(java.lang.String key, java.lang.Object value)
Description copied from class:UnboundBean
Set property key to value.This implementation calls a write method for the property using JavaBeans introspection.
- Specified by:
setProperty
in interfaceBeanInterface
- Overrides:
setProperty
in classConstrainedBean
- Parameters:
key
- name of the propertyvalue
- the value to set the property to- See Also:
BeanInterface.setProperty(java.lang.String, java.lang.Object)
-
setIndexedProperty
public void setIndexedProperty(java.lang.String key, int index, java.lang.Object value)
Description copied from class:UnboundBean
Set element at index of property array key to value.This implementation calls a write method for the indexed property using JavaBeans introspection, and assumes, based on JavaBeans coding patterns, that the write method has the following two parameters in order:
index
,value
.- Specified by:
setIndexedProperty
in interfaceBeanInterface
- Overrides:
setIndexedProperty
in classConstrainedBean
- Parameters:
key
- name of the propertyindex
- index of the property element to changevalue
- the value to set the property to- See Also:
BeanInterface.setIndexedProperty(java.lang.String, int, java.lang.Object)
-
getIndexedProperty
public java.lang.Object getIndexedProperty(java.lang.String key, int index)
Description copied from class:UnboundBean
Get value of element at index of property array key.This implementation calls a read method for the indexed property using JavaBeans introspection, and assumes, based on JavaBeans coding patterns, that the read method has the following parameter:
index
. Note that this method returns null instead of throwingArrayIndexOutOfBoundsException
if the index is invalid since the Java introspection methods provide no reliable way to get the size of the indexed property.- Specified by:
getIndexedProperty
in interfaceBeanInterface
- Overrides:
getIndexedProperty
in classUnboundBean
- Parameters:
key
- name of the propertyindex
- index of the property element to change- Returns:
- value of element or null
-
getProperty
public java.lang.Object getProperty(java.lang.String key)
Description copied from class:UnboundBean
Get the value of property key.If null is a valid (or expected) value for key, you might want to use
UnboundBean.hasProperty(java.lang.String)
to test that the property exists.- Specified by:
getProperty
in interfaceBeanInterface
- Overrides:
getProperty
in classUnboundBean
- Parameters:
key
- name of the property- Returns:
- value of key or null.
- See Also:
BeanInterface.getProperty(java.lang.String)
-
hasProperty
public boolean hasProperty(java.lang.String key)
Description copied from class:UnboundBean
Test if a property exists.- Specified by:
hasProperty
in interfaceBeanInterface
- Overrides:
hasProperty
in classUnboundBean
- Parameters:
key
- name of the property- Returns:
- true if property exists
- See Also:
BeanInterface.hasProperty(java.lang.String)
-
hasIndexedProperty
public boolean hasIndexedProperty(java.lang.String key)
Description copied from interface:BeanInterface
Test that a property exists and is indexed.NOTE Implementing method must not call
Bean.hasIndexedProperty()
, as doing so will cause a stack overflow. Implementing methods may callBeans.hasIntrospectedIndexedProperty()
instead.- Specified by:
hasIndexedProperty
in interfaceBeanInterface
- Overrides:
hasIndexedProperty
in classUnboundBean
- Parameters:
key
- name of the property- Returns:
- true is property key exists and is indexed
-
getPropertyNames
public java.util.Set<java.lang.String> getPropertyNames()
Description copied from class:UnboundBean
Return a list of property names.- Specified by:
getPropertyNames
in interfaceBeanInterface
- Overrides:
getPropertyNames
in classUnboundBean
- Returns:
- a Set of names
- See Also:
BeanInterface.getPropertyNames()
-
-