|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.beans.FeatureDescriptor org.openide.nodes.Node.Property org.openide.nodes.PropertySupport.Reflection
Support for properties from Java Reflection.
Field Summary | |
protected Object |
instance
Instance of a bean. |
Constructor Summary | |
PropertySupport.Reflection(Object instance,
Class valueType,
Method getter,
Method setter)
Create a support with method objects specified. |
|
PropertySupport.Reflection(Object instance,
Class valueType,
String property)
Create a support based on the property name. |
|
PropertySupport.Reflection(Object instance,
Class valueType,
String getter,
String setter)
Create a support with methods specified by name. |
Method Summary | |
boolean |
canRead()
Test whether the property is readable. |
boolean |
canWrite()
Test whether the property is writable. |
PropertyEditor |
getPropertyEditor()
Get a property editor for this property. |
Object |
getValue()
Get the value. |
void |
setPropertyEditorClass(Class clazz)
Set the property editor explicitly. |
void |
setValue(Object val)
Set the value. |
Methods inherited from class org.openide.nodes.Node.Property |
equals, getHtmlDisplayName, getValueType, hashCode, isDefaultValue, restoreDefaultValue, supportsDefaultValue |
Methods inherited from class java.beans.FeatureDescriptor |
attributeNames, getDisplayName, getName, getShortDescription, getValue, isExpert, isHidden, isPreferred, setDisplayName, setExpert, setHidden, setName, setPreferred, setShortDescription, setValue |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Object instance
Constructor Detail |
public PropertySupport.Reflection(Object instance, Class valueType, Method getter, Method setter)
instance
- (Bean) object to work onvalueType
- type of the propertygetter
- getter method, can be null
setter
- setter method, can be null
IllegalArgumentException
- if the methods are not publicpublic PropertySupport.Reflection(Object instance, Class valueType, String getter, String setter) throws NoSuchMethodException
instance
- (Bean) object to work onvalueType
- type of the propertygetter
- name of getter method, can be null
setter
- name of setter method, can be null
NoSuchMethodException
- if the getter or setter methods cannot be foundpublic PropertySupport.Reflection(Object instance, Class valueType, String property) throws NoSuchMethodException
get
and
set
, respectively.
instance
- object to work onvalueType
- type of the propertyproperty
- name of property
NoSuchMethodException
- if the getter or setter methods cannot be foundMethod Detail |
public boolean canRead()
Node.Property
canRead
in class Node.Property
true
if it ispublic Object getValue() throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
Node.Property
getValue
in class Node.Property
IllegalAccessException
- cannot access the called method
InvocationTargetException
- an exception during invocation
IllegalArgumentException
public boolean canWrite()
Node.Property
canWrite
in class Node.Property
true
if the read of the value is supportedpublic void setValue(Object val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
Node.Property
setValue
in class Node.Property
val
- the new value of the property
InvocationTargetException
- an exception during invocation
IllegalAccessException
- cannot access the called method
IllegalArgumentException
- wrong argumentpublic PropertyEditor getPropertyEditor()
Node.Property
PropertyEditorManager
.
getPropertyEditor
in class Node.Property
null
if there is no editorpublic void setPropertyEditorClass(Class clazz)
clazz
- class type of the property editor
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |