Java Reference
In-Depth Information
public boolean isLocalClass()
Returns true if this class represents a local inner class.
public boolean isAnonymousClass()
Returns true if this class represents an anonymous inner
class.
Note that there is no way to determine if a member class is a static nes-
ted class or an inner class.
The example showed the two methods you can use to find out where a
type fits in the type hierarchy:
public Type[] getGenericInterfaces()
Returns an array of Type objects for each of the interfaces im-
plemented by this type. If no interfaces are implemented you
will get a zero-length array. If an implemented interface is a
parameterized type, then the Type object will be an instance
of ParameterizedType ; otherwise, the Type object will be a Class
object.
public Type getGenericSuperclass()
Returns the Type object for the superclass of this type. This
returns null if this Class object represents the Object class, an
interface, void , or primitive type, since these have no super-
class. If this Class object represents an array, the Class object
for Object is returned. By invoking this recursively you can de-
termine all superclasses of a class. If the superclass is a para-
meterized type, the Type object will be an instance of Paramet-
erizedType ; otherwise, the Type object will be a Class object.
The legacy methods getInterfaces and getSuperclass are similar to the
above except they return Class objects instead of Type objects. Any para-
 
Search WWH ::




Custom Search