public class PropertyDescriptor extends FeatureDescriptor
Constructor and Description |
---|
PropertyDescriptor(String propertyName, 类<?> beanClass)
构建了一个如下的标准java公约通过getFoo和setFoo这种存取方法属性propertydescriptor。
|
PropertyDescriptor(String propertyName, 类<?> beanClass, String readMethodName, String writeMethodName)
此构造函数以一个简单的属性的名称,和用于读和写属性的方法名称。
|
PropertyDescriptor(String propertyName, 方法 readMethod, 方法 writeMethod)
此构造函数以一个简单的属性的名称,和用于读和写属性的方法对象。
|
Modifier and Type | Method and Description |
---|---|
PropertyEditor |
createPropertyEditor(Object bean)
使用当前属性编辑器类构造属性编辑器的实例。
|
boolean |
equals(Object obj)
比较这
PropertyDescriptor 与指定对象。
|
类<?> |
getPropertyEditorClass()
得到任何明确的属性类,已被注册为该属性。
|
类<?> |
getPropertyType()
返回该属性的java类型信息。
|
方法 |
getReadMethod()
获取应用于读取属性值的方法。
|
方法 |
getWriteMethod()
获取应用于写入属性值的方法。
|
int |
hashCode()
返回一个对象的哈希代码值。
|
boolean |
isBound()
更新“绑定”属性将导致“propertychange”事件被解雇时更改属性。
|
boolean |
isConstrained()
尝试更新“约束”属性将导致“vetoablechange”事件被解雇时更改属性。
|
void |
setBound(boolean bound)
更新“绑定”属性将导致“propertychange”事件被解雇时更改属性。
|
void |
setConstrained(boolean constrained)
尝试更新“约束”属性将导致“vetoablechange”事件被解雇时更改属性。
|
void |
setPropertyEditorClass(类<?> propertyEditorClass)
通常propertyeditors将使用propertyeditormanager发现。
|
void |
setReadMethod(方法 readMethod)
设置应用于读取属性值的方法。
|
void |
setWriteMethod(方法 writeMethod)
设置应该使用的方法写属性值的方法。
|
attributeNames, getDisplayName, getName, getShortDescription, getValue, isExpert, isHidden, isPreferred, setDisplayName, setExpert, setHidden, setName, setPreferred, setShortDescription, setValue, toString
public PropertyDescriptor(String propertyName, 类<?> beanClass) throws IntrospectionException
propertyName
-房地产专业名称。
beanClass
-目标bean类对象。例如sun.beans.ourbutton.class。
IntrospectionException
-如果在反思发生异常。
public PropertyDescriptor(String propertyName, 类<?> beanClass, String readMethodName, String writeMethodName) throws IntrospectionException
propertyName
-房地产专业名称。
beanClass
-目标bean类对象。例如sun.beans.ourbutton.class。
readMethodName
-用于读取属性值的方法的名称。可能是无效的,如果属性是只写。
writeMethodName
-用于写入属性值的方法的名称。如果属性是只读的,则可能为空。
IntrospectionException
-如果在反思发生异常。
public PropertyDescriptor(String propertyName, 方法 readMethod, 方法 writeMethod) throws IntrospectionException
propertyName
-房地产专业名称。
readMethod
-用于读取属性值的方法。可能是无效的,如果属性是只写。
writeMethod
-用于写入属性值的方法。如果属性是只读的,则可能为空。
IntrospectionException
-如果在反思发生异常。
public 类<?> getPropertyType()
类
对象可以描述原始java类型如
int
。这种类型的阅读方法返回或作为写方法的参数类型。返回
null
如果类型是一个索引的属性,不支持非索引访问。
类
对象,或
null
如果无法确定类型
public 方法 getReadMethod()
public void setReadMethod(方法 readMethod) throws IntrospectionException
readMethod
-新的阅读方法。
IntrospectionException
-如果读取方法无效
public 方法 getWriteMethod()
public void setWriteMethod(方法 writeMethod) throws IntrospectionException
writeMethod
-新的编写方法。
IntrospectionException
-如果写的方法是无效的
public boolean isBound()
public void setBound(boolean bound)
bound
-如果这是一个必然的财产。
public boolean isConstrained()
public void setConstrained(boolean constrained)
constrained
-如果这是一个约束性。
public void setPropertyEditorClass(类<?> propertyEditorClass)
propertyEditorClass
-所需的阶级属性。
public 类<?> getPropertyEditorClass()
public PropertyEditor createPropertyEditor(Object bean)
如果属性编辑器类有一个调用对象参数的公共构造函数,则将使用参数作为参数来调用它。否则,将调用默认构造函数。
bean
-源对象
public boolean equals(Object obj)
PropertyDescriptor
与指定对象。如果对象是相同的,则返回真。两
PropertyDescriptor
s是相同的如果读、写、属性类型、属性编辑器和旗帜是等价的。
equals
方法重写,继承类
Object
obj
-参考对象的比较。
true
obj参数相同;
false
否则。
Object.hashCode()
,
HashMap
public int hashCode()
Object.hashCode()
。
hashCode
方法重写,继承类
Object
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.