public interface TypeDescription extends ByteCodeElement
| Modifier and Type | Interface and Description |
|---|---|
static class |
TypeDescription.AbstractTypeDescription
An abstract base implementation of a type description.
|
static class |
TypeDescription.ArrayProjection
A projection for an array type based on an existing
TypeDescription. |
static class |
TypeDescription.ForLoadedType
A type description implementation that represents a loaded type.
|
ModifierReviewable.AbstractModifierReviewable| Modifier and Type | Method and Description |
|---|---|
int |
getActualModifiers(boolean superFlag)
Returns the type's actual modifiers as present in the class file.
|
String |
getCanonicalName()
Returns the canonical internalName of this type.
|
TypeDescription |
getComponentType()
Returns the component type of this type.
|
FieldList |
getDeclaredFields()
Returns a list of fields that are declared by this type.
|
MethodList |
getDeclaredMethods()
Returns a list of methods that are declared by this type.
|
MethodDescription |
getEnclosingMethod()
Returns a description of the enclosing method of this type.
|
TypeDescription |
getEnclosingType()
Returns a description of the enclosing type of this type.
|
String |
getGenericSignature()
Returns the generic signature of this type or
null if no such signature is available. |
AnnotationList |
getInheritedAnnotations()
Returns the annotations that this type declares or inherits from super types.
|
TypeList |
getInheritedInterfaces()
Returns all interfaces that are implemented by this type, either directly or indirectly.
|
TypeList |
getInterfaces()
Returns a list of interfaces that are implemented by this type.
|
PackageDescription |
getPackage()
Returns the package internalName of the type described by this instance.
|
String |
getSimpleName()
Returns the simple internalName of this type.
|
StackSize |
getStackSize()
Returns the size of the type described by this instance.
|
TypeDescription |
getSupertype()
Returns the component type of this type.
|
boolean |
isAnonymousClass()
Checks if this type description represents an anonymous type.
|
boolean |
isArray()
Checks if the type described by this entity is an array.
|
boolean |
isAssignableFrom(Class<?> type)
Checks if this type is assignable from the type described by this instance, for example for
class Foo and class Bar extends Foo, this method would return true for
Foo.class.isAssignableFrom(Bar.class). |
boolean |
isAssignableFrom(TypeDescription typeDescription)
Checks if this type is assignable from the type described by this instance, for example for
class Foo and class Bar extends Foo, this method would return true for
Foo.class.isAssignableFrom(Bar.class). |
boolean |
isAssignableTo(Class<?> type)
Checks if this type is assignable from the type described by this instance, for example for
class Foo and class Bar extends Foo, this method would return true for
Bar.class.isAssignableTo(Foo.class). |
boolean |
isAssignableTo(TypeDescription typeDescription)
Checks if this type is assignable from the type described by this instance, for example for
class Foo and class Bar extends Foo, this method would return true for
Bar.class.isAssignableFrom(Foo.class). |
boolean |
isInstance(Object object)
Checks if
object is an instance of the type represented by this instance. |
boolean |
isLocalClass()
Checks if this type description represents a local type.
|
boolean |
isMemberClass()
Checks if this type description represents a member type.
|
boolean |
isPrimitive()
Checks if the type described by this entity is a primitive type.
|
boolean |
isSamePackage(TypeDescription typeDescription)
Checks if two types are defined in the same package.
|
boolean |
represents(Class<?> type)
Checks if the type described by this instance represents
type. |
getDescriptor, getInternalName, getSourceCodeName, isVisibleTogetNamegetModifiers, isAbstract, isAnnotation, isBridge, isDeprecated, isEnum, isFinal, isInterface, isMandated, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSuper, isSynchronized, isSynthetic, isTransient, isVarArgs, isVolatilegetDeclaringTypegetDeclaredAnnotationsboolean isInstance(Object object)
object is an instance of the type represented by this instance.object - The object of interest.true if the object is an instance of the type described by this instance.boolean isAssignableFrom(Class<?> type)
class Foo and class Bar extends Foo, this method would return true for
Foo.class.isAssignableFrom(Bar.class).type - The type of interest.true if this type is assignable from type.boolean isAssignableFrom(TypeDescription typeDescription)
class Foo and class Bar extends Foo, this method would return true for
Foo.class.isAssignableFrom(Bar.class).
Implementations of this methods are allowed to delegate to
isAssignableFrom(Class)typeDescription - The type of interest.true if this type is assignable from type.boolean isAssignableTo(Class<?> type)
class Foo and class Bar extends Foo, this method would return true for
Bar.class.isAssignableTo(Foo.class).type - The type of interest.true if this type is assignable to type.boolean isAssignableTo(TypeDescription typeDescription)
class Foo and class Bar extends Foo, this method would return true for
Bar.class.isAssignableFrom(Foo.class).
Implementations of this methods are allowed to delegate to
isAssignableTo(Class)typeDescription - The type of interest.true if this type is assignable to type.boolean represents(Class<?> type)
type.type - The type of interest.true if the type described by this instance represents type.boolean isArray()
true if this type description represents an array.TypeDescription getComponentType()
null if this type description does not represent an array.boolean isPrimitive()
true if this type description represents a primitive type.TypeDescription getSupertype()
null if type does not have a super type as for the
Object type.TypeList getInterfaces()
TypeList getInheritedInterfaces()
MethodDescription getEnclosingMethod()
null if there is no such method.TypeDescription getEnclosingType()
null if there is no such type.int getActualModifiers(boolean superFlag)
Returns the type's actual modifiers as present in the class file. For example, a type cannot be private.
but it modifiers might reflect this property nevertheless if a class was defined as a private inner class.
Unfortunately, the modifier for marking a static class collides with the SUPER modifier such
that these flags are indistinguishable. Therefore, the flag must be specified manually.
superFlag - true if the super flag should be set.String getSimpleName()
String getCanonicalName()
String getGenericSignature()
null if no such signature is available.
Note: Loaded classes do currently not provide such a signature.
getGenericSignature in interface ByteCodeElementnull if no such signature is available.boolean isAnonymousClass()
true if this type description represents an anonymous type.boolean isLocalClass()
true if this type description represents a local type.boolean isMemberClass()
true if this type description represents a member type.FieldList getDeclaredFields()
MethodList getDeclaredMethods()
PackageDescription getPackage()
StackSize getStackSize()
AnnotationList getInheritedAnnotations()
boolean isSamePackage(TypeDescription typeDescription)
typeDescription - The type of interest.true if this type and the given type are in the same package.Copyright © 2014. All rights reserved.