APIdia Launch Partner
Top Description Fields Constructors Methods
java.beans

public Class IndexedPropertyDescriptor

extends PropertyDescriptor
Class Inheritance
Imports
java.lang.ref.Reference, java.lang.reflect.Method, java.util.Map.Entry, com.sun.beans.introspect.PropertyInfo

An IndexedPropertyDescriptor describes a property that acts like an array and has an indexed read and/or indexed write method to access specific elements of the array.

An indexed property may also provide simple non-indexed read and write methods. If these are present, they read and write arrays of the type returned by the indexed read method.

Since
1.1

Field Summary

Modifier and TypeField and Description
private Reference<? extends Class<?>>
private String
private final MethodRef
private String
private final MethodRef

Constructor Summary

AccessConstructor and Description
public
IndexedPropertyDescriptor(String
The programmatic name of the property.
propertyName
,
Class<?>
The Class object for the target bean.
beanClass
)

This constructor constructs an IndexedPropertyDescriptor for a property that follows the standard Java conventions by having getFoo and setFoo accessor methods, for both indexed access and array access.

public
IndexedPropertyDescriptor(String
The programmatic name of the property.
propertyName
,
Class<?>
The Class object for the target bean.
beanClass
,
String
The name of the method used for reading the property values as an array. May be null if the property is write-only or must be indexed.
readMethodName
,
String
The name of the method used for writing the property values as an array. May be null if the property is read-only or must be indexed.
writeMethodName
,
String
The name of the method used for reading an indexed property value. May be null if the property is write-only.
indexedReadMethodName
,
String
The name of the method used for writing an indexed property value. May be null if the property is read-only.
indexedWriteMethodName
)

This constructor takes the name of a simple property, and method names for reading and writing the property, both indexed and non-indexed.

public
IndexedPropertyDescriptor(String
The programmatic name of the property.
propertyName
,
Method
The method used for reading the property values as an array. May be null if the property is write-only or must be indexed.
readMethod
,
Method
The method used for writing the property values as an array. May be null if the property is read-only or must be indexed.
writeMethod
,
Method
The method used for reading an indexed property value. May be null if the property is write-only.
indexedReadMethod
,
Method
The method used for writing an indexed property value. May be null if the property is read-only.
indexedWriteMethod
)

This constructor takes the name of a simple property, and Method objects for reading and writing the property.

pack-priv
IndexedPropertyDescriptor(Map.Entry<String, PropertyInfo>
the key-value pair, where the key is the base name of the property (the rest of the method name) and the value is the automatically generated property info
entry
,
boolean
the flag indicating whether it is possible to treat this property as a bound property
bound
)

Creates IndexedPropertyDescriptor from the specified property info.

pack-priv
IndexedPropertyDescriptor(PropertyDescriptor
The first (lower priority) PropertyDescriptor
x
,
PropertyDescriptor
The second (higher priority) PropertyDescriptor
y
)

Package-private constructor.

pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
public boolean
equals(Object obj)

Overrides java.beans.PropertyDescriptor.equals.

Compares this PropertyDescriptor against the specified object.

private Class<?>
findIndexedPropertyType(Method indexedReadMethod, Method indexedWriteMethod)

public synchronized Class<?>

Returns:

the Class object that represents the Java type info, or null if the type cannot be determined
getIndexedPropertyType
()

Returns the Java type info for the indexed property.

private Class<?>
public synchronized Method

Returns:

The method that should be used to read an indexed property value. May return null if the property isn't indexed or is write-only.
getIndexedReadMethod
()

Gets the method that should be used to read an indexed property value.

public synchronized Method

Returns:

The method that should be used to write an indexed property value. May return null if the property isn't indexed or is read-only.
getIndexedWriteMethod
()

Gets the method that should be used to write an indexed property value.

public int

Returns:

a hash code value for this object.
hashCode
()

Overrides java.beans.PropertyDescriptor.hashCode.

Returns a hash code value for the object.

private void
public synchronized void
setIndexedReadMethod(Method
The new indexed read method.
readMethod
)

Sets the method that should be used to read an indexed property value.

private void
public synchronized void
setIndexedWriteMethod(Method
The new indexed write method.
writeMethod
)

Sets the method that should be used to write an indexed property value.

private void
pack-priv void
Inherited from java.beans.PropertyDescriptor:
compareMethodscreatePropertyEditorgetBaseNamegetPropertyEditorClassgetPropertyTypegetReadMethodgetWriteMethodisAssignableisBoundisConstrainedsetBoundsetClass0setConstrainedsetPropertyEditorClasssetReadMethodsetWriteMethod

Field Detail

indexedPropertyTypeRefback to summary
private Reference<? extends Class<?>> indexedPropertyTypeRef
indexedReadMethodNameback to summary
private String indexedReadMethodName
indexedReadMethodRefback to summary
private final MethodRef indexedReadMethodRef
indexedWriteMethodNameback to summary
private String indexedWriteMethodName
indexedWriteMethodRefback to summary
private final MethodRef indexedWriteMethodRef

Constructor Detail

IndexedPropertyDescriptorback to summary
public IndexedPropertyDescriptor(String propertyName, Class<?> beanClass) throws IntrospectionException

This constructor constructs an IndexedPropertyDescriptor for a property that follows the standard Java conventions by having getFoo and setFoo accessor methods, for both indexed access and array access.

Thus if the argument name is "fred", it will assume that there is an indexed reader method "getFred", a non-indexed (array) reader method also called "getFred", an indexed writer method "setFred", and finally a non-indexed writer method "setFred".

Parameters
propertyName:String

The programmatic name of the property.

beanClass:Class<?>

The Class object for the target bean.

