public class MappedPropertyDescriptor extends PropertyDescriptor
getProperty(String key)
and
setProperty(String key, Object value)
,
where Property
must be replaced
by the name of the property.
PropertyDescriptor
Constructor and Description |
---|
MappedPropertyDescriptor(String propertyName,
Class<?> beanClass)
Constructs a MappedPropertyDescriptor for a property that follows
the standard Java convention by having getFoo and setFoo
accessor methods, with the addition of a String parameter (the key).
|
MappedPropertyDescriptor(String propertyName,
Class<?> beanClass,
String mappedGetterName,
String mappedSetterName)
This constructor takes the name of a mapped property, and method
names for reading and writing the property.
|
MappedPropertyDescriptor(String propertyName,
Method mappedGetter,
Method mappedSetter)
This constructor takes the name of a mapped property, and Method
objects for reading and writing the property.
|
Modifier and Type | Method and Description |
---|---|
Class<?> |
getMappedPropertyType()
Gets the Class object for the property values.
|
Method |
getMappedReadMethod()
Gets the method that should be used to read one of the property value.
|
Method |
getMappedWriteMethod()
Gets the method that should be used to write one of the property value.
|
void |
setMappedReadMethod(Method mappedGetter)
Sets the method that should be used to read one of the property value.
|
void |
setMappedWriteMethod(Method mappedSetter)
Sets the method that should be used to write the property value.
|
createPropertyEditor, equals, getPropertyEditorClass, getPropertyType, getReadMethod, getWriteMethod, hashCode, isBound, isConstrained, setBound, setConstrained, setPropertyEditorClass, setReadMethod, setWriteMethod
attributeNames, getDisplayName, getName, getShortDescription, getValue, isExpert, isHidden, isPreferred, setDisplayName, setExpert, setHidden, setName, setPreferred, setShortDescription, setValue, toString
public MappedPropertyDescriptor(String propertyName, Class<?> beanClass) throws IntrospectionException
propertyName
- The programmatic name of the property.beanClass
- The Class object for the target bean. For
example sun.beans.OurButton.class.IntrospectionException
- if an exception occurs during
introspection.public MappedPropertyDescriptor(String propertyName, Class<?> beanClass, String mappedGetterName, String mappedSetterName) throws IntrospectionException
propertyName
- The programmatic name of the property.beanClass
- The Class object for the target bean. For
example sun.beans.OurButton.class.mappedGetterName
- The name of the method used for
reading one of the property values. May be null if the
property is write-only.mappedSetterName
- The name of the method used for writing
one of the property values. May be null if the property is
read-only.IntrospectionException
- if an exception occurs during
introspection.public MappedPropertyDescriptor(String propertyName, Method mappedGetter, Method mappedSetter) throws IntrospectionException
propertyName
- The programmatic name of the property.mappedGetter
- The method used for reading one of
the property values. May be be null if the property
is write-only.mappedSetter
- The method used for writing one the
property values. May be null if the property is read-only.IntrospectionException
- if an exception occurs during
introspection.public Class<?> getMappedPropertyType()
This is the type that will be returned by the mappedReadMethod.
public Method getMappedReadMethod()
public void setMappedReadMethod(Method mappedGetter) throws IntrospectionException
mappedGetter
- The mapped getter method.IntrospectionException
- If an error occurs finding the
mapped propertypublic Method getMappedWriteMethod()
public void setMappedWriteMethod(Method mappedSetter) throws IntrospectionException
mappedSetter
- The mapped setter method.IntrospectionException
- If an error occurs finding the
mapped propertyCopyright © 2000–2019 The Apache Software Foundation. All rights reserved.