private class JCodeModel.JReferencedClass extends JClass implements JDeclaration
JReferencedClass is kept in a pool so that they are shared. There is one pool for each JCodeModel object.
It is impossible to cache JReferencedClass globally only because there is the _package() method, which obtains the owner JPackage object, which is scoped to JCodeModel.
| Modifier and Type | Field and Description |
|---|---|
private java.lang.Class<?> |
_class |
EMPTY_ARRAY| Constructor and Description |
|---|
JReferencedClass(java.lang.Class<?> _clazz) |
| Modifier and Type | Method and Description |
|---|---|
JClass |
_extends()
Gets the super class of this class.
|
java.util.Iterator<JClass> |
_implements()
Iterates all super interfaces directly implemented by
this class/interface.
|
JPackage |
_package()
Gets the package to which this class belongs.
|
java.lang.String |
binaryName()
Gets the binary name of the type.
|
void |
declare(JFormatter f) |
java.lang.String |
fullName()
Gets the full name of the type.
|
JPrimitiveType |
getPrimitiveType()
If this class represents one of the wrapper classes
defined in the java.lang package, return the corresponding
primitive type.
|
boolean |
isAbstract()
Checks if this class is an abstract class.
|
boolean |
isArray()
Tell whether or not this is an array type.
|
boolean |
isInterface()
Checks if this object represents an interface.
|
java.lang.String |
name()
Gets the name of this class.
|
JClass |
outer()
Returns the class in which this class is nested, or null if
this is a top-level class.
|
protected JClass |
substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings)
Substitutes the type variables with their actual arguments.
|
JTypeVar[] |
typeParams()
Iterates all the type parameters of this class/interface.
|
array, boxify, dotclass, erasure, generate, getBaseClass, getBaseClass, getTypeParameters, isAssignableFrom, isParameterized, narrow, narrow, narrow, narrow, narrow, narrow, owner, printLink, staticInvoke, staticInvoke, staticRef, staticRef, toString, unboxify, wildcardcompareTo, elementType, isPrimitive, isReference, parsepublic java.lang.String name()
JClasspublic java.lang.String fullName()
JTypepublic java.lang.String binaryName()
JTypebinaryName in class JTypepublic JClass outer()
JClasspublic JPackage _package()
JClasspublic JClass _extends()
JClass_extends in class JClassJClass.
Even if no super class is given explicitly or this JClass
is not a class, this method still returns
JClass for Object.
If this JClass represents Object, return null.public java.util.Iterator<JClass> _implements()
JClass_implements in class JClassJClass objects that represents those interfaces
implemented by this object.public boolean isInterface()
JClassisInterface in class JClasspublic boolean isAbstract()
JClassisAbstract in class JClasspublic JPrimitiveType getPrimitiveType()
JClassgetPrimitiveType in class JClasspublic boolean isArray()
JTypepublic void declare(JFormatter f)
declare in interface JDeclarationpublic JTypeVar[] typeParams()
JClass
For example, if this JClass represents
Set<T>, this method returns an array
that contains single JTypeVar for 'T'.
typeParams in class JClassprotected JClass substituteParams(JTypeVar[] variables, java.util.List<JClass> bindings)
JClass
For example, when this class is Map<String,Map<V>>,
(where V then doing
substituteParams( V, Integer ) returns a JClass
for Map<String,Map<Integer>>.
This method needs to work recursively.
substituteParams in class JClass