Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EJB_EXCEPTION_CLASS_NAME
Naming constant: The qualified name of
javax.ejb.EJBException . |
static java.lang.String |
EXTERNALIZABLE_CLASS_NAME
Naming constant: The qualified name of
java.io.Externalizable . |
static java.lang.String |
OBJECT_CLASS_NAME
Naming constant: The qualified name of
java.lang.Object . |
static java.lang.String |
REMOTE_EXCEPTION_CLASS_NAME
Naming constant: The qualified name of
java.rmi.RemoteException . |
static java.lang.String |
SERIALIZABLE_CLASS_NAME
Naming constant: The qualified name of
java.io.Serializable . |
Modifier and Type | Method and Description |
---|---|
java.util.List<? extends MethodInfo> |
getDeclaredConstructors()
Answer the declared constructors of the receiver.
|
java.util.List<? extends FieldInfo> |
getDeclaredFields()
Answer the declared fields of the receiver.
|
java.util.List<? extends MethodInfo> |
getDeclaredMethods()
Answer the declared methods of the receiver.
|
java.util.List<java.lang.String> |
getInterfaceNames()
Answer the names of the immediately declared interfaces of this
class object as a set.
|
java.util.List<? extends ClassInfo> |
getInterfaces()
Answer the immediately declared interfaces of this class object.
|
java.util.List<? extends MethodInfo> |
getMethods()
Answer the methods of the receiver.
|
PackageInfo |
getPackage()
Answer the package object of this class object.
|
java.lang.String |
getPackageName()
Answer the name of the package of this class object.
|
ClassInfo |
getSuperclass()
Answer the superclass of this class.
|
java.lang.String |
getSuperclassName()
Answer the name of the superclass of this class.
|
boolean |
isAnnotationClass()
Tell if this class object is for an annotation class.
|
boolean |
isArray()
Tell if this class object represents an array type.
|
boolean |
isArtificial()
Tell if this class info was created to represent an unloadable class.
|
boolean |
isAssignableFrom(java.lang.String className)
Tell if a variable of this type can be assigned a value having
a specified type, as specified by the name of the type.
|
boolean |
isDelayedClass()
Tell if this class object is implemented as a delayed class (as opposed to
a non-delayed class).
|
boolean |
isFieldAnnotationPresent()
Tell if this class object has an annotations on a field.
|
boolean |
isInstanceOf(java.lang.Class<?> clazz) |
boolean |
isInstanceOf(java.lang.String className)
Tell if this type is a sub-type of another type.
|
boolean |
isInterface()
Tell if this class object represents an interface (that is, is defined using the
keyword
interface , as opposed to representing a concrete (although possibly
abstract) class. |
boolean |
isJavaClass()
Tell if this class object encodes a distinguished java class.
|
boolean |
isMethodAnnotationPresent()
Tell if this class object has an annotations on a method.
|
boolean |
isNonDelayedClass()
Tell if this class object is implemented as a non-delayed class (as opposed to
a delayed class).
|
boolean |
isPrimitive()
Tell if this class object represents a primitive type (for
example,
int ). |
getAnnotation, getAnnotation, getAnnotations, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotations, getHashText, getInfoStore, getModifiers, getName, getQualifiedName, isAnnotationPresent, isAnnotationPresent, isAnnotationWithin, isDeclaredAnnotationPresent, isDeclaredAnnotationPresent, isDeclaredAnnotationWithin, isPackagePrivate, isPrivate, isProtected, isPublic, log
static final java.lang.String OBJECT_CLASS_NAME
Naming constant: The qualified name of java.lang.Object
.
static final java.lang.String SERIALIZABLE_CLASS_NAME
Naming constant: The qualified name of java.io.Serializable
.
static final java.lang.String EXTERNALIZABLE_CLASS_NAME
Naming constant: The qualified name of java.io.Externalizable
.
static final java.lang.String REMOTE_EXCEPTION_CLASS_NAME
Naming constant: The qualified name of java.rmi.RemoteException
.
static final java.lang.String EJB_EXCEPTION_CLASS_NAME
Naming constant: The qualified name of javax.ejb.EJBException
.
boolean isArtificial()
Tell if this class info was created to represent an unloadable class. Stub values are assigned, and the interface and superclass values are forced.
boolean isArray()
Tell if this class object represents an array type.
boolean isPrimitive()
Tell if this class object represents a primitive type (for
example, int
).
boolean isDelayedClass()
Tell if this class object is implemented as a delayed class (as opposed to a non-delayed class).
A delayed class will have a backing non-delayed class. Whether a class object
is returned as a delayed or as a non-delayed class object is a detail of the
implementation. However, the expectation is that frequently used classes (for example,
classes from java.lang
are never returned as delayed classes. Very
likely, classes with annotations will not be returned as delayed classes.
isNonDelayedClass()
boolean isNonDelayedClass()
Tell if this class object is implemented as a non-delayed class (as opposed to a delayed class).
isDelayedClass()
java.lang.String getPackageName()
Answer the name of the package of this class object.
Retrieval of the package name is preferred to retrieving the entire package object.
getPackage()
PackageInfo getPackage()
Answer the package object of this class object.
Retrieval of the package name is preferred to retrieving the entire package object.
getPackageName()
boolean isJavaClass()
Tell if this class object encodes a distinguished java class. Which java classes
are distinguished is an implementation detail. (The current implementation distinguishes
all classes under java
, as well as all class under javax.ejb
and all classes under javax.servlet
.) Classes are distinguished
to assist in telling which classes are to be delayed.
boolean isInterface()
Tell if this class object represents an interface (that is, is defined using the
keyword interface
, as opposed to representing a concrete (although possibly
abstract) class.
java.util.List<java.lang.String> getInterfaceNames()
Answer the names of the immediately declared interfaces of this class object as a set.
#getInterfaceNamesArray()
,
getInterfaces()
,
#getAllInterfaceNames()
,
#getAllInterfaces()
java.util.List<? extends ClassInfo> getInterfaces()
Answer the immediately declared interfaces of this class object.
Retrieval of the interface names is preferred to retrieval of the class objects of the interfaces.
#getInterfaceNamesArray()
,
getInterfaceNames()
,
#getAllInterfaceNames()
,
#getAllInterfaces()
boolean isAnnotationClass()
Tell if this class object is for an annotation class. That is,
whether java.lang.annotation.Annotation
is one of the
interfaces of the class.
java.lang.String getSuperclassName()
Answer the name of the superclass of this class. An interface
has a null superclass name. The root class java.lang.Object
has a null superclass name. All other classes have a non-null
superclass name.
Retrieval of the superclass name is preferred to retrieving the superclass object.
java.lang.Object
isInterface()
,
getSuperclass()
ClassInfo getSuperclass()
Answer the superclass of this class. An interface has a null superclass.
The root class java.lang.Object
has a null superclass. All other
classes have a non-null
superclass name.
Retrieval of the superclass name is preferred to retrieving the superclass object.
java.lang.Object
isInterface()
,
getSuperclassName()
boolean isAssignableFrom(java.lang.String className)
Tell if a variable of this type can be assigned a value having a specified type, as specified by the name of the type.
That is, is the type as represented by this class object coarser (the same or strictly coarser) than the specified type.
Assignment tests are the reverse of instance-of tests. That is, if type X is assignable from type Y, then Y is an instance of X. Conversely, if Y is an instance of X, then X is assignable from Y.
The
- name of the type which is to be tested.#isAssignableFrom(ClassInfo)
,
#isAssignableFrom(Class)
,
isInstanceOf(String)
,
#isInstanceOf(ClassInfo)
,
isInstanceOf(Class)
boolean isInstanceOf(java.lang.String className)
Tell if this type is a sub-type of another type. The other type is specified by the name of the type.
That is, is the type as represented by this class object finer (the same or strictly finer) than the specified type.
Instance-of tests are the reverse of assignment tests. That is, if type X is an instance of type Y, then Y is assignable from of X. Conversely, if Y is assignable from X, then X is an instance of Y.
The
- name of the type which is to be tested.isAssignableFrom(String)
,
#isAssignableFrom(ClassInfo)
,
#isAssignableFrom(Class)
boolean isInstanceOf(java.lang.Class<?> clazz)
java.util.List<? extends FieldInfo> getDeclaredFields()
Answer the declared fields of the receiver.
The result collection does not support additions.
#getFields()
java.util.List<? extends MethodInfo> getDeclaredConstructors()
Answer the declared constructors of the receiver.
The result collection does not support additions.
Note: The difference between #getDeclaredConstructor()
and #getConstructors()
is not clear, as constructors are not
inherited.
#getConstructors()
java.util.List<? extends MethodInfo> getDeclaredMethods()
Answer the declared methods of the receiver.
The result collection does not support additions.
getMethods()
java.util.List<? extends MethodInfo> getMethods()
Answer the methods of the receiver. These are the methods, plus any acquired through inheritance.
The result collection does not support additions.
getDeclaredFields()
boolean isFieldAnnotationPresent()
Tell if this class object has an annotations on a field. (Annotations other than declared annotations are those which are added as a result of applications of JSR250.)
isMethodAnnotationPresent()
boolean isMethodAnnotationPresent()
Tell if this class object has an annotations on a method. (Annotations other than declared annotations are those which are added as a result of applications of JSR250.)
isFieldAnnotationPresent()