public abstract static class GenericTypeDescription.ForGenericArray extends Object implements GenericTypeDescription
Modifier and Type | Class and Description |
---|---|
static class |
GenericTypeDescription.ForGenericArray.Latent
A latent implementation of a generic array type.
|
static class |
GenericTypeDescription.ForGenericArray.OfLoadedType
A description of a loaded generic array type.
|
GenericTypeDescription.ForGenericArray, GenericTypeDescription.ForNonGenericType, GenericTypeDescription.ForParameterizedType, GenericTypeDescription.ForTypeVariable, GenericTypeDescription.ForWildcardType, GenericTypeDescription.LazyProjection, GenericTypeDescription.Sort, GenericTypeDescription.SuperTypeIterator, GenericTypeDescription.Visitor<T>
NamedElement.WithGenericName, NamedElement.WithRuntimeName
EMPTY_NAME, NO_NAME
Constructor and Description |
---|
ForGenericArray() |
Modifier and Type | Method and Description |
---|---|
<T> T |
accept(GenericTypeDescription.Visitor<T> visitor)
Applies a visitor to this generic type description.
|
TypeDescription |
asErasure()
Returns the erasure of this type.
|
boolean |
equals(Object other) |
FieldList |
getDeclaredFields()
Returns a list of field descriptions that are declared by this type.
|
MethodList |
getDeclaredMethods()
Returns a list of method descriptions that are declared by this type.
|
GenericTypeList |
getInterfaces()
Returns the generic interface types of this type.
|
GenericTypeList |
getLowerBounds()
Returns the lower bounds of this type.
|
GenericTypeDescription |
getOwnerType()
Returns the owner type of this type.
|
GenericTypeList |
getParameters()
Returns the type parameters of this type.
|
GenericTypeDescription.Sort |
getSort()
Returns the sort of the generic type this instance represents.
|
String |
getSourceCodeName()
Returns the name of this element as it is found in the source code.
|
StackSize |
getStackSize()
Returns the size of the type described by this instance.
|
GenericTypeDescription |
getSuperType()
Returns the generic super type of this type.
|
String |
getSymbol()
Returns the symbol of this type variable.
|
String |
getTypeName()
Returns the name of the type.
|
GenericTypeList |
getUpperBounds()
Returns the upper bounds of this type.
|
TypeVariableSource |
getVariableSource()
Returns the source of this type variable.
|
int |
hashCode() |
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.
|
Iterator<GenericTypeDescription> |
iterator() |
boolean |
represents(Type type)
Checks if the type described by this instance represents
type . |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getComponentType
forEach, spliterator
public GenericTypeDescription.Sort getSort()
GenericTypeDescription
getSort
in interface GenericTypeDescription
public TypeDescription asErasure()
GenericTypeDescription
GenericTypeDescription.Sort.WILDCARD
)
do not have a well-defined erasure and cause an IllegalStateException
to be thrown.asErasure
in interface GenericTypeDescription
public GenericTypeDescription getSuperType()
GenericTypeDescription
Returns the generic super type of this type.
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
), a description of Object
is returned.
For other generic types, an IllegalStateException
is thrown.
getSuperType
in interface GenericTypeDescription
null
if no such type exists.public GenericTypeList getInterfaces()
GenericTypeDescription
Returns the generic interface types of this type.
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
), a list of Serializable
and
Cloneable
) is returned. For other generic types, an IllegalStateException
is thrown.
getInterfaces
in interface GenericTypeDescription
public FieldList getDeclaredFields()
GenericTypeDescription
Returns 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.
getDeclaredFields
in interface GenericTypeDescription
public MethodList getDeclaredMethods()
GenericTypeDescription
Returns 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.
getDeclaredMethods
in interface GenericTypeDescription
public GenericTypeList getUpperBounds()
GenericTypeDescription
Returns the upper bounds of this type. Any type with a well-defined upper bound is bound by at least one type. If no such
type is defined, the bound is implicitly Object
.
Only non-symbolic type variables (GenericTypeDescription.Sort.VARIABLE
,
GenericTypeDescription.Sort.VARIABLE_DETACHED
) and wildcard types
(GenericTypeDescription.Sort.WILDCARD
) have well-defined upper bounds. For other
types, an IllegalStateException
is thrown.
getUpperBounds
in interface GenericTypeDescription
public GenericTypeList getLowerBounds()
GenericTypeDescription
Returns the lower bounds of this type.
Only wildcard types (GenericTypeDescription.Sort.WILDCARD
) define a lower bound. For other
types, an IllegalStateException
is thrown.
getLowerBounds
in interface GenericTypeDescription
public TypeVariableSource getVariableSource()
GenericTypeDescription
GenericTypeDescription.Sort.VARIABLE
. For other types, this method
throws an IllegalStateException
.getVariableSource
in interface GenericTypeDescription
public GenericTypeList getParameters()
GenericTypeDescription
Returns the type parameters of this type.
Parameters are only well-defined for parameterized types
(GenericTypeDescription.Sort.PARAMETERIZED
), generic array types
(GenericTypeDescription.Sort.GENERIC_ARRAY
) and non-generic types
(GenericTypeDescription.Sort.NON_GENERIC
). For non-generic and generic array types,
the returned list is always empty. For all other types, this method throws an IllegalStateException
.
getParameters
in interface GenericTypeDescription
public GenericTypeDescription getOwnerType()
GenericTypeDescription
Returns the owner type of this type.
An owner type is only well-defined for parameterized types
(GenericTypeDescription.Sort.PARAMETERIZED
) , generic array types
(GenericTypeDescription.Sort.GENERIC_ARRAY
) and non-generic types
(GenericTypeDescription.Sort.NON_GENERIC
). Non-generic types and generic array types do
never have an owner type. For all other types, this method throws an IllegalStateException
.
getOwnerType
in interface GenericTypeDescription
null
if no such owner type exists.public String getSymbol()
GenericTypeDescription
GenericTypeDescription.Sort.VARIABLE
,
GenericTypeDescription.Sort.VARIABLE_DETACHED
,
GenericTypeDescription.Sort.VARIABLE_SYMBOLIC
). For other types, this method
throws an IllegalStateException
.getSymbol
in interface GenericTypeDescription
public String getTypeName()
GenericTypeDescription
Object.toString()
representations. For a non-generic
type, it is the fully qualified binary name of the type.getTypeName
in interface GenericTypeDescription
public String getSourceCodeName()
NamedElement
getSourceCodeName
in interface NamedElement
public boolean represents(Type type)
GenericTypeDescription
type
.represents
in interface GenericTypeDescription
type
- The type of interest.true
if the type described by this instance represents type
.public boolean isArray()
GenericTypeDescription
isArray
in interface GenericTypeDescription
true
if this type description represents an array.public boolean isPrimitive()
GenericTypeDescription
isPrimitive
in interface GenericTypeDescription
true
if this type description represents a primitive type.public Iterator<GenericTypeDescription> iterator()
iterator
in interface Iterable<GenericTypeDescription>
public <T> T accept(GenericTypeDescription.Visitor<T> visitor)
GenericTypeDescription
accept
in interface GenericTypeDescription
T
- The value that this visitor yields.visitor
- The visitor to apply.public StackSize getStackSize()
GenericTypeDescription
GenericTypeDescription.Sort.WILDCARD
do not have a well-defined a stack size and
cause an IllegalStateException
to be thrown.getStackSize
in interface GenericTypeDescription
Copyright © 2014–2015. All rights reserved.