public static class TypeDescription.ForLoadedType extends TypeDescription.AbstractBase implements Serializable
TypeDescription.AbstractBase.OfSimpleTypeTypeDescription.AbstractBase, TypeDescription.ArrayProjection, TypeDescription.ForLoadedType, TypeDescription.ForPackageDescription, TypeDescription.Generic, TypeDescription.LatentTypeDefinition.Sort, TypeDefinition.SuperClassIteratorModifierReviewable.ForFieldDescription, ModifierReviewable.ForMethodDescription, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumerationByteCodeElement.Token<T extends ByteCodeElement.Token<T>>, ByteCodeElement.TypeDependant<T extends ByteCodeElement.TypeDependant<?,S>,S extends ByteCodeElement.Token<S>>NamedElement.WithGenericName, NamedElement.WithOptionalName, NamedElement.WithRuntimeNameTypeVariableSource.Visitor<T>ARRAY_INTERFACES, CLASS, OBJECT, STRING, THROWABLE, UNDEFINED, VOIDEMPTY_MASKNON_GENERIC_SIGNATUREEMPTY_NAME, NO_NAME| 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 the fields that this type declares.
|
MethodList<MethodDescription.InDefinedShape> |
getDeclaredMethods()
Returns the methods that this type declares.
|
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 method that encloses this type.
|
TypeDescription |
getEnclosingType()
Returns a description of this type's enclosing type if any.
|
TypeList.Generic |
getInterfaces()
Returns the interfaces that this type implements.
|
int |
getModifiers()
Returns the modifier that is described by this object.
|
String |
getName()
Returns the internalName of this byte code element.
|
static String |
getName(Class<?> type)
Returns the type's actual name where it is taken into consideration that this type might be loaded anonymously.
|
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.Generic |
getSuperClass()
Returns the super class of this type.
|
TypeList.Generic |
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, asErasure, asGenericType, equals, getActualModifiers, getActualName, getEnclosingSource, getGenericSignature, getInheritedAnnotations, getInternalName, getSegmentCount, getSort, getTypeName, hashCode, isAnnotationReturnType, isAnnotationValue, isAnnotationValue, isAssignableFrom, isAssignableTo, isConstantPool, isGenericDeclaration, isInstance, isInstanceOrWrapper, isPackageType, isPrimitiveWrapper, isSamePackage, isVisibleTo, iterator, toStringfindVariableisAbstract, isBridge, isDeprecated, isEnum, isFinal, isInterface, isMandated, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSynchronized, isSynthetic, isTransient, isVarArgs, isVolatileclone, finalize, getClass, notify, notifyAll, wait, wait, waitisInterfaceisAbstractisEnumisDeprecated, isPackagePrivate, isPrivate, isProtected, isPublic, isStaticisFinal, isSyntheticforEach, spliteratorfindVariablepublic ForLoadedType(Class<?> type)
type - The type to be represented by this type description.public static String getName(Class<?> type)
/<id> which is removed when using this method
but is retained when calling Class.getName().type - The type for which to resolve its name.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)
TypeDefinitiontype.represents in interface TypeDefinitionrepresents in class TypeDescription.AbstractBasetype - The type of interest.true if the type described by this instance represents type.public TypeDescription getComponentType()
TypeDefinitionReturns the component type of this type.
Only non-generic types (TypeDescription.Generic.Sort#NON_GENERIC) and generic array types
TypeDescription.Generic.Sort#GENERIC_ARRAY) define a component type. For other
types, an IllegalStateException is thrown.
getComponentType in interface TypeDefinitiongetComponentType in interface TypeDescriptionnull if this type does not represent an array type.public boolean isArray()
TypeDefinitionisArray in interface TypeDefinitiontrue if this type description represents an array.public boolean isPrimitive()
TypeDefinitionisPrimitive in interface TypeDefinitiontrue if this type description represents a primitive type.public boolean isAnnotation()
ModifierReviewable.ForTypeDefinitionisAnnotation in interface ModifierReviewable.ForTypeDefinitionisAnnotation in class ModifierReviewable.AbstractBasetrue if the modifier described by this object represents the annotation flag.public TypeDescription.Generic getSuperClass()
TypeDefinitionTypeDefinition.Sort.NON_GENERIC),
parameterized types (TypeDefinition.Sort.PARAMETERIZED) or generic array types (TypeDefinition.Sort.GENERIC_ARRAY) types. Interface types
and the Object class do not define a super class where null is returned. Array types define Object
as their direct super class.getSuperClass in interface TypeDefinitionnull if no super class exists for this type.public TypeList.Generic getInterfaces()
TypeDefinitionTypeDefinition.Sort.NON_GENERIC),
parameterized types (TypeDefinition.Sort.PARAMETERIZED) or generic array types (TypeDefinition.Sort.GENERIC_ARRAY) types.getInterfaces in interface TypeDefinitionpublic TypeDescription getDeclaringType()
DeclaredByTypegetDeclaringType in interface DeclaredByTypegetDeclaringType in interface TypeDescriptionnull if no such type exists.public MethodDescription getEnclosingMethod()
TypeDescriptionnull is returned by this method.getEnclosingMethod in interface TypeDescriptionnull if there is no such method.public TypeDescription getEnclosingType()
TypeDescriptiongetEnclosingType in interface TypeDescriptionnull if there is no such type.public TypeList getDeclaredTypes()
TypeDescriptiongetDeclaredTypes in interface TypeDescriptionpublic String getSimpleName()
TypeDescriptiongetSimpleName in interface TypeDescriptionpublic boolean isAnonymousClass()
TypeDescriptionisAnonymousClass in interface TypeDescriptiontrue if this type description represents an anonymous type.public boolean isLocalClass()
TypeDescriptionisLocalClass in interface TypeDescriptiontrue if this type description represents a local type.public boolean isMemberClass()
TypeDescriptionisMemberClass in interface TypeDescriptiontrue if this type description represents a member type.public FieldList<FieldDescription.InDefinedShape> getDeclaredFields()
TypeDefinitionTypeDefinition.Sort.NON_GENERIC),
parameterized types (TypeDefinition.Sort.PARAMETERIZED) or generic array types (TypeDefinition.Sort.GENERIC_ARRAY) types. Generic array
types never define fields and the returned list is always empty for such types.getDeclaredFields in interface TypeDefinitiongetDeclaredFields in interface TypeDescriptionTypeDefinition.Sort.NON_GENERIC),
parameterized types (TypeDefinition.Sort.PARAMETERIZED) or generic array types (TypeDefinition.Sort.GENERIC_ARRAY) types. Generic array
types never define methods and the returned list is always empty for such types.public MethodList<MethodDescription.InDefinedShape> getDeclaredMethods()
TypeDefinitiongetDeclaredMethods in interface TypeDefinitiongetDeclaredMethods in interface TypeDescriptionpublic PackageDescription getPackage()
TypeDescriptiongetPackage in interface TypeDescriptionpublic StackSize getStackSize()
TypeDefinitionTypeDescription.Generic.Sort#WILDCARD do not have a well-defined a stack size and
cause an IllegalStateException to be thrown.getStackSize in interface TypeDefinitionpublic String getName()
NamedElement.WithRuntimeNamegetName in interface NamedElement.WithRuntimeNamepublic String getCanonicalName()
TypeDescriptiongetCanonicalName in interface TypeDescriptionnull.public String getDescriptor()
ByteCodeElementgetDescriptor in interface ByteCodeElementpublic int getModifiers()
ModifierReviewablegetModifiers in interface ModifierReviewablepublic TypeList.Generic getTypeVariables()
TypeVariableSourcegetTypeVariables in interface TypeVariableSourcepublic AnnotationList getDeclaredAnnotations()
AnnotatedCodeElementgetDeclaredAnnotations in interface AnnotatedCodeElementCopyright © 2014–2016. All rights reserved.