public class JArrayType extends JClassType implements JArrayType
Modifier and Type | Method and Description |
---|---|
protected void |
acceptSubtype(JClassType me) |
JConstructor |
findConstructor(JType[] paramTypes)
Returns the constructor with parameters that have the given types, or null if not found.
|
JField |
findField(String name) |
JMethod |
findMethod(String name,
JType[] paramTypes) |
JClassType |
findNestedType(String typeName) |
<T extends Annotation> |
getAnnotation(Class<T> annotationClass)
Returns an instance of the specified annotation type if it is present on
this element or
null if it is not. |
Annotation[] |
getAnnotations()
Returns all the annotations present on this element.
|
JType |
getComponentType() |
JConstructor |
getConstructor(JType[] paramTypes) |
JConstructor[] |
getConstructors() |
Annotation[] |
getDeclaredAnnotations()
Returns the annotations declared directly on this element; does not include
any inherited annotations.
|
JClassType |
getEnclosingType()
Returns the enclosing type, or null if none.
|
JClassType |
getErasedType()
Returns this type with no type parameters or type variables.
|
JField |
getField(String name) |
JField[] |
getFields() |
JClassType[] |
getImplementedInterfaces() |
JMethod[] |
getInheritableMethods()
Iterates over the most-derived declaration of each unique inheritable
method available in the type hierarchy of the specified type, including
those found in superclasses and superinterfaces.
|
protected void |
getInheritableMethodsOnSuperclassesAndThisClass(Map<String,JMethod> methodsBySignature) |
protected void |
getInheritableMethodsOnSuperinterfacesAndMaybeThisInterface(Map<String,JMethod> methodsBySignature)
Gets the methods declared in interfaces that this type extends.
|
String |
getJNISignature()
Returns the
"field descriptor" for a type as specified by the Java Virtual Machine Specification.
|
JType |
getLeafType()
For array types, recursively looks for the element type that is not an
array.
|
JMethod |
getMethod(String name,
JType[] paramTypes) |
JMethod[] |
getMethods()
Returns the declared methods of this class (not any superclasses or
superinterfaces).
|
protected int |
getModifierBits() |
String |
getName()
If an array, returns the name of this class without the package name or
enclosing class name, followed by multiple pairs of square brackets; if
not, returns the nested name of this type (like Foo or Foo.Bar),
without the package name.
|
JClassType |
getNestedType(String typeName) |
JClassType[] |
getNestedTypes() |
TypeOracle |
getOracle() |
JMethod[] |
getOverloads(String name)
Returns the declared methods of this class with the given name
(doesn't include any superclasses or superinterfaces).
|
JMethod[] |
getOverridableMethods()
Iterates over the most-derived declaration of each unique overridable
method available in the type hierarchy of the specified type, including
those found in superclasses and superinterfaces.
|
JPackage |
getPackage() |
String |
getParameterizedQualifiedSourceName()
Returns a type name as it would be specified in Java source, with the
package name included.
|
String |
getQualifiedBinaryName()
TODO(scottb): remove if we can resolve param names differently.
|
String |
getQualifiedSourceName()
Returns a type name as it would be specified in Java source, with the
package name included.
|
int |
getRank() |
String |
getSimpleSourceName()
Returns the name of this class without the package name or enclosing class name.
|
JArrayType[] |
getSubtypes()
Returns all subtypes for this type.
|
JClassType |
getSuperclass()
Returns the superclass of this type, or
null if none. |
boolean |
isAbstract() |
boolean |
isAnnotationPresent(Class<? extends Annotation> annotationClass)
Returns
true if this item has an annotation of the specified
type. |
JArrayType |
isArray() |
JClassType |
isClass()
Returns this instance if the erased version of this type is a class (as opposed to a primitive,
array, or interface) or
null if it is not. |
boolean |
isDefaultInstantiable()
Determines if the class can be constructed using a simple
new
operation. |
JEnumType |
isEnum()
Returns this instance if it is an enumeration or
null if it is
not. |
boolean |
isFinal() |
JGenericType |
isGenericType()
Returns this instance if it is a real class that has type parameters or
null
if it is not. |
JClassType |
isInterface()
Returns this instance if it is an interface or
null if it is not. |
boolean |
isMemberType()
Tests if this type is contained within another type.
|
JParameterizedType |
isParameterized()
Returns this instance as a
JParameterizedType if it is a parameterized type
or null if it is not. |
JPrimitiveType |
isPrimitive() |
boolean |
isPrivate() |
boolean |
isProtected() |
boolean |
isPublic() |
JRawType |
isRawType()
Returns the raw type if this is a
JRawType , otherwise returns
null . |
boolean |
isStatic() |
JWildcardType |
isWildcard() |
protected void |
notifySuperTypesOf(JClassType me)
Tells this type's superclasses and superinterfaces about it.
|
protected void |
removeSubtype(JClassType me) |
String |
toString() |
asParameterizationOf, equals, findAnnotationInTypeHierarchy, getFlattenedSupertypeHierarchy, getFlattenedSuperTypeHierarchy, getMetaData, getMetaDataTags, hashCode, isAnnotation, isAssignableFrom, isAssignableTo, isClassOrInterface, isEnhanced, isLocalType, isMaybeParameterizedType, isPackageProtected, isTypeParameter, setEnhanced
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
asParameterizationOf, findAnnotationInTypeHierarchy, getFlattenedSupertypeHierarchy, isAssignableFrom, isAssignableTo, isEnhanced, isLocalType, isPackageProtected, setEnhanced
isAnnotation, isClassOrInterface, isTypeParameter
getMetaData, getMetaDataTags
public JConstructor findConstructor(JType[] paramTypes)
JClassType
findConstructor
in interface JClassType
findConstructor
in class JClassType
public JField findField(String name)
findField
in interface JClassType
findField
in class JClassType
public JMethod findMethod(String name, JType[] paramTypes)
findMethod
in interface JClassType
findMethod
in class JClassType
public JClassType findNestedType(String typeName)
findNestedType
in interface JClassType
findNestedType
in class JClassType
public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
HasAnnotations
null
if it is not. For a class, this will
look for annotations on supertypes as well.getAnnotation
in interface HasAnnotations
getAnnotation
in class JClassType
annotationClass
- annotation type to search fornull
if it is notpublic Annotation[] getAnnotations()
HasAnnotations
getAnnotations
in interface HasAnnotations
getAnnotations
in class JClassType
public JType getComponentType()
getComponentType
in interface JArrayType
public JConstructor getConstructor(JType[] paramTypes) throws NotFoundException
getConstructor
in interface JClassType
getConstructor
in class JClassType
NotFoundException
public JConstructor[] getConstructors()
getConstructors
in interface JClassType
getConstructors
in class JClassType
public Annotation[] getDeclaredAnnotations()
HasAnnotations
getDeclaredAnnotations
in interface HasAnnotations
getDeclaredAnnotations
in class JClassType
public JClassType getEnclosingType()
JClassType
getEnclosingType
in interface JClassType
getEnclosingType
in class JClassType
public JClassType getErasedType()
JType
getErasedType
in interface JClassType
getErasedType
in interface JType
getErasedType
in class JClassType
public JField getField(String name)
getField
in interface JClassType
getField
in class JClassType
public JField[] getFields()
getFields
in interface JClassType
getFields
in class JClassType
public JClassType[] getImplementedInterfaces()
getImplementedInterfaces
in interface JClassType
getImplementedInterfaces
in class JClassType
public JMethod[] getInheritableMethods()
JClassType
public
, protected
, or
package protected.
This method offers a convenient way for Generators to find candidate
methods to call from a subclass.getInheritableMethods
in interface JClassType
getInheritableMethods
in class JClassType
JMethod
objects representing inheritable
methodspublic String getJNISignature()
JType
Z
[B
Ljava/lang/String;
getJNISignature
in interface JType
getJNISignature
in class JClassType
public JType getLeafType()
JType
getLeafType
in interface JType
getLeafType
in class JClassType
public JMethod getMethod(String name, JType[] paramTypes) throws NotFoundException
getMethod
in interface JClassType
getMethod
in class JClassType
NotFoundException
public JMethod[] getMethods()
JClassType
getMethods
in interface JClassType
getMethods
in class JClassType
public String getName()
JClassType
getName
in interface JClassType
getName
in class JClassType
public JClassType getNestedType(String typeName) throws NotFoundException
getNestedType
in interface JClassType
getNestedType
in class JClassType
NotFoundException
public JClassType[] getNestedTypes()
getNestedTypes
in interface JClassType
getNestedTypes
in class JClassType
public TypeOracle getOracle()
getOracle
in interface JClassType
getOracle
in class JClassType
public JMethod[] getOverloads(String name)
JClassType
getOverloads
in interface JClassType
getOverloads
in class JClassType
public JMethod[] getOverridableMethods()
JClassType
final
and its accessibility is public
,
protected
, or package protected.
Deferred binding generators often need to generate method implementations;
this method offers a convenient way to find candidate methods to implement.
Note that the behavior does not match
Class.getMethod(String, Class[])
, which does not return the most
derived method in some cases.getOverridableMethods
in interface JClassType
getOverridableMethods
in class JClassType
JMethod
objects representing overridable
methodspublic JPackage getPackage()
getPackage
in interface JClassType
getPackage
in class JClassType
public String getParameterizedQualifiedSourceName()
JType
getParameterizedQualifiedSourceName
in interface JType
getParameterizedQualifiedSourceName
in class JClassType
public String getQualifiedBinaryName()
JClassType
getQualifiedBinaryName
in interface JType
getQualifiedBinaryName
in class JClassType
public String getQualifiedSourceName()
JType
getQualifiedSourceName
in interface JType
getQualifiedSourceName
in class JClassType
public int getRank()
getRank
in interface JArrayType
public String getSimpleSourceName()
JType
getSimpleSourceName
in interface JType
getSimpleSourceName
in class JClassType
public JArrayType[] getSubtypes()
JClassType
getBaseType()
.Object
.getSubtypes
in interface JArrayType
getSubtypes
in interface JClassType
getSubtypes
in class JClassType
public JClassType getSuperclass()
JClassType
null
if none.getSuperclass
in interface JClassType
getSuperclass
in class JClassType
public boolean isAbstract()
isAbstract
in interface JClassType
isAbstract
in class JClassType
public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass)
HasAnnotations
true
if this item has an annotation of the specified
type. For a class, this will look at supertypes as well.isAnnotationPresent
in interface HasAnnotations
isAnnotationPresent
in class JClassType
true
if this item has an annotation of the specified
typepublic JArrayType isArray()
isArray
in interface JType
isArray
in class JClassType
public JClassType isClass()
JType
null
if it is not.isClass
in interface JType
isClass
in class JClassType
public boolean isDefaultInstantiable()
JClassType
new
operation. Specifically, the class must
isDefaultInstantiable
in interface JClassType
isDefaultInstantiable
in class JClassType
true
if the type is default instantiable, or
false
otherwisepublic JEnumType isEnum()
JClassType
null
if it is
not.isEnum
in interface JType
isEnum
in class JClassType
null
if it is
notpublic boolean isFinal()
isFinal
in interface JClassType
isFinal
in class JClassType
public JGenericType isGenericType()
JType
null
if it is not.isGenericType
in interface JType
isGenericType
in class JClassType
public JClassType isInterface()
JType
null
if it is not.isInterface
in interface JType
isInterface
in class JClassType
public boolean isMemberType()
JClassType
isMemberType
in interface JClassType
isMemberType
in class JClassType
public JParameterizedType isParameterized()
JType
JParameterizedType
if it is a parameterized type
or null
if it is not.isParameterized
in interface JType
isParameterized
in class JClassType
public JPrimitiveType isPrimitive()
isPrimitive
in interface JType
isPrimitive
in class JClassType
public boolean isPrivate()
isPrivate
in interface JClassType
isPrivate
in class JClassType
public boolean isProtected()
isProtected
in interface JClassType
isProtected
in class JClassType
public boolean isPublic()
isPublic
in interface JClassType
isPublic
in class JClassType
public JRawType isRawType()
JType
JRawType
, otherwise returns
null
.isRawType
in interface JType
isRawType
in class JClassType
public boolean isStatic()
isStatic
in interface JClassType
isStatic
in class JClassType
public JWildcardType isWildcard()
isWildcard
in interface JType
isWildcard
in class JClassType
public String toString()
toString
in class JClassType
protected void acceptSubtype(JClassType me)
acceptSubtype
in class JClassType
protected void getInheritableMethodsOnSuperclassesAndThisClass(Map<String,JMethod> methodsBySignature)
getInheritableMethodsOnSuperclassesAndThisClass
in class JClassType
protected void getInheritableMethodsOnSuperinterfacesAndMaybeThisInterface(Map<String,JMethod> methodsBySignature)
JClassType
JClassType.getOverridableMethods()
.getInheritableMethodsOnSuperinterfacesAndMaybeThisInterface
in class JClassType
protected int getModifierBits()
getModifierBits
in class JClassType
protected void notifySuperTypesOf(JClassType me)
JClassType
notifySuperTypesOf
in class JClassType
protected void removeSubtype(JClassType me)
removeSubtype
in class JClassType
Copyright © 2016. All rights reserved.