public class JParameterizedType extends JClassType implements JParameterizedType
Modifier and Type | Method and Description |
---|---|
protected void |
acceptSubtype(JClassType me) |
JConstructor |
findConstructor(JType[] paramTypes)
Delegating types generally cannot be constructed.
|
JField |
findField(String name)
Subclasses will generally need to echo modified fields.
|
JMethod |
findMethod(String name,
JType[] paramTypes)
Subclasses will generally need to echo modified methods.
|
JClassType |
findNestedType(String typeName) |
protected JClassType |
findNestedTypeImpl(String[] typeName,
int index) |
<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.
|
JGenericType |
getBaseType() |
JConstructor |
getConstructor(JType[] paramTypes)
Delegating types generally cannot be constructed.
|
JConstructor[] |
getConstructors()
Delegating types generally cannot be constructed.
|
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)
Subclasses will generally need to echo modified fields.
|
JField[] |
getFields()
Subclasses will generally need to echo modified fields.
|
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.
|
JMethod |
getMethod(String name,
JType[] paramTypes)
Subclasses will generally need to echo modified methods.
|
JMethod[] |
getMethods()
Subclasses will generally need to echo modified methods.
|
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() |
String |
getNonParameterizedQualifiedSourceName()
Deprecated.
|
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()
Everything is fully qualified and includes the < and > in the
signature.
|
JClassType |
getRawType() |
String |
getSimpleSourceName()
In this case, the raw type name.
|
JClassType[] |
getSubtypes()
Returns all subtypes for this type.
|
JClassType |
getSuperclass()
Returns the superclass of this type, or
null if none. |
JClassType[] |
getTypeArgs() |
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. |
JClassType |
isClassOrInterface()
Returns this instance if the erased version of this type is a class or interface (as opposed to
a primitive or array array) 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. |
protected com.google.gwt.dev.javac.typemodel.JMaybeParameterizedType |
isMaybeParameterizedType() |
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, getLeafType, getMetaData, getMetaDataTags, hashCode, isAnnotation, isAssignableFrom, isAssignableTo, isEnhanced, isLocalType, isPackageProtected, isTypeParameter, setEnhanced
getBaseType
asParameterizationOf, findAnnotationInTypeHierarchy, getErasedType, getFlattenedSupertypeHierarchy, getName, getOracle, getPackage, isAbstract, isAssignableFrom, isAssignableTo, isDefaultInstantiable, isEnhanced, isFinal, isLocalType, isMemberType, isPackageProtected, isPrivate, isProtected, isPublic, isStatic, setEnhanced
getJNISignature, getLeafType, isAnnotation, isArray, isClass, isClassOrInterface, isEnum, isInterface, isPrimitive, isTypeParameter
getAnnotation, getAnnotations, getDeclaredAnnotations, isAnnotationPresent
getMetaData, getMetaDataTags
public JConstructor findConstructor(JType[] paramTypes)
findConstructor
in interface JClassType
public JField findField(String name)
findField
in interface JClassType
public JMethod findMethod(String name, JType[] paramTypes)
findMethod
in interface JClassType
public JClassType findNestedType(String typeName)
findNestedType
in interface JClassType
public JConstructor getConstructor(JType[] paramTypes) throws NotFoundException
getConstructor
in interface JClassType
NotFoundException
public JConstructor[] getConstructors()
getConstructors
in interface JClassType
public JClassType getEnclosingType()
JClassType
getEnclosingType
in interface JClassType
public JField getField(String name)
getField
in interface JClassType
public JField[] getFields()
getFields
in interface JClassType
public JClassType[] getImplementedInterfaces()
getImplementedInterfaces
in interface 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
JMethod
objects representing inheritable
methodspublic JMethod getMethod(String name, JType[] paramTypes) throws NotFoundException
getMethod
in interface JClassType
NotFoundException
public JMethod[] getMethods()
getMethods
in interface JClassType
public JClassType getNestedType(String typeName) throws NotFoundException
getNestedType
in interface JClassType
NotFoundException
public JClassType[] getNestedTypes()
getNestedTypes
in interface JClassType
@Deprecated public String getNonParameterizedQualifiedSourceName()
getQualifiedSourceName()
getNonParameterizedQualifiedSourceName
in interface JParameterizedType
public JMethod[] getOverloads(String name)
JClassType
getOverloads
in interface 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
JMethod
objects representing overridable
methodspublic 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()
getQualifiedSourceName
in interface JType
getQualifiedSourceName
in class JClassType
public JClassType getRawType()
getRawType
in interface JParameterizedType
public String getSimpleSourceName()
getSimpleSourceName
in interface JType
getSimpleSourceName
in class JClassType
public JClassType[] getSubtypes()
JClassType
getBaseType()
.Object
.getSubtypes
in interface JClassType
public JClassType getSuperclass()
JClassType
null
if none.getSuperclass
in interface JClassType
public JClassType[] getTypeArgs()
getTypeArgs
in interface JParameterizedType
public JGenericType isGenericType()
JType
null
if it is not.isGenericType
in interface JType
isGenericType
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 JRawType isRawType()
JType
JRawType
, otherwise returns
null
.isRawType
in interface JType
isRawType
in class JClassType
public JWildcardType isWildcard()
isWildcard
in interface JType
isWildcard
in class JClassType
public String toString()
protected JClassType findNestedTypeImpl(String[] typeName, int index)
protected void getInheritableMethodsOnSuperclassesAndThisClass(Map<String,JMethod> methodsBySignature)
protected void getInheritableMethodsOnSuperinterfacesAndMaybeThisInterface(Map<String,JMethod> methodsBySignature)
getOverridableMethods()
.methodsBySignature
- public JGenericType getBaseType()
protected com.google.gwt.dev.javac.typemodel.JMaybeParameterizedType isMaybeParameterizedType()
isMaybeParameterizedType
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 Annotation[] getDeclaredAnnotations()
HasAnnotations
getDeclaredAnnotations
in interface HasAnnotations
getDeclaredAnnotations
in class JClassType
public JClassType getErasedType()
JType
getErasedType
in interface JClassType
getErasedType
in interface JType
getErasedType
in class JClassType
public String getJNISignature()
JType
Z
[B
Ljava/lang/String;
getJNISignature
in interface JType
getJNISignature
in class JClassType
public String getName()
JClassType
getName
in interface JClassType
getName
in class JClassType
public TypeOracle getOracle()
getOracle
in interface JClassType
getOracle
in class JClassType
public JPackage getPackage()
getPackage
in interface JClassType
getPackage
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 final 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 JClassType isClassOrInterface()
JType
null
if it is not.isClassOrInterface
in interface JType
isClassOrInterface
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 final 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 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 final 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 boolean isStatic()
isStatic
in interface JClassType
isStatic
in class JClassType
protected void acceptSubtype(JClassType me)
acceptSubtype
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 © 2018. All rights reserved.