Class ArbitraryBean
- All Implemented Interfaces:
BeanInterface,PropertyChangeFirer,PropertyChangeProvider
- Direct Known Subclasses:
RosterEntry
BeanInterface with a complete
implementation of PropertyChangeSupport and support for
arbitrary properties defined at runtime.
See the PropertyChangeSupport documentation for complete documentation of those methods.
- See Also:
-
Field Summary
FieldsFields inherited from class jmri.beans.Bean
propertyChangeSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetIndexedProperty(String key, int index) Get value of element at index of property array key.getProperty(String key) Get the value of property key.Return a list of property names.booleanhasIndexedProperty(String key) Test that a property exists and is indexed.booleanhasProperty(String key) Test if a property exists.voidsetIndexedProperty(String key, int index, Object value) Set element at index of property array key to value.voidsetProperty(String key, Object value) Set property key to value.Methods inherited from class jmri.beans.Bean
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, isNotifyOnEDT, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
arbitraryPropertySupport
-
-
Constructor Details
-
ArbitraryBean
public ArbitraryBean()
-
-
Method Details
-
setProperty
Description copied from class:UnboundBeanSet property key to value.This implementation calls a write method for the property using JavaBeans introspection.
- Specified by:
setPropertyin interfaceBeanInterface- Overrides:
setPropertyin classUnboundBean- Parameters:
key- name of the propertyvalue- the value to set the property to- See Also:
-
setIndexedProperty
Description copied from class:UnboundBeanSet 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:
setIndexedPropertyin interfaceBeanInterface- Overrides:
setIndexedPropertyin classUnboundBean- Parameters:
key- name of the propertyindex- index of the property element to changevalue- the value to set the property to- See Also:
-
getIndexedProperty
Description copied from class:UnboundBeanGet 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 throwingArrayIndexOutOfBoundsExceptionif the index is invalid since the Java introspection methods provide no reliable way to get the size of the indexed property.- Specified by:
getIndexedPropertyin interfaceBeanInterface- Overrides:
getIndexedPropertyin classUnboundBean- Parameters:
key- name of the propertyindex- index of the property element to change- Returns:
- value of element or null
-
getProperty
Description copied from class:UnboundBeanGet 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:
getPropertyin interfaceBeanInterface- Overrides:
getPropertyin classUnboundBean- Parameters:
key- name of the property- Returns:
- value of key or null.
- See Also:
-
hasProperty
Description copied from class:UnboundBeanTest if a property exists.- Specified by:
hasPropertyin interfaceBeanInterface- Overrides:
hasPropertyin classUnboundBean- Parameters:
key- name of the property- Returns:
- true if property exists
- See Also:
-
hasIndexedProperty
Description copied from interface:BeanInterfaceTest 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:
hasIndexedPropertyin interfaceBeanInterface- Overrides:
hasIndexedPropertyin classUnboundBean- Parameters:
key- name of the property- Returns:
- true is property key exists and is indexed
-
getPropertyNames
Description copied from class:UnboundBeanReturn a list of property names.- Specified by:
getPropertyNamesin interfaceBeanInterface- Overrides:
getPropertyNamesin classUnboundBean- Returns:
- a Set of names
- See Also:
-