public interface JClassType extends JType, HasAnnotations, HasMetaData
Modifier and Type | Method and Description |
---|---|
JParameterizedType |
asParameterizationOf(JGenericType type) |
<T extends java.lang.annotation.Annotation> |
findAnnotationInTypeHierarchy(java.lang.Class<T> annotationType)
Find an annotation on a type or on one of its superclasses or
superinterfaces.
|
JConstructor |
findConstructor(JType[] paramTypes) |
JField |
findField(java.lang.String name) |
JMethod |
findMethod(java.lang.String name,
JType[] paramTypes) |
JClassType |
findNestedType(java.lang.String typeName) |
JConstructor |
getConstructor(JType[] paramTypes) |
JConstructor[] |
getConstructors() |
JClassType |
getEnclosingType() |
JClassType |
getErasedType()
Returns this type with no type parameters or type variables.
|
JField |
getField(java.lang.String name) |
JField[] |
getFields() |
java.util.Set<? extends JClassType> |
getFlattenedSupertypeHierarchy()
Returns all of the superclasses and superinterfaces for a given type
including the type itself.
|
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.
|
JMethod |
getMethod(java.lang.String name,
JType[] paramTypes) |
JMethod[] |
getMethods() |
java.lang.String |
getName() |
JClassType |
getNestedType(java.lang.String typeName) |
JClassType[] |
getNestedTypes() |
TypeOracle |
getOracle() |
JMethod[] |
getOverloads(java.lang.String name) |
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() |
JClassType[] |
getSubtypes() |
JClassType |
getSuperclass() |
boolean |
isAbstract() |
boolean |
isAssignableFrom(JClassType possibleSubtype)
|
boolean |
isAssignableTo(JClassType possibleSupertype)
|
boolean |
isDefaultInstantiable()
Determines if the class can be constructed using a simple
new
operation. |
boolean |
isEnhanced()
Returns true if the type may be enhanced on the server to contain extra
fields that are unknown to client code.
|
boolean |
isFinal() |
boolean |
isLocalType()
Deprecated.
local types are not modeled
|
boolean |
isMemberType()
Tests if this type is contained within another type.
|
boolean |
isPrivate() |
boolean |
isProtected() |
boolean |
isPublic() |
boolean |
isStatic() |
void |
setEnhanced()
Indicates that the type may be enhanced on the server to contain extra
fields that are unknown to client code.
|
getJNISignature, getLeafType, getParameterizedQualifiedSourceName, getQualifiedBinaryName, getQualifiedSourceName, getSimpleSourceName, isAnnotation, isArray, isClass, isClassOrInterface, isEnum, isGenericType, isInterface, isParameterized, isPrimitive, isRawType, isTypeParameter, isWildcard
getAnnotation, getAnnotations, getDeclaredAnnotations, isAnnotationPresent
getMetaData, getMetaDataTags
JParameterizedType asParameterizationOf(JGenericType type)
<T extends java.lang.annotation.Annotation> T findAnnotationInTypeHierarchy(java.lang.Class<T> annotationType)
This provides semantics similar to that of
Inherited
except that it checks all types to
which this type is assignable. @Inherited
only works on
superclasses, not superinterfaces.
Annotations present on the superclass chain will be returned preferentially
over those found in the superinterface hierarchy. Note that the annotation
does not need to be tagged with @Inherited
in order to be returned
from the superclass chain.
annotationType
- the type of the annotation to look fornull
if the annotation is
not present in the type's type hierarchyJConstructor findConstructor(JType[] paramTypes)
JField findField(java.lang.String name)
JClassType findNestedType(java.lang.String typeName)
JConstructor getConstructor(JType[] paramTypes) throws NotFoundException
NotFoundException
JConstructor[] getConstructors()
JClassType getEnclosingType()
JClassType getErasedType()
JType
getErasedType
in interface JType
JField getField(java.lang.String name)
JField[] getFields()
java.util.Set<? extends JClassType> getFlattenedSupertypeHierarchy()
JClassType[] getImplementedInterfaces()
JMethod[] getInheritableMethods()
public
, protected
, or
package protected.
This method offers a convenient way for Generators to find candidate
methods to call from a subclass.JMethod
objects representing inheritable
methodsJMethod getMethod(java.lang.String name, JType[] paramTypes) throws NotFoundException
NotFoundException
JMethod[] getMethods()
java.lang.String getName()
JClassType getNestedType(java.lang.String typeName) throws NotFoundException
NotFoundException
JClassType[] getNestedTypes()
TypeOracle getOracle()
JMethod[] getOverloads(java.lang.String name)
JMethod[] getOverridableMethods()
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.JMethod
objects representing overridable
methodsJPackage getPackage()
JClassType[] getSubtypes()
JClassType getSuperclass()
boolean isAbstract()
boolean isAssignableFrom(JClassType possibleSubtype)
possibleSubtype
- possible subtype of this JClassType
true
if this JClassType
is assignable from the
specified JClassType
parameterjava.lang.NullPointerException
- if possibleSubtype
is
null
boolean isAssignableTo(JClassType possibleSupertype)
possibleSupertype
- possible supertype of this JClassType
true
if this JClassType
is assignable to the
specified JClassType
parameterjava.lang.NullPointerException
- if possibleSupertype
is
null
boolean isDefaultInstantiable()
new
operation. Specifically, the class must
true
if the type is default instantiable, or
false
otherwiseboolean isEnhanced()
true
if the type might be enhanced on the serverboolean isFinal()
@Deprecated boolean isLocalType()
boolean isMemberType()
boolean isPrivate()
boolean isProtected()
boolean isPublic()
boolean isStatic()
void setEnhanced()