public interface TypeDefinition extends NamedElement, ModifierReviewable.ForTypeDefinition, Iterable<TypeDefinition>
TypeDescription
or as a TypeDescription.Generic
.Modifier and Type | Interface and Description |
---|---|
static class |
TypeDefinition.Sort
Represents a
TypeDescription.Generic 's form. |
static class |
TypeDefinition.SuperClassIterator
An iterator that iterates over a type's class hierarchy.
|
NamedElement.WithGenericName, NamedElement.WithOptionalName, NamedElement.WithRuntimeName
ModifierReviewable.AbstractBase, ModifierReviewable.ForFieldDescription, ModifierReviewable.ForMethodDescription, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumeration
EMPTY_NAME, NO_NAME
EMPTY_MASK
Modifier and Type | Method and Description |
---|---|
TypeDescription |
asErasure()
Returns the erasure of this type.
|
TypeDescription.Generic |
asGenericType()
Returns this type definition as a generic type.
|
TypeDefinition |
getComponentType()
Returns the component type of this type.
|
FieldList<?> |
getDeclaredFields()
Returns the fields that this type declares.
|
MethodList<?> |
getDeclaredMethods()
Returns the methods that this type declares.
|
TypeList.Generic |
getInterfaces()
Returns the interfaces that this type implements.
|
TypeDefinition.Sort |
getSort()
Returns the sort of the generic type this instance represents.
|
StackSize |
getStackSize()
Returns the size of the type described by this instance.
|
TypeDescription.Generic |
getSuperClass()
Returns the super class of this type.
|
String |
getTypeName()
Returns the name of the type.
|
boolean |
isArray()
Checks if the type described by this entity is an array.
|
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 . |
getActualName
isAnnotation, isInterface
isAbstract
isEnum
isDeprecated, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic
getModifiers, isFinal, isSynthetic
forEach, iterator, spliterator
TypeDescription.Generic asGenericType()
TypeDescription asErasure()
TypeDescription.Generic.Sort#WILDCARD
)
do not have a well-defined erasure and cause an IllegalStateException
to be thrown.TypeDescription.Generic getSuperClass()
TypeDefinition.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.null
if no super class exists for this type.TypeList.Generic getInterfaces()
TypeDefinition.Sort.NON_GENERIC
),
parameterized types (TypeDefinition.Sort.PARAMETERIZED
) or generic array types (TypeDefinition.Sort.GENERIC_ARRAY
) types.FieldList<?> getDeclaredFields()
TypeDefinition.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.TypeDefinition.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.MethodList<?> getDeclaredMethods()
TypeDefinition getComponentType()
Returns 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.
null
if this type does not represent an array type.TypeDefinition.Sort getSort()
String getTypeName()
Object.toString()
representations. For a non-generic
type, it is the fully qualified binary name of the type.StackSize getStackSize()
TypeDescription.Generic.Sort#WILDCARD
do not have a well-defined a stack size and
cause an IllegalStateException
to be thrown.boolean isArray()
true
if this type description represents an array.boolean isPrimitive()
true
if this type description represents a primitive type.boolean represents(Type type)
type
.type
- The type of interest.true
if the type described by this instance represents type
.Copyright © 2014–2016. All rights reserved.