JavaTM 2 Platform
Standard Ed. 6

類別 java.lang.reflect.Constructor
的使用

使用 Constructor 的軟體套件
java.lang 提供利用 Java 程式語言進行程序設計的基礎類別。 
javax.management 提供 Java Management Extensions 的核心類別。 
javax.management.modelmbean 提供了 ModelMBean 類別的定義。 
 

java.lang 中 Constructor 的使用
 

返回 Constructor 的 java.lang 中的方法
 Constructor<T> Class.getConstructor(Class<?>... parameterTypes)
          返回一個 Constructor 物件,它反映此 Class 物件所表示的類別的指定公共建構子。
 Constructor<?>[] Class.getConstructors()
          返回一個套件含某些 Constructor 物件的陣列,這些物件反映此 Class 物件所表示的類別的所有公共建構子。
 Constructor<T> Class.getDeclaredConstructor(Class<?>... parameterTypes)
          返回一個 Constructor 物件,該物件反映此 Class 物件所表示的類別或介面的指定建構子。
 Constructor<?>[] Class.getDeclaredConstructors()
          返回 Constructor 物件的一個陣列,這些物件反映此 Class 物件表示的類別宣告的所有建構子。
 Constructor<?> Class.getEnclosingConstructor()
          如果該 Class 物件表示建構子中的一個本地或匿名類別,則返回 Constructor 物件,它表示底層類別的立即封閉建構子。
 

javax.management 中 Constructor 的使用
 

參數型別為 Constructor 的 javax.management 中的建構子
MBeanConstructorInfo(String description, Constructor constructor)
          建構一個 MBeanConstructorInfo 物件。
 

javax.management.modelmbean 中 Constructor 的使用
 

參數型別為 Constructor 的 javax.management.modelmbean 中的建構子
ModelMBeanConstructorInfo(String description, Constructor constructorMethod)
          建構帶有預設描述符的 ModelMBeanConstructorInfo 物件。
ModelMBeanConstructorInfo(String description, Constructor constructorMethod, Descriptor descriptor)
          建構 ModelMBeanConstructorInfo 物件。
 


JavaTM 2 Platform
Standard Ed. 6

提交錯誤或意見

版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。