public interface JavaType extends JavaMember, JavaIsGeneric
| Modifier and Type | Field and Description |
|---|---|
static JavaType[] |
EMPTY_ARRAY |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
int |
getArrayDimensions() |
JavaType |
getBaseComponentType() |
JavaClass |
getClass(java.lang.String name)
Iteratively retrieves all member classes declared in this class
or its hierarchy.
|
java.util.Collection<JavaClass> |
getClasses()
Iteratively retrieves all member classes declared in this class
or its hierarchy.
|
JavaMethod |
getClinitMethod() |
JavaClass |
getClosestClass()
Deprecated.
Please use
getTypeErasure(). |
JavaType |
getComponentType() |
java.util.Collection<JavaClass> |
getDeclaredAnonymousClasses()
Get the anonymous classes in this type.
|
JavaClass |
getDeclaredClass(java.lang.String name)
Get the direct member class that has the incoming name.
|
java.util.Collection<JavaClass> |
getDeclaredClasses()
Get the direct member classes of this type.
|
JavaMethod |
getDeclaredConstructor(JavaType[] parameters) |
java.util.Collection<JavaMethod> |
getDeclaredConstructors() |
JavaField |
getDeclaredField(java.lang.String name) |
java.util.Collection<JavaField> |
getDeclaredFields() |
java.util.Collection<JavaClass> |
getDeclaredLocalClasses()
Get the local classes in this type.
|
JavaMethod |
getDeclaredMethod(java.lang.String name,
JavaType[] parameters) |
java.util.Collection<JavaMethod> |
getDeclaredMethods() |
java.util.Collection<JavaMethod> |
getDeclaredMethods(java.lang.String name) |
java.lang.String |
getDescriptor()
Gets the descriptor for this type, as defined by the JVMS2.
|
JavaField |
getField(java.lang.String name)
Iteratively searches for a field declared in this class or its
hierarchy.
|
java.util.Collection<JavaField> |
getFields()
Iteratively retrieves all fields declared in this class and its
hierarchy.
|
java.util.Set<JavaType> |
getHierarchy()
Recursively gets the full list of all resolved superclasses and
super-interfaces.
|
java.util.Collection<JavaType> |
getInterfaces()
The name "getInterfaces" was chosen to be consistent with
java/lang/Class.
|
JavaMethod |
getMethod(java.lang.String name,
JavaType[] parameters)
Iteratively searches for a method declared in this class or its
hierarchy.
|
java.util.Collection<JavaMethod> |
getMethods()
Iteratively retrieves all methods declared in this class or its
hierarchy.
|
java.util.Collection<JavaMethod> |
getMethods(java.lang.String name)
Iteratively retrieves all methods declared in this class or its
hierarchy.
|
java.lang.String |
getName()
Gets the simplest name of this type with "[]"s if present.
|
JavaPackage |
getPackage()
Gets the owning package, null if N/A.
|
java.lang.String |
getPackageName()
Gets the qualified name of the owning package.
|
java.lang.String |
getQualifiedName()
Gets the fully qualified name of this type in source format.
|
java.lang.String |
getRawName()
Gets the raw name of this type.
|
java.lang.String |
getSignature()
Gets the "Signature" attribute of this type, as defined by the
JVMS3.
|
JavaType |
getSuperclass()
The name "getSuperclass" was chosen to be consistent with
java/lang/Class.
|
CompiledTmpVariable |
getThisValue()
In the interest of minimizing the number of tmp variables
floating around in the heap, each type may create a value object
(when needed) and store it (with a weak reference) for later use.
|
java.util.Collection<JavaAnnotation> |
getTypeAnnotations()
Applies to elements that are used as a type reference which
since JDK8 can be annotated.
|
JavaClass |
getTypeErasure()
Gets the type erasure of this type, as defined by the JLS3.
|
java.lang.String |
getTypeSignature()
Gets the type signature for this type, as defined by the
JVMS3.
|
java.lang.String |
getUniqueIdentifier()
Gets a unique identifier for this type.
|
java.lang.String |
getUnqualifiedName()
Gets the name of this type in its unqualified form.
|
java.util.Collection<UnresolvedType> |
getUnresolvedInterfaces()
When reverse engineering bytecode, some types cannot be resolved
if the correct owning project is not associated to the JavaProvider.
|
UnresolvedType |
getUnresolvedSuperclass()
When reverse engineering bytecode, some types cannot be resolved
if the correct owning project is not associated to the JavaProvider.
|
java.net.URL |
getURL()
If the input for this type is a *.class file, the returned URL
will be for the *.class file.
|
java.lang.String |
getVMName()
Gets the VM name for this type.
|
boolean |
isAnnotation() |
boolean |
isAnonymousClass()
Determine if this is an anonymous class type.
|
boolean |
isArray() |
boolean |
isAssignableFrom(JavaType subject)
Consider the following expression where S (subject) represents
another type and T (this) represents this type.
|
boolean |
isEnum() |
boolean |
isErasedType()
Is this a class with type parameters instantiated without any type arguments?
For instance, the type of 'new ArrayList()' would be an erased type.
|
boolean |
isExported() |
boolean |
isInterface() |
boolean |
isLocalClass()
Determine if this is a local (to a method) class type.
|
boolean |
isMemberClass()
Determine if this is a member class type.
|
boolean |
isPrimitive()
Determine if this type is a primitive type.
|
boolean |
isSubtypeOf(JavaType supertype)
True if this is a subtype of the indicated argument.
|
getActualTypeArguments, getTypeParameter, getTypeParameters, hasActualTypeArguments, hasTypeParametersgetOwningClass, isAbstract, isPackagePrivate, isPrivate, isProtected, isPublic, isStaticgetResolvedType, getUnresolvedTypegetAnnotation, getAnnotations, getDeclaredAnnotation, getDeclaredAnnotationsgetElementKind, getFile, getModifiers, getOwner, getSourceElement, isDeprecated, isFinal, isHidden, isSourceElement, isSynthetic, printCompiledInfostatic final JavaType[] EMPTY_ARRAY
@Deprecated JavaClass getClosestClass()
getTypeErasure().getTypeErasure(). If this type is a ...
... JavaClass, then it is returned.
... JavaTypeVariable, then the first bound is returned. There is always at least one bound.
... JavaWildcardType, then the lower bound is returned. There is always at least one lower bound.
JavaClass getTypeErasure()
CompiledTmpVariable getThisValue()
boolean isPrimitive()
boolean isArray()
JavaType getComponentType()
int getArrayDimensions()
JavaType getBaseComponentType()
boolean isInterface()
boolean isEnum()
boolean isAnnotation()
boolean isExported()
boolean isMemberClass()
boolean isAnonymousClass()
boolean isLocalClass()
java.lang.String getName()
getName in interface JavaHasNamejava.lang.String getUnqualifiedName()
java.lang.String getQualifiedName()
java.lang.Object
java.util.Map<String,String>
java.lang.String[][]java.lang.String getRawName()
java.lang.String getVMName()
java.lang.String getDescriptor()
java.lang.String getTypeSignature()
Ljava/util/List<Ljava/lang/Object;>;
A JavaTypeVariable returns its "TypeVariableSignature" (JVMS3). A
type variable is uniquely identified by the combination of its
owning declaration AND its type signature. Example value:
TE;
A WildcardType returns its "TypeArgument" value (JVMS3). A
wildcard type is uniquely identified by its type
signature. Example values: *
+Ljava/lang/Object;. java.lang.String getSignature()
java.lang.String getUniqueIdentifier()
getUniqueIdentifier in interface JavaMemberJavaPackage getPackage()
java.lang.String getPackageName()
JavaType getSuperclass()
UnresolvedType getUnresolvedSuperclass()
java.util.Collection<JavaType> getInterfaces()
java.util.Collection<UnresolvedType> getUnresolvedInterfaces()
java.util.Set<JavaType> getHierarchy()
boolean isAssignableFrom(JavaType subject)
void method( S subject )
{
T variable = subject;
}
Notice that because the parameter subject is not a
constant-value, the assignment conversion will not perform the
implicit narrowing conversion.
NOTE: isAssignableFrom will do auto-boxing IFF a
JavaProvider can be retrieved from the subject or target,
otherwise auto-boxing cannot be performed. Consider using
one of the Conversions.applyAssignmentConversion methods
which allow specification of a JavaProvider. SourceFile has
a method to retrieve a JavaProvider.boolean isSubtypeOf(JavaType supertype)
java.util.Collection<JavaField> getDeclaredFields()
JavaField getDeclaredField(java.lang.String name)
name - Require non-null.java.util.Collection<JavaMethod> getDeclaredConstructors()
JavaMethod getDeclaredConstructor(JavaType[] parameters)
parameters - Null indicates an empty parameter list.java.util.Collection<JavaMethod> getDeclaredMethods()
java.util.Collection<JavaMethod> getDeclaredMethods(java.lang.String name)
JavaMethod getDeclaredMethod(java.lang.String name, JavaType[] parameters)
parameters - Null indicates an empty parameter list.java.util.Collection<JavaClass> getDeclaredClasses()
JavaClass getDeclaredClass(java.lang.String name)
java.util.Collection<JavaClass> getDeclaredAnonymousClasses()
java.util.Collection<JavaClass> getDeclaredLocalClasses()
JavaMethod getClinitMethod()
java.util.Collection<JavaField> getFields()
JavaField getField(java.lang.String name)
name - Require non-null.java.util.Collection<JavaMethod> getMethods()
java.util.Collection<JavaMethod> getMethods(java.lang.String name)
name - Require non-null.JavaMethod getMethod(java.lang.String name, JavaType[] parameters)
name - Require non-null.parameters - Null indicates an empty parameter list.java.util.Collection<JavaClass> getClasses()
JavaClass getClass(java.lang.String name)
java.net.URL getURL()
boolean equals(java.lang.Object o)
equals in class java.lang.Objectjava.util.Collection<JavaAnnotation> getTypeAnnotations()
boolean isErasedType()