Package com.sun.codemodel
Class JNarrowedClass
java.lang.Object
com.sun.codemodel.JType
com.sun.codemodel.JClass
com.sun.codemodel.JNarrowedClass
- All Implemented Interfaces:
JGenerable
,Comparable<JType>
Represents X<Y>.
TODO: consider separating the decl and the use.
-
Field Summary
FieldsModifier and TypeFieldDescriptionArguments to those parameters.(package private) final JClass
A generic class with type parameters.Fields inherited from class com.sun.codemodel.JClass
EMPTY_ARRAY
-
Constructor Summary
ConstructorsConstructorDescriptionJNarrowedClass
(JClass basis, JClass arg) JNarrowedClass
(JClass basis, List<JClass> args) -
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.boolean
erasure()
Returns the erasure of this type.fullName()
Gets the full name of the type.void
If this class is parameterized, return the type parameter of the given index.int
hashCode()
boolean
Checks if this class is an abstract class.boolean
isArray()
Tell whether or not this is an array type.boolean
Checks if this object represents an interface.name()
Gets the name of this class."Narrows" a generic class to a concrete class by specifying a type argument.(package private) void
Prints the class name in javadoc @link format.protected JClass
substituteParams
(JTypeVar[] variables, List<JClass> bindings) Substitutes the type variables with their actual arguments.Methods inherited from class com.sun.codemodel.JClass
array, boxify, dotclass, getBaseClass, getBaseClass, getPrimitiveType, isAssignableFrom, isParameterized, narrow, narrow, narrow, narrow, outer, owner, staticInvoke, staticInvoke, staticRef, staticRef, toString, typeParams, unboxify, wildcard
Methods inherited from class com.sun.codemodel.JType
compareTo, elementType, isPrimitive, isReference, parse
-
Field Details
-
basis
A generic class with type parameters. -
args
Arguments to those parameters.
-
-
Constructor Details
-
JNarrowedClass
-
JNarrowedClass
-
-
Method Details
-
narrow
Description copied from class:JClass
"Narrows" a generic class to a concrete class by specifying a type argument..narrow(X)
buildsSet<X>
fromSet
. -
narrow
-
name
Description copied from class:JClass
Gets the name of this class. -
fullName
Description copied from class:JType
Gets 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:JType
Gets the binary name of the type. See http://java.sun.com/docs/books/jls/third_edition/html/binaryComp.html#44909- Overrides:
binaryName
in classJType
- Returns:
- Name like "Foo$Bar", "int", "java.lang.String", "java.io.File[]". Never null.
-
generate
- Specified by:
generate
in interfaceJGenerable
- Overrides:
generate
in classJClass
-
printLink
Description copied from class:JClass
Prints the class name in javadoc @link format. -
_package
Description copied from class:JClass
Gets the package to which this class belongs. TODO: shall we move move this down? -
_extends
Description copied from class:JClass
Gets the super class of this class.- Specified by:
_extends
in 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 thisJClass
is not a class, this method still returnsJClass
forObject
. If this JClass representsObject
, return null.
-
_implements
Description copied from class:JClass
Iterates all super interfaces directly implemented by this class/interface.- Specified by:
_implements
in classJClass
- Returns:
- A non-null valid iterator that iterates all
JClass
objects that represents those interfaces implemented by this object.
-
erasure
Description copied from class:JType
Returns the erasure of this type. -
isInterface
public boolean isInterface()Description copied from class:JClass
Checks if this object represents an interface.- Specified by:
isInterface
in classJClass
-
isAbstract
public boolean isAbstract()Description copied from class:JClass
Checks if this class is an abstract class.- Specified by:
isAbstract
in classJClass
-
isArray
public boolean isArray()Description copied from class:JType
Tell whether or not this is an array type. -
equals
-
hashCode
public int hashCode() -
substituteParams
Description copied from class:JClass
Substitutes 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
JClass
forMap<String,Map<Integer>>
.This method needs to work recursively.
- Specified by:
substituteParams
in classJClass
-
getTypeParameters
Description copied from class:JClass
If this class is parameterized, return the type parameter of the given index.- Overrides:
getTypeParameters
in classJClass
-