|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjava.beans.FeatureDescriptor
java.beans.PropertyDescriptor
java.beans.IndexedPropertyDescriptor
public class IndexedPropertyDescriptor
IndexedPropertyDescriptor 描述了類似陣列行為的屬性,且有一種存取陣列特定元素的索引讀和/或索引寫方法。
索引 (indexed) 屬性還可以提供簡單的非索引讀和寫方法。如果存在這些方法,它們可讀取和寫入索引讀方法所返回型別的讀寫陣列。
| 建構子摘要 | |
|---|---|
IndexedPropertyDescriptor(String propertyName,
Class<?> beanClass)
此建構子通過 getFoo 和 setFoo 存取方法為符合標準 Java 約定的屬性建構 IndexedPropertyDescriptor,將其用於索引存取和陣列存取。 |
|
IndexedPropertyDescriptor(String propertyName,
Class<?> beanClass,
String readMethodName,
String writeMethodName,
String indexedReadMethodName,
String indexedWriteMethodName)
此建構子帶有一個簡單屬性的名稱和用於讀寫屬性的方法名稱,它們都是帶索引的或不帶索引的。 |
|
IndexedPropertyDescriptor(String propertyName,
Method readMethod,
Method writeMethod,
Method indexedReadMethod,
Method indexedWriteMethod)
此建構子帶有某一簡單屬性的名稱,以及用來讀取和寫入屬性的 Method 物件。 |
|
| 方法摘要 | |
|---|---|
boolean |
equals(Object obj)
將此 PropertyDescriptor 與指定物件比較。 |
Class<?> |
getIndexedPropertyType()
獲得索引屬性型別的 Class 物件。 |
Method |
getIndexedReadMethod()
獲得應該用於讀取索引屬性值的方法。 |
Method |
getIndexedWriteMethod()
獲得應該用於寫入索引屬性值的方法。 |
int |
hashCode()
返回物件的雜湊碼值。 |
void |
setIndexedReadMethod(Method readMethod)
設置應該用於讀取索引屬性值的方法。 |
void |
setIndexedWriteMethod(Method writeMethod)
設置應該用於寫入索引屬性值的方法。 |
| 從類別 java.beans.FeatureDescriptor 繼承的方法 |
|---|
attributeNames, getDisplayName, getName, getShortDescription, getValue, isExpert, isHidden, isPreferred, setDisplayName, setExpert, setHidden, setName, setPreferred, setShortDescription, setValue |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| 建構子詳細資訊 |
|---|
public IndexedPropertyDescriptor(String propertyName,
Class<?> beanClass)
throws IntrospectionException
因此,如果參數名為 "fred",則假定有一個索引 reader 方法 "getFred"、一個也稱為 "getFred" 的非索引(陣列)reader 方法、一個索引 writer 方法 "setFred" 和一個非索引 writer 方法 "setFred"。
propertyName - 屬性的程式名稱。beanClass - 目標 bean 的 Class 物件。
IntrospectionException - 如果在內省期間發生異常。
public IndexedPropertyDescriptor(String propertyName,
Class<?> 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,
Method readMethod,
Method writeMethod,
Method indexedReadMethod,
Method indexedWriteMethod)
throws IntrospectionException
propertyName - 屬性的程式名稱。readMethod - 用來以陣列形式讀取屬性值的方法。如果該屬性是只寫的或是必須建立索引的,則可能返回 null。writeMethod - 用來以陣列形式寫入屬性值的方法。如果該屬性是只讀的或是必須建立索引的,則可能返回 null。indexedReadMethod - 用於讀取索引屬性值的方法。如果屬性是只寫的,則該參數可能為 null。indexedWriteMethod - 用於寫入索引屬性值的方法。如果屬性是只讀的,則該參數可能為 null。
IntrospectionException - 如果在內省期間發生異常。| 方法詳細資訊 |
|---|
public Method getIndexedReadMethod()
public void setIndexedReadMethod(Method readMethod)
throws IntrospectionException
readMethod - 新的索引讀取方法。
IntrospectionExceptionpublic Method getIndexedWriteMethod()
public void setIndexedWriteMethod(Method writeMethod)
throws IntrospectionException
writeMethod - 新的索引寫入方法。
IntrospectionExceptionpublic Class<?> getIndexedPropertyType()
Class 物件。返回的 Class 可能描述諸如 int 的基本型別。
Class;如果型別無法確定,則可能返回 null。public boolean equals(Object obj)
PropertyDescriptor 與指定物件比較。如果物件是相同的,則返回 true。如果讀取、寫入、屬性型別、屬性編輯器和標記都是等同的,則兩個 PropertyDescriptor 是相同的。
PropertyDescriptor 中的 equalsobj - 要與之比較的參考物件。
true;否則返回 false。Object.hashCode(),
Hashtablepublic int hashCode()
Object.hashCode()。
PropertyDescriptor 中的 hashCodeObject.equals(java.lang.Object),
Hashtable
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。