org.openide.nodes
Class PropertySupport.Reflection
java.lang.Object
|
+--java.beans.FeatureDescriptor
|
+--org.openide.nodes.Node.Property
|
+--org.openide.nodes.PropertySupport.Reflection
- Enclosing class:
- PropertySupport
- public static class PropertySupport.Reflection
- extends Node.Property
Support for properties from Java Reflection.
Methods inherited from class java.beans.FeatureDescriptor |
attributeNames, getDisplayName, getName, getShortDescription, getValue, isExpert, isHidden, isPreferred, setDisplayName, setExpert, setHidden, setName, setPreferred, setShortDescription, setValue |
instance
protected Object instance
- Instance of a bean.
PropertySupport.Reflection
public PropertySupport.Reflection(Object instance,
Class valueType,
Method getter,
Method setter)
- Create a support with method objects specified.
The methods must be public.
- Parameters:
instance
- (Bean) object to work onvalueType
- type of the propertygetter
- getter method, can be null
setter
- setter method, can be null
- Throws:
IllegalArgumentException
- if the methods are not public
PropertySupport.Reflection
public PropertySupport.Reflection(Object instance,
Class valueType,
String getter,
String setter)
throws NoSuchMethodException
- Create a support with methods specified by name.
The instance class will be examined for the named methods.
But if the instance class is not public, the nearest public superclass
will be used instead, so that the getters and setters remain accessible.
- Parameters:
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
- Throws:
NoSuchMethodException
- if the getter or setter methods cannot be found
PropertySupport.Reflection
public PropertySupport.Reflection(Object instance,
Class valueType,
String property)
throws NoSuchMethodException
- Create a support based on the property name.
The getter and setter methods are constructed by capitalizing the first
letter in the name of propety and prefixing it with
get
and
set
, respectively.
- Parameters:
instance
- object to work onvalueType
- type of the propertyproperty
- name of property- Throws:
NoSuchMethodException
- if the getter or setter methods cannot be found
canRead
public boolean canRead()
- Description copied from class:
Node.Property
- Test whether the property is readable.
- Overrides:
canRead
in class Node.Property
- Following copied from class:
org.openide.nodes.Node.Property
- Returns:
true
if it is
getValue
public Object getValue()
throws IllegalAccessException,
IllegalArgumentException,
InvocationTargetException
- Description copied from class:
Node.Property
- Get the value.
- Overrides:
getValue
in class Node.Property
- Following copied from class:
org.openide.nodes.Node.Property
- Returns:
- the value of the property
- Throws:
IllegalAccessException
- cannot access the called methodInvocationTargetException
- an exception during invocation
canWrite
public boolean canWrite()
- Description copied from class:
Node.Property
- Test whether the property is writable.
- Overrides:
canWrite
in class Node.Property
- Following copied from class:
org.openide.nodes.Node.Property
- Returns:
true
if the read of the value is supported
setValue
public void setValue(Object val)
throws IllegalAccessException,
IllegalArgumentException,
InvocationTargetException
- Description copied from class:
Node.Property
- Set the value.
- Overrides:
setValue
in class Node.Property
- Following copied from class:
org.openide.nodes.Node.Property
- Parameters:
val
- the new value of the property- Throws:
IllegalAccessException
- cannot access the called methodIllegalArgumentException
- wrong argumentInvocationTargetException
- an exception during invocation
getPropertyEditor
public PropertyEditor getPropertyEditor()
- Description copied from class:
Node.Property
- Get a property editor for this property.
The default implementation tries to use
PropertyEditorManager
.
- Overrides:
getPropertyEditor
in class Node.Property
- Following copied from class:
org.openide.nodes.Node.Property
- Returns:
- the property editor, or
null
if there is no editor
setPropertyEditorClass
public void setPropertyEditorClass(Class clazz)
- Set the property editor explicitly.
- Parameters:
clazz
- class type of the property editor
Built on December 12 2001. | Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.