To be exact, this object represents an "use" of a reference type,
not necessarily a declaration of it, which is modeled as JDefinedClass.
| Modifier and Type | Field and Description |
|---|---|
| private final JCodeModel | |
| private JClass | |
| protected static final JTypeVar[] | EMPTY_ARRAY
Sometimes useful reusable empty array. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public abstract JClass | |
| public abstract Iterator | Returns: A non-null valid iterator that iterates all objects that represents those interfaces implemented by this object.Iterates all super interfaces directly implemented by this class/interface. |
| public abstract JPackage | |
| public JClass | |
| public JClass | boxify()
Implements abstract com.
Deprecated
If this class is a primitive type, return the boxed class. |
| public final JExpression | |
| public JClass | |
| public void | |
| public final JClass | Returns: The use ofbaseType in this type.
or null if the type is not assignable to the base type.The class whose parameterization we are interested in. baseType)Gets the parameterization of the given base type. |
| public final JClass | |
| public JPrimitiveType | getPrimitiveType()
If this class represents one of the wrapper classes defined in the java.lang package, return the corresponding primitive type. |
| public List | |
| public abstract boolean | |
| public final boolean | |
| public abstract boolean | |
| public final boolean | |
| public abstract String | Returns: name of this class, without any qualification. For example, this method returns "String" forjava.lang.String.Implements abstract com. Gets the name of this class. |
| public JClass | |
| public JClass | |
| public JClass | |
| public JClass | |
| public JClass | |
| public JClass | |
| public JClass | |
| public final JCodeModel | owner()
Implements abstract com. Gets the JCodeModel object to which this object belongs. |
| pack-priv void | |
| public final JInvocation | |
| public final JInvocation | |
| public final JFieldRef | |
| public final JFieldRef | |
| protected abstract JClass | substituteParams(JTypeVar[] variables, List<JClass> bindings)
Substitutes the type variables with their actual arguments. |
| public String | toString()
Overrides com. Returns a string representation of the object. |
| public JTypeVar[] | |
| public JType | unboxify()
Implements abstract com. If this class is a wrapper type for a primitive, return the primitive type. |
| public final JClass |
| _owner | back to summary |
|---|---|
| private final JCodeModel _owner | |
| arrayClass | back to summary |
|---|---|
| private JClass arrayClass | |
| EMPTY_ARRAY | back to summary |
|---|---|
| protected static final JTypeVar[] EMPTY_ARRAY Sometimes useful reusable empty array. | |
| JClass | back to summary |
|---|---|
| protected JClass(JCodeModel _owner) | |
| _extends | back to summary |
|---|---|
| public abstract JClass _extends() Gets the super class of this class. | |
| _implements | back to summary |
|---|---|
| public abstract Iterator Iterates all super interfaces directly implemented by this class/interface. | |
| _package | back to summary |
|---|---|
| public abstract JPackage _package() Gets the package to which this class belongs. Todo shall we move move this down? | |
| array | back to summary |
|---|---|
| public JClass array() Implements abstract com. Doc from com. Create an array type of this type. This method is undefined for primitive void type, which doesn't have any corresponding array representation.
| |
| boxify | back to summary |
|---|---|
| public JClass boxify() Implements abstract com. Doc from com. Deprecated
If this class is a primitive type, return the boxed class.
Otherwise return For example, for "int", this method returns "java.lang.Integer".
| |
| dotclass | back to summary |
|---|---|
| public final JExpression dotclass() | |
| erasure | back to summary |
|---|---|
| public JClass erasure() Overrides com. Doc from com. Returns the erasure of this type.
| |
| generate | back to summary |
|---|---|
| public void generate(JFormatter f) Implements com.
| |
| getBaseClass | back to summary |
|---|---|
| public final JClass getBaseClass(JClass baseType) Gets the parameterization of the given base type. For example, given the following
This method works like this:
| |
| getBaseClass | back to summary |
|---|---|
| public final JClass getBaseClass(Class<?> baseType) | |
| getPrimitiveType | back to summary |
|---|---|
| public JPrimitiveType getPrimitiveType() If this class represents one of the wrapper classes defined in the java.lang package, return the corresponding primitive type. Otherwise null. | |
| getTypeParameters | back to summary |
|---|---|
| public List If this class is parameterized, return the type parameter of the given index. | |
| isAbstract | back to summary |
|---|---|
| public abstract boolean isAbstract() Checks if this class is an abstract class. | |
| isAssignableFrom | back to summary |
|---|---|
| public final boolean isAssignableFrom(JClass derived) Checks the relationship between two classes.
This method works in the same way as | |
| isInterface | back to summary |
|---|---|
| public abstract boolean isInterface() Checks if this object represents an interface. | |
| isParameterized | back to summary |
|---|---|
| public final boolean isParameterized() Returns true if this class is a parameterized class. | |
| name | back to summary |
|---|---|
| public abstract String name() Implements abstract com. Gets the name of this class. | |
| narrow | back to summary |
|---|---|
| public JClass narrow(Class<?> clazz) "Narrows" a generic class to a concrete class by specifying a type argument.
| |
| narrow | back to summary |
|---|---|
| public JClass narrow(Class<?>... clazz) | |
| narrow | back to summary |
|---|---|
| public JClass narrow(JClass clazz) "Narrows" a generic class to a concrete class by specifying a type argument.
| |
| narrow | back to summary |
|---|---|
| public JClass narrow(JType type) | |
| narrow | back to summary |
|---|---|
| public JClass narrow(JClass... clazz) | |
| narrow | back to summary |
|---|---|
| public JClass narrow(List<? extends JClass> clazz) | |
| outer | back to summary |
|---|---|
| public JClass outer() Returns the class in which this class is nested, or | |
| owner | back to summary |
|---|---|
| public final JCodeModel owner() Implements abstract com. Gets the JCodeModel object to which this object belongs.
| |
| printLink | back to summary |
|---|---|
| pack-priv void printLink(JFormatter f) Prints the class name in javadoc @link format. | |
| staticInvoke | back to summary |
|---|---|
| public final JInvocation staticInvoke(JMethod method) Generates a static method invocation. | |
| staticInvoke | back to summary |
|---|---|
| public final JInvocation staticInvoke(String method) Generates a static method invocation. | |
| staticRef | back to summary |
|---|---|
| public final JFieldRef staticRef(String field) Static field reference. | |
| staticRef | back to summary |
|---|---|
| public final JFieldRef staticRef(JVar field) Static field reference. | |
| substituteParams | back to summary |
|---|---|
| protected abstract JClass substituteParams(JTypeVar[] variables, List<JClass> bindings) Substitutes the type variables with their actual arguments.
For example, when this class is This method needs to work recursively. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides com. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| typeParams | back to summary |
|---|---|
| public JTypeVar[] typeParams() Iterates all the type parameters of this class/interface.
For example, if this represents
| |
| unboxify | back to summary |
|---|---|
| public JType unboxify() Implements abstract com. Doc from com. If this class is a wrapper type for a primitive, return the primitive type.
Otherwise return For example, for "java.lang.Integer", this method returns "int".
| |
| wildcard | back to summary |
|---|---|
| public final JClass wildcard() Create "? extends T" from T.
| |