Class JClassType
Type representing a Java class or interface type.
Constructors
JClassType(TypeOracle, CompilationUnitProvider, JPackage, JClassType, boolean, String, int, int, int, int, boolean) | |
Methods
Constructor Detail
JClassType
public
JClassType(
TypeOracle oracle, CompilationUnitProvider cup, JPackage declaringPackage, JClassType enclosingType, boolean isLocalType, String name, int declStart, int declEnd, int bodyStart, int bodyEnd, boolean isInterface)
Parameters
- oracle
-
- cup
-
- declaringPackage
-
- enclosingType
-
- isLocalType
-
- name
-
- declStart
-
- declEnd
-
- bodyStart
-
- bodyEnd
-
- isInterface
-
Method Detail
addImplementedInterface
public void
addImplementedInterface(
JClassType intf)
Parameters
- intf
-
addMetaData
Adds additional metadata.
Parameters
- tagName
-
- values
-
addModifierBits
public void addModifierBits(int bits)
Parameters
- bits
-
findConstructor
Parameters
- paramTypes
-
findField
Parameters
- name
-
findMethod
Parameters
- name
-
- paramTypes
-
findNestedType
Parameters
- typeName
-
getBodyEnd
public int getBodyEnd()
getBodyStart
public int getBodyStart()
getCompilationUnit
getConstructor
Parameters
- paramTypes
-
getConstructors
getEnclosingType
getField
Parameters
- name
-
getFields
getImplementedInterfaces
getJNISignature
public abstract
String getJNISignature()
getMetaData
Gets each list of metadata for the specified tag name.
Parameters
- tagName
-
getMetaDataTags
Gets the name of available metadata tags.
getMethod
Parameters
- name
-
- paramTypes
-
getMethods
getModifierBits
protected int getModifierBits()
getName
getNestedType
Parameters
- typeName
-
getNestedTypes
getOracle
getOverloads
Parameters
- name
-
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. A method is overridable if
it is not
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.
Return Value
an array of
JMethod objects representing overridable
methods
getPackage
getQualifiedSourceName
public abstract
String getQualifiedSourceName()
getSimpleSourceName
public abstract
String getSimpleSourceName()
getSubtypes
getSuperclass
getTypeHash
isAbstract
public boolean isAbstract()
isArray
isAssignableFrom
public boolean
isAssignableFrom(
JClassType possibleSubtype)
Parameters
- possibleSubtype
-
isAssignableTo
public boolean
isAssignableTo(
JClassType possibleSupertype)
Parameters
- possibleSupertype
-
isClass
isDefaultInstantiable
public boolean isDefaultInstantiable()
Determines if the class can be constructed using a simple
new
operation. Specifically, the class must
- be a class rather than an interface,
- have either no constructors or a parameterless constructor, and
- be a top-level class or a static nested class.
Return Value
true
if the type is default instantiable, or
false
otherwise
isInterface
isLocalType
public boolean isLocalType()
Tests if this type is a local type (within a method).
Return Value
true if this type is a local type, whether it is named or
anonymous.
isMemberType
public boolean isMemberType()
Tests if this type is contained within another type.
Return Value
true if this type has an enclosing type, false if this type is a
top-level type
isParameterized
isPrimitive
isPrivate
public boolean isPrivate()
isProtected
public boolean isProtected()
isPublic
public boolean isPublic()
isStatic
public boolean isStatic()
setSuperclass
Parameters
- type
-
toString