Top Description Inners Fields Constructors Methods
org.springframework.beans

pack-priv abstract Class PropertyDescriptorUtils

extends Object
Class Inheritance
Imports
java.beans.IntrospectionException, .PropertyDescriptor, java.lang.reflect.Method, java.util.ArrayList, .Collection, .Enumeration, .List, .Map, .TreeMap, org.springframework.lang.Nullable, org.springframework.util.ObjectUtils, .StringUtils

Common delegate methods for Spring's internal PropertyDescriptor implementations.
Authors
Chris Beams, Juergen Hoeller

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
PropertyDescriptorUtils.BasicPropertyDescriptor

PropertyDescriptor for determineBasicProperties(Class), not performing any early type determination for setReadMethod/setWriteMethod.

Field Summary

Modifier and TypeField and Description
public static final PropertyDescriptor[]

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public static void
public static Collection<? extends PropertyDescriptor>

Returns:

a collection of property descriptors
determineBasicProperties
(Class<?>
the target class to introspect
beanClass
)

Simple introspection algorithm for basic set/get/is accessor methods, building corresponding JavaBeans property descriptors for them.

public static boolean
equals(PropertyDescriptor pd, PropertyDescriptor otherPd)

Compare the given PropertyDescriptors and return true if they are equivalent, i.e. their read method, write method, property type, property editor and flags are equivalent.

public static Class<?>
findIndexedPropertyType(String name, Class<?> propertyType, Method indexedReadMethod, Method indexedWriteMethod)

See java.beans.IndexedPropertyDescriptor#findIndexedPropertyType.

public static Class<?>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTY_PROPERTY_DESCRIPTOR_ARRAYback to summary
public static final PropertyDescriptor[] EMPTY_PROPERTY_DESCRIPTOR_ARRAY

Constructor Detail

PropertyDescriptorUtilsback to summary
pack-priv PropertyDescriptorUtils()

Method Detail

copyNonMethodPropertiesback to summary
public static void copyNonMethodProperties(PropertyDescriptor source, PropertyDescriptor target)

See java.beans.FeatureDescriptor.

determineBasicPropertiesback to summary
public static Collection<? extends PropertyDescriptor> determineBasicProperties(Class<?> beanClass) throws IntrospectionException

Simple introspection algorithm for basic set/get/is accessor methods, building corresponding JavaBeans property descriptors for them.

This just supports the basic JavaBeans conventions, without indexed properties or any customizers, and without other BeanInfo metadata. For standard JavaBeans introspection, use the JavaBeans Introspector.

Parameters
beanClass:Class<?>

the target class to introspect

Returns:Collection<? extends PropertyDescriptor>

a collection of property descriptors

Exceptions
IntrospectionException:
from introspecting the given bean class
Since
5.3.24
See Also
SimpleBeanInfoFactory, java.beans.Introspector#getBeanInfo(Class)
equalsback to summary
public static boolean equals(PropertyDescriptor pd, PropertyDescriptor otherPd)

Compare the given PropertyDescriptors and return true if they are equivalent, i.e. their read method, write method, property type, property editor and flags are equivalent.

See Also
java.beans.PropertyDescriptor#equals(Object)
findIndexedPropertyTypeback to summary
public static Class<?> findIndexedPropertyType(String name, Class<?> propertyType, Method indexedReadMethod, Method indexedWriteMethod) throws IntrospectionException

See java.beans.IndexedPropertyDescriptor#findIndexedPropertyType.

Annotations
@Nullable
findPropertyTypeback to summary
public static Class<?> findPropertyType(Method readMethod, Method writeMethod) throws IntrospectionException

See java.beans.PropertyDescriptor#findPropertyType.

Annotations
@Nullable
org.springframework.beans back to summary

private Class PropertyDescriptorUtils.BasicPropertyDescriptor

extends PropertyDescriptor
Class Inheritance

PropertyDescriptor for determineBasicProperties(Class), not performing any early type determination for setReadMethod/setWriteMethod.
Since
5.3.24

Field Summary

Modifier and TypeField and Description
private final List<Method>
private Method
private Method

Constructor Summary

AccessConstructor and Description
public
BasicPropertyDescriptor(String propertyName, Method readMethod, Method writeMethod)

Method Summary

Modifier and TypeMethod and Description
public void
addWriteMethod(Method writeMethod)

public Method
getReadMethod()

Overrides java.beans.PropertyDescriptor.getReadMethod.

Gets the method that should be used to read the property value.
public Method
getWriteMethod()

Overrides java.beans.PropertyDescriptor.getWriteMethod.

Gets the method that should be used to write the property value.
public void
setReadMethod(Method
The new read method.
readMethod
)

Overrides java.beans.PropertyDescriptor.setReadMethod.

Sets the method that should be used to read the property value.
public void
setWriteMethod(Method
The new write method.
writeMethod
)

Overrides java.beans.PropertyDescriptor.setWriteMethod.

Sets the method that should be used to write the property value.
Inherited from java.beans.PropertyDescriptor:
createPropertyEditorequalsgetPropertyEditorClassgetPropertyTypehashCodeisBoundisConstrainedsetBoundsetConstrainedsetPropertyEditorClass

Field Detail

alternativeWriteMethodsback to summary
private final List<Method> alternativeWriteMethods
readMethodback to summary
private Method readMethod
Annotations
@Nullable
writeMethodback to summary
private Method writeMethod
Annotations
@Nullable

Constructor Detail

BasicPropertyDescriptorback to summary
public BasicPropertyDescriptor(String propertyName, Method readMethod, Method writeMethod) throws IntrospectionException

Method Detail

addWriteMethodback to summary
public void addWriteMethod(Method writeMethod)
getReadMethodback to summary
public Method getReadMethod()

Overrides java.beans.PropertyDescriptor.getReadMethod.

Doc from java.beans.PropertyDescriptor.getReadMethod.

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

Returns:Method

The method that should be used to read the property value. May return null if the property can't be read.

Annotations
@Override
@Nullable
getWriteMethodback to summary
public Method getWriteMethod()

Overrides java.beans.PropertyDescriptor.getWriteMethod.

Doc from java.beans.PropertyDescriptor.getWriteMethod.

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

Returns:Method

The method that should be used to write the property value. May return null if the property can't be written.

Annotations
@Override
@Nullable
setReadMethodback to summary
public void setReadMethod(Method readMethod)

Overrides java.beans.PropertyDescriptor.setReadMethod.

Doc from java.beans.PropertyDescriptor.setReadMethod.

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

Parameters
readMethod:Method

The new read method.

Annotations
@Override
setWriteMethodback to summary
public void setWriteMethod(Method writeMethod)

Overrides java.beans.PropertyDescriptor.setWriteMethod.

Doc from java.beans.PropertyDescriptor.setWriteMethod.

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

Parameters
writeMethod:Method

The new write method.

Annotations
@Override