|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.beans.UnboundBean
public abstract class UnboundBean
| Field Summary | |
|---|---|
protected HashMap<String,Object> |
properties
Store properties in a hashMap for easy access. |
| Constructor Summary | |
|---|---|
UnboundBean()
|
|
| Method Summary | |
|---|---|
Object |
getIndexedProperty(String key,
int index)
Get value of element at index of property array key. |
Object |
getProperty(String key)
Get the value of property key. |
Set<String> |
getPropertyNames()
Return a list of property names. |
boolean |
hasProperty(String key)
Test if a property exists. |
void |
setIndexedProperty(String key,
int index,
Object value)
Set element at index of property array key to value. |
void |
setProperty(String key,
Object value)
Set property key to value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final HashMap<String,Object> properties
Note that unless you use the methods in this class to manipulate this variable, you will need to instantiate it, or test that it is not null prior to use.
| Constructor Detail |
|---|
public UnboundBean()
| Method Detail |
|---|
public Object getIndexedProperty(String key,
int index)
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.
getIndexedProperty in interface BeanInterfacekey - index -
public Object getProperty(String key)
If null is a valid (or expected) value for key, you might
want to use hasProperty(java.lang.String) to test that the
property exists.
This implementation searches properties and uses
introspection to get the property.
getProperty in interface BeanInterfacekey -
BeanInterface.getProperty(java.lang.String)public Set<String> getPropertyNames()
This implementation combines the keys in properties with
the results of Beans.getIntrospectedPropertyNames(java.lang.Object).
getPropertyNames in interface BeanInterfaceBeanInterface.getPropertyNames()public boolean hasProperty(String key)
This implementation searches properties and uses
introspection to get the property.
hasProperty in interface BeanInterfacekey -
BeanInterface.hasProperty(java.lang.String)
public void setIndexedProperty(String key,
int index,
Object 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.
setIndexedProperty in interface BeanInterfacekey - index - value - BeanInterface.setIndexedProperty(java.lang.String, int, java.lang.Object)
public void setProperty(String key,
Object value)
This implementation checks that a write method is not available for the
property using JavaBeans introspection, and stores the property in
properties only if a write method does not exist. This
implementation also fires a PropertyChangeEvent for the property.
setProperty in interface BeanInterfacekey - value - BeanInterface.setProperty(java.lang.String, java.lang.Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||