public static class TypeDescription.ForLoadedType extends TypeDescription.AbstractBase
TypeDescription.AbstractBase.OfSimpleType, TypeDescription.AbstractBase.RawTypeWrapperTypeDescription.AbstractBase, TypeDescription.ArrayProjection, TypeDescription.ForLoadedType, TypeDescription.ForPackageDescription, TypeDescription.LatentGenericTypeDescription.ForGenericArray, GenericTypeDescription.ForNonGenericType, GenericTypeDescription.ForParameterizedType, GenericTypeDescription.ForTypeVariable, GenericTypeDescription.ForWildcardType, GenericTypeDescription.LazyProjection, GenericTypeDescription.Sort, GenericTypeDescription.SuperTypeIterator, GenericTypeDescription.Visitor<T>TypeVariableSource.Visitor<T>ByteCodeElement.Accessible, ByteCodeElement.Token<T extends ByteCodeElement.Token<T>>, ByteCodeElement.TypeDependant<T extends ByteCodeElement.TypeDependant<?,S>,S extends ByteCodeElement.Token<S>>NamedElement.WithGenericName, NamedElement.WithRuntimeNameARRAY_INTERFACES, ARRAY_MODIFIERS, CLASS, ENUM, OBJECT, STRING, UNDEFINED, VOIDNON_GENERIC_SIGNATUREEMPTY_NAME, NO_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 name of this type if it exists.
|
TypeDescription |
getComponentType()
Returns the component type of this type.
|
AnnotationList |
getDeclaredAnnotations()
Returns a list of annotations that are declared by this instance.
|
FieldList<FieldDescription.InDefinedShape> |
getDeclaredFields()
Returns a list of field descriptions that are declared by this type.
|
GenericTypeList |
getDeclaredInterfaces()
Returns the declared interface types in the form they are declared in the class file.
|
MethodList<MethodDescription.InDefinedShape> |
getDeclaredMethods()
Returns a list of method descriptions that are declared by this type.
|
GenericTypeDescription |
getDeclaredSuperType()
Returns the declared super type in the form it is declared in the class file.
|
TypeList |
getDeclaredTypes()
Returns a list of types that are declared by this type excluding anonymous classes.
|
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.
|
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.
|
GenericTypeList |
getTypeVariables()
Returns the type variables that are declared by this element.
|
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 |
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 |
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(Type type)
Checks if the type described by this instance represents
type. |
accept, accept, asErasure, equals, findVariable, getActualModifiers, getEnclosingSource, getGenericSignature, getInheritedAnnotations, getInterfaces, getInternalName, getLowerBounds, getOwnerType, getParameters, getSort, getSourceCodeName, getSuperType, getSymbol, getTypeName, getUpperBounds, getVariableSource, hashCode, isAnnotationReturnType, isAnnotationValue, isAnnotationValue, isAssignableFrom, isAssignableTo, isConstantPool, isInstance, isInstanceOrWrapper, isPrimitiveWrapper, isSamePackage, isVisibleTo, iterator, toStringisAbstract, isBridge, isDeprecated, isEnum, isFinal, isInterface, isMandated, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSuper, isSynchronized, isSynthetic, isTransient, isVarArgs, isVolatileclone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorisAbstract, isBridge, isDeprecated, isEnum, isFinal, isInterface, 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 isAssignableFrom(Class<?> type)
TypeDescriptionclass Foo and class Bar extends Foo, this method would return true for
Foo.class.isAssignableFrom(Bar.class).isAssignableFrom in interface TypeDescriptionisAssignableFrom in class TypeDescription.AbstractBasetype - 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).isAssignableTo in interface TypeDescriptionisAssignableTo in class TypeDescription.AbstractBasetype - The type of interest.true if this type is assignable to type.public boolean represents(Type type)
GenericTypeDescriptiontype.represents in interface GenericTypeDescriptionrepresents in class TypeDescription.AbstractBasetype - The type of interest.true if the type described by this instance represents type.public TypeDescription getComponentType()
GenericTypeDescriptionReturns the component type of this type.
Only non-generic types (GenericTypeDescription.Sort.NON_GENERIC) and generic array types
GenericTypeDescription.Sort.GENERIC_ARRAY) define a component type. For other
types, an IllegalStateException is thrown.
null if this type does not represent an array type.public boolean isArray()
GenericTypeDescriptiontrue if this type description represents an array.public boolean isPrimitive()
GenericTypeDescriptiontrue if this type description represents a primitive type.public boolean isAnnotation()
ModifierReviewableisAnnotation in interface ModifierReviewableisAnnotation in class ModifierReviewable.AbstractBasetrue if the modifier described by this object represents the annotation flag.public GenericTypeDescription getDeclaredSuperType()
TypeDescription.AbstractBasegetDeclaredSuperType in class TypeDescription.AbstractBasepublic GenericTypeList getDeclaredInterfaces()
TypeDescription.AbstractBasegetDeclaredInterfaces in class TypeDescription.AbstractBasepublic TypeDescription getDeclaringType()
DeclaredByTypenull 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 TypeList getDeclaredTypes()
TypeDescriptionpublic String getSimpleName()
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<FieldDescription.InDefinedShape> getDeclaredFields()
GenericTypeDescriptionReturns a list of field descriptions that are declared by this type. For parameterized types, all type variables of these fields are resolved to the values of the type variables.
Only non-generic types (GenericTypeDescription.Sort.NON_GENERIC) and parameterized types
(GenericTypeDescription.Sort.PARAMETERIZED) define a super type. For a generic array type,
(GenericTypeDescription.Sort.GENERIC_ARRAY), an empty list is returned. For other generic
types, an IllegalStateException is thrown.
public MethodList<MethodDescription.InDefinedShape> getDeclaredMethods()
GenericTypeDescriptionReturns a list of method descriptions that are declared by this type. For parameterized types, all type variables used by these methods are resolved to the values of the type variables.
Only non-generic types (GenericTypeDescription.Sort.NON_GENERIC) and parameterized types
(GenericTypeDescription.Sort.PARAMETERIZED) define a super type. For a generic array type,
(GenericTypeDescription.Sort.GENERIC_ARRAY), an empty list is returned. For other
generic types, an IllegalStateException is thrown.
public PackageDescription getPackage()
TypeDescriptionpublic StackSize getStackSize()
GenericTypeDescriptionGenericTypeDescription.Sort.WILDCARD do not have a well-defined a stack size and
cause an IllegalStateException to be thrown.public String getName()
NamedElement.WithRuntimeNamepublic String getCanonicalName()
TypeDescriptionnull.public String getDescriptor()
ByteCodeElementpublic int getModifiers()
ModifierReviewablepublic GenericTypeList getTypeVariables()
TypeVariableSourcepublic AnnotationList getDeclaredAnnotations()
AnnotatedCodeElementCopyright © 2014–2015. All rights reserved.