public static class PropertySupport.Reflection<T> extends Node.Property<T>
FeatureDescriptor.getName() will be set automatically.| Modifier and Type | Field and Description |
|---|---|
protected Object |
instance
Instance of a bean.
|
| Constructor and Description |
|---|
Reflection(Object instance,
Class<T> valueType,
Method getter,
Method setter)
Create a support with method objects specified.
|
Reflection(Object instance,
Class<T> valueType,
String property)
Create a support based on the property name.
|
Reflection(Object instance,
Class<T> valueType,
String getter,
String setter)
Create a support with methods specified by name.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
T |
getValue()
Get the value.
|
void |
setPropertyEditorClass(Class<? extends PropertyEditor> clazz)
Set the property editor explicitly.
|
void |
setValue(T val)
Set the value.
|
equals, getHtmlDisplayName, getValueType, hashCode, isDefaultValue, restoreDefaultValue, supportsDefaultValueattributeNames, getDisplayName, getName, getShortDescription, getValue, isExpert, isHidden, isPreferred, setDisplayName, setExpert, setHidden, setName, setPreferred, setShortDescription, setValue, toStringprotected Object instance
public Reflection(Object instance, Class<T> valueType, Method getter, Method setter)
instance - (Bean) object to work onvalueType - type of the propertygetter - getter method, can be nullsetter - setter method, can be nullIllegalArgumentException - if the methods are not publicpublic Reflection(Object instance, Class<T> valueType, String getter, String setter) throws NoSuchMethodException
instance - (Bean) object to work onvalueType - type of the propertygetter - name of getter method, can be nullsetter - name of setter method, can be nullNoSuchMethodException - if the getter or setter methods cannot be foundpublic Reflection(Object instance, Class<T> valueType, String property) throws NoSuchMethodException
get and
set, respectively.instance - object to work onvalueType - type of the propertyproperty - name of propertyNoSuchMethodException - if the getter or setter methods cannot be foundpublic boolean canRead()
Node.PropertycanRead in class Node.Property<T>true if it ispublic T getValue() throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
Node.PropertygetValue in class Node.Property<T>IllegalAccessException - cannot access the called methodInvocationTargetException - an exception during invocationIllegalArgumentExceptionpublic boolean canWrite()
Node.PropertycanWrite in class Node.Property<T>true if the read of the value is supportedpublic void setValue(T val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
Node.PropertysetValue in class Node.Property<T>val - the new value of the propertyIllegalAccessException - cannot access the called methodIllegalArgumentException - wrong argumentInvocationTargetException - an exception during invocationpublic PropertyEditor getPropertyEditor()
Node.PropertyPropertyEditorManager.getPropertyEditor in class Node.Property<T>null if there is no editorpublic void setPropertyEditorClass(Class<? extends PropertyEditor> clazz)
clazz - class type of the property editorBuilt on August 24 2014. | Portions Copyright 1997-2014 Sun Microsystems, Inc. All rights reserved.