Class JCodeModel.JReferencedClass
java.lang.Object
com.sun.codemodel.JType
com.sun.codemodel.JClass
com.sun.codemodel.JCodeModel.JReferencedClass
- All Implemented Interfaces:
JDeclaration, JGenerable, Comparable<JType>
- Enclosing class:
JCodeModel
References to existing classes.
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.
-
Field Summary
FieldsFields inherited from class JClass
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription_extends()Gets the super class of this class.Iterates all super interfaces directly implemented by this class/interface._package()Gets the package to which this class belongs.Gets the binary name of the type.voidfullName()Gets the full name of the type.If this class represents one of the wrapper classes defined in the java.lang package, return the corresponding primitive type.booleanChecks if this class is an abstract class.booleanisArray()Tell whether or not this is an array type.booleanChecks if this object represents an interface.name()Gets the name of this class.outer()Returns the class in which this class is nested, or null if this is a top-level class.protected JClasssubstituteParams(JTypeVar[] variables, List<JClass> bindings) Substitutes the type variables with their actual arguments.JTypeVar[]Iterates all the type parameters of this class/interface.Methods inherited from class JClass
array, boxify, dotclass, erasure, generate, getBaseClass, getBaseClass, getTypeParameters, isAssignableFrom, isParameterized, narrow, narrow, narrow, narrow, narrow, narrow, owner, printLink, staticInvoke, staticInvoke, staticRef, staticRef, toString, unboxify, wildcardMethods inherited from class JType
compareTo, elementType, isPrimitive, isReference, parse
-
Field Details
-
_class
-
-
Constructor Details
-
JReferencedClass
JReferencedClass(Class<?> _clazz)
-
-
Method Details
-
name
-
fullName
Description copied from class:JTypeGets the full name of the type. See http://java.sun.com/docs/books/jls/second_edition/html/names.doc.html#25430 for the details. -
binaryName
Description copied from class:JTypeGets the binary name of the type. See http://java.sun.com/docs/books/jls/third_edition/html/binaryComp.html#44909- Overrides:
binaryNamein classJType- Returns:
- Name like "Foo$Bar", "int", "java.lang.String", "java.io.File[]". Never null.
-
outer
-
_package
-
_extends
Description copied from class:JClassGets the super class of this class.- Specified by:
_extendsin classJClass- Returns:
- Returns the JClass representing the superclass of the
entity (class or interface) represented by this
JClass. Even if no super class is given explicitly or thisJClassis not a class, this method still returnsJClassforObject. If this JClass representsObject, return null.
-
_implements
Description copied from class:JClassIterates all super interfaces directly implemented by this class/interface.- Specified by:
_implementsin classJClass- Returns:
- A non-null valid iterator that iterates all
JClassobjects that represents those interfaces implemented by this object.
-
isInterface
public boolean isInterface()Description copied from class:JClassChecks if this object represents an interface.- Specified by:
isInterfacein classJClass
-
isAbstract
public boolean isAbstract()Description copied from class:JClassChecks if this class is an abstract class.- Specified by:
isAbstractin classJClass
-
getPrimitiveType
Description copied from class:JClassIf this class represents one of the wrapper classes defined in the java.lang package, return the corresponding primitive type. Otherwise null.- Overrides:
getPrimitiveTypein classJClass
-
isArray
-
declare
- Specified by:
declarein interfaceJDeclaration
-
typeParams
-
substituteParams
Description copied from class:JClassSubstitutes the type variables with their actual arguments.For example, when this class is Map<String,Map<V>>, (where V then doing substituteParams( V, Integer ) returns a
JClassforMap<String,Map<Integer>>.This method needs to work recursively.
- Specified by:
substituteParamsin classJClass
-