|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pf.reflect.ClassInfo
public class ClassInfo
Contains the name of a class and the class itself. It can create new instances.
| Field Summary | |
|---|---|
static java.lang.Object[] |
EMPTY_OBJECT_ARRAY
|
| Constructor Summary | |
|---|---|
ClassInfo(java.lang.Class aClass)
Initialize the new instance with a class. |
|
ClassInfo(java.lang.Class aClass,
boolean singleton)
Initialize the new instance with a class. |
|
ClassInfo(java.lang.String className)
Initialize the new instance with a class name. |
|
ClassInfo(java.lang.String className,
boolean singleton)
Initialize the new instance with a class name and a flag if it is a singleton. |
|
| Method Summary | |
|---|---|
java.lang.Object |
createInstance()
Returns a new instance of the class or null in any case of error. |
java.lang.String |
getClassName()
Returns the name of the class, this object represents. |
java.lang.Class |
getClassObject()
Returns the the class object. |
java.lang.Object |
getInstance()
Returns either a new instance of the underlying class or always the identical instance if it is defined to be a singleton. |
boolean |
isAssignableFrom(java.lang.Class type)
Determines if the class or interface represented by this ClassInfo object is either the same as, or is a superclass or superinterface of, the class or interface represented by the specified Class parameter. |
boolean |
isAssignableTo(java.lang.Class type)
Determines if the class or interface represented by the specified class parameter is either the same as, or is a superclass or superinterface of, the class or interface represented by this ClassInfo object. |
boolean |
isInstance(java.lang.Object object)
Determines if the specified Object is assignment-compatible with the object represented by this ClassInfo. |
boolean |
isSingleton()
|
java.lang.Object[] |
newArray(int size)
Returns a new array of the type represented by this ClassInfo. |
java.lang.Object |
newInstance()
Returns a new instance of the class. |
void |
setClassName(java.lang.String className)
Set the name of the class this object should represent. |
void |
setClassObject(java.lang.Class aClass)
Set the class object. |
void |
setIsSingleton(boolean newValue)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.Object[] EMPTY_OBJECT_ARRAY
| Constructor Detail |
|---|
public ClassInfo(java.lang.String className)
className - The name of the class the new object should represent.
public ClassInfo(java.lang.String className,
boolean singleton)
className - The name of the class the new object should represent.singleton - if true method getInstance() will return always the identical instancepublic ClassInfo(java.lang.Class aClass)
aClass - The class the new object should represent.
public ClassInfo(java.lang.Class aClass,
boolean singleton)
aClass - The class the new object should represent.singleton - if true method getInstance() will return always the identical instance| Method Detail |
|---|
public boolean isSingleton()
public void setIsSingleton(boolean newValue)
public boolean isAssignableFrom(java.lang.Class type)
type - the Class object to be checkedpublic boolean isAssignableTo(java.lang.Class type)
type - the Class object to be checkedpublic boolean isInstance(java.lang.Object object)
object - the object to checkpublic java.lang.String getClassName()
public void setClassName(java.lang.String className)
className - A fully qualified class namepublic java.lang.Class getClassObject()
public void setClassObject(java.lang.Class aClass)
aClass - A classpublic java.lang.Object getInstance()
isSingleton(),
setIsSingleton(boolean)public java.lang.Object createInstance()
newInstance.
newInstance()
public java.lang.Object newInstance()
throws java.lang.ClassNotFoundException,
java.lang.InstantiationException,
java.lang.IllegalAccessException
java.lang.ClassNotFoundException - If the class represented by this object can't be found
java.lang.InstantiationException - If no none-argument constructor is available/visible
java.lang.IllegalAccessException - If for security reasons the instance creation of this class prohibitedcreateInstance()public java.lang.Object[] newArray(int size)
size - The number of elements the new array whould have (must not be negative)
java.lang.NullPointerException - if the specified componentType parameter is null
java.lang.IllegalArgumentException - if componentType is Void.TYPE
java.lang.NegativeArraySizeException - if the specified length is negativepublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||