public abstract static class TypeDescription.AbstractTypeDescription extends ModifierReviewable.AbstractModifierReviewable implements TypeDescription
Modifier and Type | Class and Description |
---|---|
static class |
TypeDescription.AbstractTypeDescription.OfSimpleType
An adapter implementation of a
TypeDescription that
describes any type that is not an array or a primitive type. |
TypeDescription.AbstractTypeDescription, TypeDescription.ArrayProjection, TypeDescription.ForLoadedType, TypeDescription.Latent
ModifierReviewable.AbstractModifierReviewable
CLASS, ENUM, OBJECT, STRING, VOID
EMPTY_NAME
EMPTY_MASK
Constructor and Description |
---|
AbstractTypeDescription() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
int |
getActualModifiers(boolean superFlag)
Returns the type's actual modifiers as present in the class file.
|
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.
|
TypeList |
getInheritedInterfaces()
Returns all interfaces that are implemented by this type, either directly or indirectly.
|
String |
getInternalName()
Returns the internal internalName of this byte code element.
|
protected String |
getPackageName()
Returns the name of this type's package.
|
String |
getSourceCodeName()
Returns the name of this byte code element as it is defined in Java source code.
|
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 |
isConstantPool()
Checks if instances of this type can be stored in the constant pool of a class.
|
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 |
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.
|
String |
toString() |
isAbstract, isAnnotation, isBridge, isDeprecated, isEnum, isFinal, isInterface, isMandated, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSuper, isSynchronized, isSynthetic, isTransient, isVarArgs, isVolatile
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getCanonicalName, getComponentType, getDeclaredFields, getDeclaredMethods, getEnclosingMethod, getEnclosingType, getInterfaces, getPackage, getSimpleName, getStackSize, getSupertype, isAnonymousClass, isArray, isAssignableFrom, isAssignableFrom, isAssignableTo, isAssignableTo, isLocalClass, isMemberClass, isPrimitive, represents
getDescriptor
getName
getModifiers, isAbstract, isAnnotation, isBridge, isDeprecated, isEnum, isFinal, isInterface, isMandated, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSuper, isSynchronized, isSynthetic, isTransient, isVarArgs, isVolatile
getDeclaringType
getDeclaredAnnotations
public boolean isInstance(Object value)
TypeDescription
value
is an instance of the type represented by this instance.isInstance
in interface TypeDescription
value
- The object of interest.true
if the object is an instance of the type described by this instance.public boolean isInstanceOrWrapper(Object value)
TypeDescription
value
is an instance of the type represented by this instance or a wrapper instance of the
corresponding primitive value.isInstanceOrWrapper
in interface TypeDescription
value
- 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)
TypeDescription
isAnnotationValue
in interface TypeDescription
value
- 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
getInternalName
in interface NamedElement
public int getActualModifiers(boolean superFlag)
TypeDescription
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.
getActualModifiers
in interface TypeDescription
superFlag
- true
if the super flag should be set.public String getGenericSignature()
ByteCodeElement
getGenericSignature
in interface ByteCodeElement
null
if this element is not generic.public boolean isSamePackage(TypeDescription typeDescription)
TypeDescription
isSamePackage
in interface TypeDescription
typeDescription
- The type of interest.true
if this type and the given type are in the same package.public boolean isVisibleTo(TypeDescription typeDescription)
ByteCodeElement
isVisibleTo
in interface ByteCodeElement
typeDescription
- The type which is checked for its access of this element.true
if this element is visible for typeDescription
.public TypeList getInheritedInterfaces()
TypeDescription
getInheritedInterfaces
in interface TypeDescription
public AnnotationList getInheritedAnnotations()
TypeDescription
getInheritedAnnotations
in interface TypeDescription
public String getSourceCodeName()
NamedElement
NamedElement.getName()
.getSourceCodeName
in interface NamedElement
protected String getPackageName()
null
if this type is defined in the default package.public boolean isConstantPool()
TypeDescription
int
cannot be stored in the constant pool as those types are represented
as int
values internally.isConstantPool
in interface TypeDescription
true
if instances of this type can be stored in the constant pool of a class.public boolean isPrimitiveWrapper()
TypeDescription
Void
type is
not considered to be a wrapper type.isPrimitiveWrapper
in interface TypeDescription
true
if this type represents a wrapper type.public boolean isAnnotationReturnType()
TypeDescription
isAnnotationReturnType
in interface TypeDescription
true
if instances of this type can be returned from an annotation method.public boolean isAnnotationValue()
TypeDescription
isAnnotationValue
in interface TypeDescription
true
if instances of this type can be used for describing an annotation value.Copyright © 2014–2015. All rights reserved.