@ActiveOnClass(value=java.beans.PropertyDescriptor.class) public class BeanPropertySupportImpl extends BeanPropertySupport
BeanPropertySupport.DiffNode, BeanPropertySupport.ReadVisitor, BeanPropertySupport.WriteVisitor| 限定符和类型 | 字段和说明 |
|---|---|
static BeanPropertySupportImpl |
BEAN_SUPPORT |
EMPTY_OBJECT_ARRAY, traceEnabled| 构造器和说明 |
|---|
BeanPropertySupportImpl() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addPropertyDescriptorFactory(PropertyDescriptorFactory element) |
void |
addPropertyDescriptorFactoryAsFirst(PropertyDescriptorFactory element) |
void |
clearDescriptors()
Clear any cached property descriptors information for all classes
loaded by any class loaders.
|
void |
copyProperties(java.lang.Object dest,
java.lang.Object orig)
Copy property values from the "origin" bean to the "destination" bean
for all cases where the property names are the same (even though the
actual getter and setter methods might have been customized via
BeanInfo classes). |
protected java.lang.Object |
getIndexedProperty(java.lang.Object bean,
java.lang.String name,
int index)
Return the value of the specified indexed property of the specified
bean, with no type conversions.
|
protected java.lang.Object |
getMappedProperty(java.lang.Object bean,
java.lang.String name,
java.lang.String key)
Return the value of the specified mapped property of the specified
bean, with no type conversions.
|
java.util.Map<java.lang.String,java.beans.PropertyDescriptor> |
getMappedPropertyDescriptors(java.lang.Class<?> beanClass)
Return the mapped property descriptors for this bean class.
|
java.util.Map<java.lang.String,java.beans.PropertyDescriptor> |
getMappedPropertyDescriptors(java.lang.Object bean)
Return the mapped property descriptors for this bean.
|
java.util.Map<java.lang.String,java.beans.PropertyDescriptor> |
getProperties(java.lang.Class<?> beanClass,
int rw,
boolean lenient)
获取beanClass中所有具有指定读写类型(rw)的属性
|
java.beans.PropertyDescriptor |
getPropertyDescriptor(java.lang.Object bean,
java.lang.String name)
Retrieve the property descriptor for the specified property of the
specified bean, or return
null if there is no such
descriptor. |
java.beans.PropertyDescriptor[] |
getPropertyDescriptors(java.lang.Class<?> beanClass) |
java.beans.PropertyDescriptor[] |
getPropertyDescriptors(java.lang.Object bean)
Retrieve the property descriptors for the specified bean,
introspecting and caching them the first time a particular bean class
is encountered.
|
java.util.Set<java.lang.String> |
getPropertyNames(java.lang.Class<?> beanClass,
int rw,
boolean lenient)
获取beanClass中所有具有指定读写类型(rw)的属性名集合
|
protected java.lang.Object |
getSearchedProperty(java.lang.Object bean,
java.lang.String name,
java.lang.String field,
java.lang.Object conditionValue)
Return the value of the specified indexed property of the specified
bean, with no type conversions.
|
protected java.lang.Object |
getSimpleProperty(java.lang.Object bean,
java.lang.String name)
Return the value of the specified simple property of the specified
bean, with no type conversions.
|
boolean |
hasCycleReference(java.lang.Object bean)
检查是否有循环引用,如果有循环引用返回
true否则返回false |
boolean |
isReadable(java.lang.Object bean,
java.lang.String name)
Return
true if the specified property name identifies
a readable property on the specified bean; otherwise, return
false. |
boolean |
isWriteable(java.lang.Object bean,
java.lang.String name)
Return
true if the specified property name identifies
a writeable property on the specified bean; otherwise, return
false. |
protected void |
setIndexedProperty(java.lang.Object bean,
java.lang.String name,
int index,
java.lang.Object value)
Set the value of the specified indexed property of the specified
bean, with no type conversions.
|
protected void |
setMappedProperty(java.lang.Object bean,
java.lang.String name,
java.lang.String key,
java.lang.Object value)
Set the value of the specified mapped property of the specified
bean, with no type conversions.
|
protected void |
setSimpleProperty(java.lang.Object bean,
java.lang.String name,
java.lang.Object value)
Set the value of the specified simple property of the specified bean,
with no type conversions.
|
protected java.lang.Object |
tryConstructIfNull(java.lang.Object nestedBean,
java.lang.Object bean,
java.lang.String name,
java.lang.Class<?> expectType)
当
nestedBean为null时尝试为bean的name字段构造新实例 |
allEmpty, allEmpty, checkCycleReference, createBeanDifference, describe, describe, different, different, different, different, different, different, different, different, getIndexedProperty, getIndexValue, getMappedProperty, getProperty, getProperty, getProperty0, getPropertyChecked, getPropertyCheckType, getPropertyNames, getSearchedProperty, hasEmpty, hasEmpty, isEmpty, isEmpty, isEmpty, maybeJsonString, searchIn, setIndexedProperty, setMappedProperty, setOrAddIndexValue, setProperty, setProperty0, setPropertyChecked, setTraceEnabledpublic static final BeanPropertySupportImpl BEAN_SUPPORT
public java.beans.PropertyDescriptor[] getPropertyDescriptors(java.lang.Class<?> beanClass)
public java.util.Map<java.lang.String,java.beans.PropertyDescriptor> getProperties(java.lang.Class<?> beanClass,
int rw,
boolean lenient)
beanClass - rw - 属性类型标记 lenient - 是否为宽容模式---允许返回类型不为void的setter方法public java.util.Map<java.lang.String,java.beans.PropertyDescriptor> getMappedPropertyDescriptors(java.lang.Class<?> beanClass)
Return the mapped property descriptors for this bean class.
beanClass - getProperties(Class, int, boolean)public java.util.Map<java.lang.String,java.beans.PropertyDescriptor> getMappedPropertyDescriptors(java.lang.Object bean)
Return the mapped property descriptors for this bean.
bean - Bean to be introspectedpublic java.util.Set<java.lang.String> getPropertyNames(java.lang.Class<?> beanClass,
int rw,
boolean lenient)
BeanPropertySupportgetPropertyNames 在类中 BeanPropertySupportrw - 属性类型标记 lenient - 是否为宽容模式---允许返回类型不为void的setter方法public void clearDescriptors()
BeanPropertySupportclearDescriptors 在类中 BeanPropertySupportpublic java.beans.PropertyDescriptor[] getPropertyDescriptors(java.lang.Object bean)
Retrieve the property descriptors for the specified bean, introspecting and caching them the first time a particular bean class is encountered.
bean - Bean for which property descriptors are requestedjava.lang.IllegalArgumentException - if bean is nullpublic java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.Object bean,
java.lang.String name)
throws java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException,
java.lang.NoSuchMethodException
Retrieve the property descriptor for the specified property of the
specified bean, or return null if there is no such
descriptor. This method resolves indexed and nested property
references in the same manner as other methods in this class, except
that if the last (or only) name element is indexed, the descriptor
for the last resolved property itself is returned.
bean - Bean for which a property descriptor is requestedname - Possibly indexed and/or nested name of the property for
which a property descriptor is requestedjava.lang.IllegalAccessException - if the caller does not have
access to the property accessor methodjava.lang.IllegalArgumentException - if bean or
name is nulljava.lang.IllegalArgumentException - if a nested reference to a
property returns nulljava.lang.reflect.InvocationTargetException - if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException - if an accessor method for this
propety cannot be foundprotected java.lang.Object getSimpleProperty(java.lang.Object bean,
java.lang.String name)
throws java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException,
java.lang.NoSuchMethodException
BeanPropertySupportgetSimpleProperty 在类中 BeanPropertySupportbean - Bean whose property is to be extractedname - Name of the property to be extractedjava.lang.IllegalAccessException - if the caller does not have
access to the property accessor methodjava.lang.reflect.InvocationTargetException - if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException - if an accessor method for this
propety cannot be foundprotected java.lang.Object getMappedProperty(java.lang.Object bean,
java.lang.String name,
java.lang.String key)
throws java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException,
java.lang.NoSuchMethodException
BeanPropertySupportgetMappedProperty 在类中 BeanPropertySupportbean - Bean whose property is to be extractedname - Mapped property name of the property value to be extractedkey - Key of the property value to be extractedjava.lang.IllegalAccessException - if the caller does not have
access to the property accessor methodjava.lang.reflect.InvocationTargetException - if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException - if an accessor method for this
propety cannot be foundprotected void setMappedProperty(java.lang.Object bean,
java.lang.String name,
java.lang.String key,
java.lang.Object value)
throws java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException,
java.lang.NoSuchMethodException
BeanPropertySupportsetMappedProperty 在类中 BeanPropertySupportbean - Bean whose property is to be setname - Mapped property name of the property value to be setkey - Key of the property value to be setvalue - The property value to be setjava.lang.IllegalAccessException - if the caller does not have
access to the property accessor methodjava.lang.reflect.InvocationTargetException - if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException - if an accessor method for this
propety cannot be foundprotected java.lang.Object getIndexedProperty(java.lang.Object bean,
java.lang.String name,
int index)
throws java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException,
java.lang.NoSuchMethodException
BeanPropertySupportList objects as well.getIndexedProperty 在类中 BeanPropertySupportbean - Bean whose property is to be extractedname - Simple property name of the property value to be extractedindex - Index of the property value to be extractedjava.lang.IllegalAccessException - if the caller does not have
access to the property accessor methodjava.lang.reflect.InvocationTargetException - if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException - if an accessor method for this
propety cannot be foundprotected void setIndexedProperty(java.lang.Object bean,
java.lang.String name,
int index,
java.lang.Object value)
throws java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException,
java.lang.NoSuchMethodException
BeanPropertySupportList objects as well.setIndexedProperty 在类中 BeanPropertySupportbean - Bean whose property is to be setname - Simple property name of the property value to be setindex - Index of the property value to be setvalue - Value to which the indexed property element is to be setjava.lang.IllegalAccessException - if the caller does not have
access to the property accessor methodjava.lang.reflect.InvocationTargetException - if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException - if an accessor method for this
propety cannot be foundprotected java.lang.Object getSearchedProperty(java.lang.Object bean,
java.lang.String name,
java.lang.String field,
java.lang.Object conditionValue)
throws java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException,
java.lang.NoSuchMethodException
BeanPropertySupportList objects as well.getSearchedProperty 在类中 BeanPropertySupportbean - Bean whose property is to be extractedname - Simple property name of the property value to be extractedfield - sub property nameconditionValue - search satisfied value of fieldjava.lang.IllegalAccessException - if the caller does not have
access to the property accessor methodjava.lang.reflect.InvocationTargetException - if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException - if an accessor method for this
property cannot be foundprotected void setSimpleProperty(java.lang.Object bean,
java.lang.String name,
java.lang.Object value)
throws java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException,
java.lang.NoSuchMethodException
BeanPropertySupportsetSimpleProperty 在类中 BeanPropertySupportbean - Bean whose property is to be modifiedname - Name of the property to be modifiedvalue - Value to which the property should be setjava.lang.IllegalAccessException - if the caller does not have
access to the property accessor methodjava.lang.reflect.InvocationTargetException - if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException - if an accessor method for this
propety cannot be foundpublic void copyProperties(java.lang.Object dest,
java.lang.Object orig)
BeanPropertySupportCopy property values from the "origin" bean to the "destination" bean
for all cases where the property names are the same (even though the
actual getter and setter methods might have been customized via
BeanInfo classes). No conversions are performed on the
actual property values -- it is assumed that the values retrieved from
the origin bean are assignment-compatible with the types expected by
the destination bean.
If the origin "bean" is actually a Map, it is assumed
to contain String-valued simple property names as the keys, pointing
at the corresponding property values that will be set in the destination
bean.Note that this method is intended to perform
a "shallow copy" of the properties and so complex properties
(for example, nested ones) will not be copied.
Note, that this method will not copy a List to a List, or an Object[] to an Object[]. It's specifically for copying JavaBean properties.
copyProperties 在类中 BeanPropertySupportdest - Destination bean whose properties are modifiedorig - Origin bean whose properties are retrieved
orig argument is nullpublic boolean isReadable(java.lang.Object bean,
java.lang.String name)
BeanPropertySupportReturn true if the specified property name identifies
a readable property on the specified bean; otherwise, return
false.
isReadable 在类中 BeanPropertySupportbean - Bean to be examinedname - Property name to be evaluatedtrue if the property is readable,
otherwise falsepublic boolean isWriteable(java.lang.Object bean,
java.lang.String name)
BeanPropertySupportReturn true if the specified property name identifies
a writeable property on the specified bean; otherwise, return
false.
isWriteable 在类中 BeanPropertySupportbean - Bean to be examinedname - Property name to be evaluatedtrue if the property is writeable,
otherwise falsepublic boolean hasCycleReference(java.lang.Object bean)
BeanPropertySupporttrue否则返回falsehasCycleReference 在类中 BeanPropertySupportprotected java.lang.Object tryConstructIfNull(java.lang.Object nestedBean,
java.lang.Object bean,
java.lang.String name,
java.lang.Class<?> expectType)
throws java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException,
java.lang.NoSuchMethodException
BeanPropertySupportnestedBean为null时尝试为bean的name字段构造新实例tryConstructIfNull 在类中 BeanPropertySupportname - 字段名expectType - 期望的新实例类型,为null使用从字段对应的属性类型java.lang.IllegalAccessExceptionjava.lang.reflect.InvocationTargetExceptionjava.lang.NoSuchMethodExceptionpublic void addPropertyDescriptorFactoryAsFirst(PropertyDescriptorFactory element)
public void addPropertyDescriptorFactory(PropertyDescriptorFactory element)
Copyright © 2023. All Rights Reserved.