public static class TypeDescription.ForLoadedType extends TypeDescription.AbstractTypeDescription
TypeDescription.AbstractTypeDescription.OfSimpleTypeTypeDescription.AbstractTypeDescription, TypeDescription.ArrayProjection, TypeDescription.ForLoadedType, TypeDescription.LatentModifierReviewable.AbstractModifierReviewableCLASS, ENUM, OBJECT, STRING, VOIDEMPTY_NAMEEMPTY_MASK| Constructor and Description |
|---|
ForLoadedType(Class<?> type)
Creates a new immutable type description for a loaded type.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getCanonicalName()
Returns the canonical internalName of this type.
|
TypeDescription |
getComponentType()
Returns the component type of this type.
|
AnnotationList |
getDeclaredAnnotations()
Returns a list of annotations that are declared by this instance.
|
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.
|
TypeDescription |
getDeclaringType()
Returns the declaring type of this instance.
|
String |
getDescriptor()
Returns the descriptor of this byte code element.
|
MethodDescription |
getEnclosingMethod()
Returns a description of the enclosing method of this type.
|
TypeDescription |
getEnclosingType()
Returns a description of the enclosing type of this type.
|
AnnotationList |
getInheritedAnnotations()
Returns the annotations that this type declares or inherits from super types.
|
TypeList |
getInterfaces()
Returns a list of interfaces that are implemented by this type.
|
int |
getModifiers()
Returns the modifier that is described by this object.
|
String |
getName()
Returns the internalName of this byte code element.
|
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 |
isAnnotation()
Specifies if the modifier described by this object represents the annotation flag.
|
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 value)
Checks if
value is an instance of the type represented by this instance. |
boolean |
isInterface()
Specifies if the modifier described by this object represents the interface flag.
|
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 |
represents(Class<?> type)
Checks if the type described by this instance represents
type. |
equals, getActualModifiers, getGenericSignature, getInheritedInterfaces, getInternalName, getPackageName, getSourceCodeName, hashCode, isAnnotationReturnType, isAnnotationValue, isAnnotationValue, isConstantPool, isInstanceOrWrapper, isPrimitiveWrapper, isSamePackage, isVisibleTo, toStringisAbstract, isBridge, isDeprecated, isEnum, isFinal, isMandated, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSuper, isSynchronized, isSynthetic, isTransient, isVarArgs, isVolatileclone, finalize, getClass, notify, notifyAll, wait, wait, waitisAbstract, isBridge, isDeprecated, isEnum, isFinal, isMandated, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSuper, isSynchronized, isSynthetic, isTransient, isVarArgs, isVolatilepublic ForLoadedType(Class<?> type)
type - The type to be represented by this type description.public boolean isInstance(Object value)
TypeDescriptionvalue is an instance of the type represented by this instance.isInstance in interface TypeDescriptionisInstance in class TypeDescription.AbstractTypeDescriptionvalue - The object of interest.true if the object is an instance of the type described by this instance.public boolean isAssignableFrom(Class<?> type)
TypeDescriptionclass 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.public boolean isAssignableFrom(TypeDescription typeDescription)
TypeDescriptionclass 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
TypeDescription.isAssignableFrom(Class)typeDescription - The type of interest.true if this type is assignable from type.public boolean isAssignableTo(Class<?> type)
TypeDescriptionclass 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.public boolean isAssignableTo(TypeDescription typeDescription)
TypeDescriptionclass 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
TypeDescription.isAssignableTo(Class)typeDescription - The type of interest.true if this type is assignable to type.public boolean represents(Class<?> type)
TypeDescriptiontype.type - The type of interest.true if the type described by this instance represents type.public boolean isInterface()
ModifierReviewableisInterface in interface ModifierReviewableisInterface in class ModifierReviewable.AbstractModifierReviewabletrue if the modifier described by this object represents the interface flag.public boolean isArray()
TypeDescriptiontrue if this type description represents an array.public TypeDescription getComponentType()
TypeDescriptionnull if this type description does not represent an array.public boolean isPrimitive()
TypeDescriptiontrue if this type description represents a primitive type.public boolean isAnnotation()
ModifierReviewableisAnnotation in interface ModifierReviewableisAnnotation in class ModifierReviewable.AbstractModifierReviewabletrue if the modifier described by this object represents the annotation flag.public TypeDescription getSupertype()
TypeDescriptionnull if type does not have a super type as for the
Object type.public TypeList getInterfaces()
TypeDescriptionpublic TypeDescription getDeclaringType()
DeclaredInTypenull if no such type exists.public MethodDescription getEnclosingMethod()
TypeDescriptionnull if there is no such method.public TypeDescription getEnclosingType()
TypeDescriptionnull if there is no such type.public String getSimpleName()
TypeDescriptionpublic String getCanonicalName()
TypeDescriptionpublic boolean isAnonymousClass()
TypeDescriptiontrue if this type description represents an anonymous type.public boolean isLocalClass()
TypeDescriptiontrue if this type description represents a local type.public boolean isMemberClass()
TypeDescriptiontrue if this type description represents a member type.public FieldList getDeclaredFields()
TypeDescriptionpublic MethodList getDeclaredMethods()
TypeDescriptionpublic PackageDescription getPackage()
TypeDescriptionpublic StackSize getStackSize()
TypeDescriptionpublic String getName()
NamedElementpublic String getDescriptor()
ByteCodeElementpublic int getModifiers()
ModifierReviewablepublic AnnotationList getDeclaredAnnotations()
AnnotatedCodeElementpublic AnnotationList getInheritedAnnotations()
TypeDescriptiongetInheritedAnnotations in interface TypeDescriptiongetInheritedAnnotations in class TypeDescription.AbstractTypeDescriptionCopyright © 2014–2015. All rights reserved.