public class IndexedPropertyDescriptor extends PropertyDescriptor
索引属性还可以提供简单的非索引读写方法。 如果这些存在,它们读取和写入由索引读取方法返回的类型的数组。
| Constructor and Description |
|---|
IndexedPropertyDescriptor(String propertyName, 类<?> beanClass)
该构造函数通过使用getFoo和setFoo访问器方法为索引访问和数组访问来构造遵循标准Java约定的属性的IndexedPropertyDescriptor。
|
IndexedPropertyDescriptor(String propertyName, 类<?> beanClass, String readMethodName, String writeMethodName, String indexedReadMethodName, String indexedWriteMethodName)
此构造函数使用简单属性的名称,以及用于读取和写入属性的方法名称,包括索引和非索引。
|
IndexedPropertyDescriptor(String propertyName, 方法 readMethod, 方法 writeMethod, 方法 indexedReadMethod, 方法 indexedWriteMethod)
此构造函数使用简单属性的名称,以及用于读取和写入属性的Method对象。
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
将此
PropertyDescriptor与指定对象进行比较。
|
类<?> |
getIndexedPropertyType()
返回索引属性的Java类型信息。
|
方法 |
getIndexedReadMethod()
获取应用于读取索引属性值的方法。
|
方法 |
getIndexedWriteMethod()
获取应用于编写索引属性值的方法。
|
int |
hashCode()
返回对象的哈希码值。
|
void |
setIndexedReadMethod(方法 readMethod)
设置应用于读取索引属性值的方法。
|
void |
setIndexedWriteMethod(方法 writeMethod)
设置应用于编写索引属性值的方法。
|
createPropertyEditor, getPropertyEditorClass, getPropertyType, getReadMethod, getWriteMethod, isBound, isConstrained, setBound, setConstrained, setPropertyEditorClass, setReadMethod, setWriteMethodattributeNames, getDisplayName, getName, getShortDescription, getValue, isExpert, isHidden, isPreferred, setDisplayName, setExpert, setHidden, setName, setPreferred, setShortDescription, setValue, toStringpublic IndexedPropertyDescriptor(String propertyName, 类<?> beanClass) throws IntrospectionException
因此,如果参数名称为“fred”,则将假定存在索引读取器方法“getFred”,一种非索引(数组)读取器方法,也称为“getFred”,索引的写入器方法“setFred”,最后是非索引作者方法“setFred”。
propertyName - 属性的编程名称。
beanClass - 目标bean的Class对象。
IntrospectionException - 如果在内省期间发生异常。
public IndexedPropertyDescriptor(String propertyName, 类<?> beanClass, String readMethodName, String writeMethodName, String indexedReadMethodName, String indexedWriteMethodName) throws IntrospectionException
propertyName - 属性的编程名称。
beanClass - 目标bean的Class对象。
readMethodName - 用于将属性值读取为数组的方法的名称。
如果属性为只写或必须编入索引,则可以为null。
writeMethodName - 用于将属性值写入数组的方法的名称。
如果属性为只读或必须编入索引,则可以为null。
indexedReadMethodName - 用于读取索引属性值的方法的名称。
如果属性是只写的,可能为null。
indexedWriteMethodName - 用于编写索引属性值的方法的名称。
如果属性是只读的,则可以为null。
IntrospectionException - 如果在内省期间发生异常。
public IndexedPropertyDescriptor(String propertyName, 方法 readMethod, 方法 writeMethod, 方法 indexedReadMethod, 方法 indexedWriteMethod) throws IntrospectionException
propertyName - 属性的编程名称。
readMethod - 用于将属性值读取为数组的方法。
如果属性为只写或必须编入索引,则可以为null。
writeMethod - 用于将属性值写入数组的方法。
如果属性为只读或必须编入索引,则可以为null。
indexedReadMethod - 用于读取索引属性值的方法。
如果属性是只写的,可能为null。
indexedWriteMethod - 用于编写索引属性值的方法。
如果属性是只读的,则可以为null。
IntrospectionException - 如果在内省期间发生异常。
public 方法 getIndexedReadMethod()
public void setIndexedReadMethod(方法 readMethod) throws IntrospectionException
readMethod - 新的索引读取方法。
IntrospectionException - 如果在内省期间发生异常。
public 方法 getIndexedWriteMethod()
public void setIndexedWriteMethod(方法 writeMethod) throws IntrospectionException
writeMethod - 新的索引写入方法。
IntrospectionException - 如果在内省期间发生异常。
public 类<?> getIndexedPropertyType()
类对象可能会描述原始Java类型,如int 。
该类型由索引读取方法返回或用作索引写入方法的参数类型。
类对象,表示Java类型信息,或
null如果不能确定的类型
public boolean equals(Object obj)
PropertyDescriptor与指定对象进行比较。
如果对象相同,则返回true。
如果读,写,属性类型,属性编辑器和标志是等效的,则两个PropertyDescriptor是相同的。
equals在
PropertyDescriptor
obj - 用于比较的参考对象。
true如果该对象与obj参数相同;
false否则。
Object.hashCode() , HashMap
public int hashCode()
Object.hashCode()的完整描述。
hashCode在
PropertyDescriptor
Object.equals(java.lang.Object) ,
System.identityHashCode(java.lang.Object)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.