public abstract static class TypeDescription.AbstractBase extends TypeVariableSource.AbstractBase implements TypeDescription
| Modifier and Type | Class and Description |
|---|---|
static class |
TypeDescription.AbstractBase.OfSimpleType
An adapter implementation of a
TypeDescription that
describes any type that is not an array or a primitive type. |
TypeDescription.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 |
|---|
AbstractBase() |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
accept(TypeVariableSource.Visitor<T> visitor)
Applies a visitor on this type variable source.
|
TypeDescription |
asErasure()
Returns the erasure of this type.
|
TypeDescription.Generic |
asGenericType()
Returns this type definition as a generic type.
|
boolean |
equals(Object other) |
int |
getActualModifiers(boolean superFlag)
Returns the type's actual modifiers as present in the class file.
|
String |
getActualName()
Returns the name of this element as it is found in the source code.
|
TypeVariableSource |
getEnclosingSource()
Returns the enclosing source of type variables that are valid in the scope of this type variable source.
|
String |
getGenericSignature()
Returns the generic signature of this byte code element.
|
AnnotationList |
getInheritedAnnotations()
Returns the annotations that this type declares or inherits from super types.
|
String |
getInternalName()
Returns the internal internalName of this byte code element.
|
int |
getSegmentCount()
Returns the amount of outer classes this type defines.
|
TypeDefinition.Sort |
getSort()
Returns the sort of the generic type this instance represents.
|
String |
getTypeName()
Returns the name of the type.
|
int |
hashCode() |
boolean |
isAnnotationReturnType()
Checks if instances of this type can be returned from an annotation method.
|
boolean |
isAnnotationValue()
Checks if instances of this type can be used for describing an annotation value.
|
boolean |
isAnnotationValue(Object value)
Checks if instances of this type can be used for describing the given annotation value.
|
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 |
isConstantPool()
Checks if instances of this type can be stored in the constant pool of a class.
|
boolean |
isGenericDeclaration()
Checks if this type variable source has a generic declaration.
|
boolean |
isInstance(Object value)
Checks if
value is an instance of the type represented by this instance. |
boolean |
isInstanceOrWrapper(Object value)
Checks if
value is an instance of the type represented by this instance or a wrapper instance of the
corresponding primitive value. |
boolean |
isPackageType()
Checks if this type represents a class that is a place holder for a package description.
|
boolean |
isPrimitiveWrapper()
Checks if this type represents a wrapper type for a primitive type.
|
boolean |
isSamePackage(TypeDescription typeDescription)
Checks if two types are defined in the same package.
|
boolean |
isVisibleTo(TypeDescription typeDescription)
Checks if this element is visible from a given type.
|
Iterator<TypeDefinition> |
iterator() |
boolean |
represents(Type type)
Checks if the type described by this instance represents
type. |
String |
toString() |
findVariableisAbstract, isAnnotation, isBridge, isDeprecated, isEnum, isFinal, isInterface, isMandated, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSynchronized, isSynthetic, isTransient, isVarArgs, isVolatileclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetCanonicalName, getComponentType, getDeclaredFields, getDeclaredMethods, getDeclaredTypes, getDeclaringType, getEnclosingMethod, getEnclosingType, getPackage, getSimpleName, isAnonymousClass, isLocalClass, isMemberClassgetInterfaces, getStackSize, getSuperClass, isArray, isPrimitiveisAnnotation, isInterfaceisAbstractisEnumisDeprecated, isPackagePrivate, isPrivate, isProtected, isPublic, isStaticgetModifiers, isFinal, isSyntheticforEach, spliteratorgetDescriptorgetNamegetDeclaredAnnotationsfindVariable, getTypeVariablespublic 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 TypeDescriptiontype - 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)isAssignableFrom in interface TypeDescriptiontypeDescription - 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 TypeDescriptiontype - 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)isAssignableTo in interface TypeDescriptiontypeDescription - The type of interest.true if this type is assignable to type.public TypeDescription asErasure()
TypeDefinitionTypeDescription.Generic.Sort#WILDCARD)
do not have a well-defined erasure and cause an IllegalStateException to be thrown.asErasure in interface TypeDefinitionpublic TypeDescription.Generic asGenericType()
TypeDefinitionasGenericType in interface TypeDefinitionpublic TypeDefinition.Sort getSort()
TypeDefinitiongetSort in interface TypeDefinitionpublic boolean isInstance(Object value)
TypeDescriptionvalue is an instance of the type represented by this instance.isInstance in interface TypeDescriptionvalue - The object of interest.true if the object is an instance of the type described by this instance.public boolean isInstanceOrWrapper(Object value)
TypeDescriptionvalue is an instance of the type represented by this instance or a wrapper instance of the
corresponding primitive value.isInstanceOrWrapper in interface TypeDescriptionvalue - The object of interest.true if the object is an instance or wrapper of the type described by this instance.public boolean isAnnotationValue(Object value)
TypeDescriptionisAnnotationValue in interface TypeDescriptionvalue - The value that is supposed to describe the annotation value for this instance.true if instances of this type can be used for describing the given annotation value..public String getInternalName()
NamedElement.WithRuntimeNamegetInternalName in interface NamedElement.WithRuntimeNamepublic int getActualModifiers(boolean superFlag)
TypeDescriptionprivate.
but it modifiers might reflect this property nevertheless if a class was defined as a private inner class. The
returned modifiers take also into account if the type is marked as Deprecated. Anonymous classes that are
enclosed in a static method or the type initializer are additionally marked as final as it is also done
by the Java compiler.getActualModifiers in interface TypeDescriptionsuperFlag - true if the modifier's super flag should be set.public String getGenericSignature()
ByteCodeElementnull is returned as a signature.getGenericSignature in interface ByteCodeElementnull if this element is not generic.public boolean isSamePackage(TypeDescription typeDescription)
TypeDescriptionisSamePackage in interface TypeDescriptiontypeDescription - The type of interest.true if this type and the given type are in the same package.public boolean isVisibleTo(TypeDescription typeDescription)
ByteCodeElementChecks if this element is visible from a given type.
Note: A method or field might define a signature that includes types that are not visible to a type. Such methods can be legally invoked from this type and can even be implemented as bridge methods by this type. It is however not legal to declare a method with invisible types in its signature that are not bridges what might require additional validation.
Important: Virtual byte code elements, i.e. virtual methods, are only considered visible if the type they are invoked upon is visible to a given type. The visibility of such virtual members can therefore not be determined by only investigating the invoked method but requires an additional check of the target type.
isVisibleTo in interface ByteCodeElementtypeDescription - The type which is checked for its access of this element.true if this element is visible for typeDescription.public AnnotationList getInheritedAnnotations()
TypeDescriptiongetInheritedAnnotations in interface TypeDescriptionpublic String getActualName()
NamedElementgetActualName in interface NamedElementpublic boolean isConstantPool()
TypeDescriptionint cannot be stored in the constant pool as those types are represented
as int values internally.isConstantPool in interface TypeDescriptiontrue if instances of this type can be stored in the constant pool of a class.public boolean isPrimitiveWrapper()
TypeDescriptionVoid type is
not considered to be a wrapper type.isPrimitiveWrapper in interface TypeDescriptiontrue if this type represents a wrapper type.public boolean isAnnotationReturnType()
TypeDescriptionisAnnotationReturnType in interface TypeDescriptiontrue if instances of this type can be returned from an annotation method.public boolean isAnnotationValue()
TypeDescriptionisAnnotationValue in interface TypeDescriptiontrue if instances of this type can be used for describing an annotation value.public boolean represents(Type type)
TypeDefinitiontype.represents in interface TypeDefinitiontype - The type of interest.true if the type described by this instance represents type.public String getTypeName()
TypeDefinitionObject.toString() representations. For a non-generic
type, it is the fully qualified binary name of the type.getTypeName in interface TypeDefinitionpublic TypeVariableSource getEnclosingSource()
TypeVariableSourcegetEnclosingSource in interface TypeVariableSourcenull if no such source exists.public <T> T accept(TypeVariableSource.Visitor<T> visitor)
TypeVariableSourceaccept in interface TypeVariableSourceT - The visitor's return type.visitor - The visitor to apply.public boolean isPackageType()
TypeDescriptionisPackageType in interface TypeDescriptiontrue if this type represents a package description.public boolean isGenericDeclaration()
TypeVariableSourceisGenericDeclaration in interface TypeVariableSourcetrue if this type code element has a generic declaration.public int getSegmentCount()
TypeDescription0 is returned.getSegmentCount in interface TypeDescriptionpublic Iterator<TypeDefinition> iterator()
iterator in interface Iterable<TypeDefinition>Copyright © 2014–2016. All rights reserved.