Exceptions
IntrospectionException:
if an exception occurs during introspection.
IndexedPropertyDescriptorback to summary
public IndexedPropertyDescriptor(String propertyName, Class<?> beanClass, String readMethodName, String writeMethodName, String indexedReadMethodName, String indexedWriteMethodName) throws IntrospectionException

This constructor takes the name of a simple property, and method names for reading and writing the property, both indexed and non-indexed.

Parameters
propertyName:String

The programmatic name of the property.

beanClass:Class<?>

The Class object for the target bean.

readMethodName:String

The name of the method used for reading the property values as an array. May be null if the property is write-only or must be indexed.

writeMethodName:String

The name of the method used for writing the property values as an array. May be null if the property is read-only or must be indexed.

indexedReadMethodName:String

The name of the method used for reading an indexed property value. May be null if the property is write-only.

indexedWriteMethodName:String

The name of the method used for writing an indexed property value. May be null if the property is read-only.

Exceptions
IntrospectionException:
if an exception occurs during introspection.
IndexedPropertyDescriptorback to summary
public IndexedPropertyDescriptor(String propertyName, Method readMethod, Method writeMethod, Method indexedReadMethod, Method indexedWriteMethod) throws IntrospectionException

This constructor takes the name of a simple property, and Method objects for reading and writing the property.

Parameters
propertyName:String

The programmatic name of the property.

readMethod:Method

The method used for reading the property values as an array. May be null if the property is write-only or must be indexed.

writeMethod:Method

The method used for writing the property values as an array. May be null if the property is read-only or must be indexed.

indexedReadMethod:Method

The method used for reading an indexed property value. May be null if the property is write-only.

indexedWriteMethod:Method

The method used for writing an indexed property value. May be null if the property is read-only.

Exceptions
IntrospectionException:
if an exception occurs during introspection.
IndexedPropertyDescriptorback to summary
pack-priv IndexedPropertyDescriptor(Map.Entry<String, PropertyInfo> entry, boolean bound)

Creates IndexedPropertyDescriptor from the specified property info.

Parameters
entry:Map.Entry<String, PropertyInfo>

the key-value pair, where the key is the base name of the property (the rest of the method name) and the value is the automatically generated property info

bound:boolean

the flag indicating whether it is possible to treat this property as a bound property

Since
9
IndexedPropertyDescriptorback to summary
pack-priv IndexedPropertyDescriptor(PropertyDescriptor x, PropertyDescriptor y)

Package-private constructor. Merge two property descriptors. Where they conflict, give the second argument (y) priority over the first argument (x).

Parameters
x:PropertyDescriptor

The first (lower priority) PropertyDescriptor

y:PropertyDescriptor

The second (higher priority) PropertyDescriptor

IndexedPropertyDescriptorback to summary
pack-priv IndexedPropertyDescriptor(IndexedPropertyDescriptor old)

Method Detail

appendToback to summary
pack-priv void appendTo(StringBuilder sb)

Overrides java.beans.PropertyDescriptor.appendTo.

Annotations
@Override
equalsback to summary
public boolean equals(Object obj)

Overrides java.beans.PropertyDescriptor.equals.

Compares this PropertyDescriptor against the specified object. Returns true if the objects are the same. Two PropertyDescriptors are the same if the read, write, property types, property editor and flags are equivalent.

Annotations
@Override
Since
1.4
findIndexedPropertyTypeback to summary
private Class<?> findIndexedPropertyType(Method indexedReadMethod, Method indexedWriteMethod) throws IntrospectionException
getIndexedPropertyTypeback to summary
public synchronized Class<?> getIndexedPropertyType()

Returns the Java type info for the indexed property. Note that the Class object may describe primitive Java types such as int. This type is returned by the indexed read method or is used as the parameter type of the indexed write method.

Returns:Class<?>

the Class object that represents the Java type info, or null if the type cannot be determined

getIndexedPropertyType0back to summary
private Class<?> getIndexedPropertyType0()
getIndexedReadMethodback to summary
public synchronized Method getIndexedReadMethod()

Gets the method that should be used to read an indexed property value.

Returns:Method

The method that should be used to read an indexed property value. May return null if the property isn't indexed or is write-only.

getIndexedWriteMethodback to summary
public synchronized Method getIndexedWriteMethod()

Gets the method that should be used to write an indexed property value.

Returns:Method

The method that should be used to write an indexed property value. May return null if the property isn't indexed or is read-only.

hashCodeback to summary
public int hashCode()

Overrides java.beans.PropertyDescriptor.hashCode.

Returns a hash code value for the object. See java.lang.Object#hashCode for a complete description.

Returns:int

a hash code value for this object.

Annotations
@Override
Since
1.5
setIndexedPropertyTypeback to summary
private void setIndexedPropertyType(Class<?> type)
setIndexedReadMethodback to summary
public synchronized void setIndexedReadMethod(Method readMethod) throws IntrospectionException

Sets the method that should be used to read an indexed property value.

Parameters
readMethod:Method

The new indexed read method.

Exceptions
IntrospectionException:
if an exception occurs during introspection.
Since
1.2
setIndexedReadMethod0back to summary
private void setIndexedReadMethod0(Method readMethod)
setIndexedWriteMethodback to summary
public synchronized void setIndexedWriteMethod(Method writeMethod) throws IntrospectionException

Sets the method that should be used to write an indexed property value.

Parameters
writeMethod:Method

The new indexed write method.

Exceptions
IntrospectionException:
if an exception occurs during introspection.
Since
1.2
setIndexedWriteMethod0back to summary
private void setIndexedWriteMethod0(Method writeMethod)
updateGenericsForback to summary
pack-priv void updateGenericsFor(Class<?> type)

Overrides java.beans.PropertyDescriptor.updateGenericsFor.

Annotations
@Override