Package com.sun.codemodel
Class JTypeVar
java.lang.Object
com.sun.codemodel.JType
com.sun.codemodel.JClass
com.sun.codemodel.JTypeVar
- All Implemented Interfaces:
JDeclaration,JGenerable,Comparable<JType>
Type variable used to declare generics.
- Author:
- Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- See Also:
-
Field Summary
Fields inherited from class com.sun.codemodel.JClass
EMPTY_ARRAY -
Method Summary
Modifier and TypeMethodDescription_extends()Returns the class bound of this variable.Returns the interface bounds of this variable._package()Gets the package to which this class belongs.bound()Adds a bound to this variable.voidPrints out the declaration of the variable.fullName()Gets the full name of the type.voidbooleanChecks if this class is an abstract class.booleanChecks if this object represents an interface.name()Gets the name of this class.protected JClasssubstituteParams(JTypeVar[] variables, List<JClass> bindings) Substitutes the type variables with their actual arguments.Methods inherited from class com.sun.codemodel.JClass
array, boxify, dotclass, erasure, getBaseClass, getBaseClass, getPrimitiveType, getTypeParameters, isAssignableFrom, isParameterized, narrow, narrow, narrow, narrow, narrow, narrow, outer, owner, staticInvoke, staticInvoke, staticRef, staticRef, toString, typeParams, unboxify, wildcardMethods inherited from class com.sun.codemodel.JType
binaryName, compareTo, elementType, isArray, isPrimitive, isReference, parse
-
Method Details
-
name
Description copied from class:JClassGets the name of this class. -
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. -
_package
Description copied from class:JClassGets the package to which this class belongs. TODO: shall we move move this down? -
bound
Adds a bound to this variable.- Returns:
- this
-
bound
- Returns:
- bound of this variable
-
_extends
Returns the class bound of this variable.If no bound is given, this method returns
Object.- 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
Returns the interface bounds of this variable.- 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
-
declare
Prints out the declaration of the variable.- Specified by:
declarein interfaceJDeclaration
-
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 aJClassforMap<String,Map<Integer>>.This method needs to work recursively.
- Specified by:
substituteParamsin classJClass
-
generate
- Specified by:
generatein interfaceJGenerable- Overrides:
generatein classJClass
-