Top Description Fields Constructors Methods
com.sun.codemodel

public final Class JTypeVar

extends JClass
implements JDeclaration
Class Inheritance
All Implemented Interfaces
com.sun.codemodel.JDeclaration
Imports
java.util.Iterator, .List

Type variable used to declare generics.
Author
Kohsuke Kawaguchi ([email protected])
See Also
JGenerifiable

Field Summary

Modifier and TypeField and Description
private JClass
private final String
Inherited from com.sun.codemodel.JClass:
EMPTY_ARRAY

Constructor Summary

AccessConstructor and Description
pack-priv
JTypeVar(JCodeModel owner, String _name)

Method Summary

Modifier and TypeMethod and Description
public JClass
_extends()

Implements abstract com.sun.codemodel.JClass._extends.

Returns the class bound of this variable.

public Iterator<JClass>
_implements()

Implements abstract com.sun.codemodel.JClass._implements.

Returns the interface bounds of this variable.

public JPackage
_package()

Implements abstract com.sun.codemodel.JClass._package.

Gets the package to which this class belongs.

public JTypeVar

Returns:

this
bound
(JClass c)

Adds a bound to this variable.

public JClass
bound()

Returns: bound of this variable

public void
declare(JFormatter f)

Implements com.sun.codemodel.JDeclaration.declare.

Prints out the declaration of the variable.

public String
fullName()

Implements abstract com.sun.codemodel.JType.fullName.

Gets the full name of the type.

public void
public boolean
isAbstract()

Implements abstract com.sun.codemodel.JClass.isAbstract.

Checks if this class is an abstract class.

public boolean
isInterface()

Implements abstract com.sun.codemodel.JClass.isInterface.

Checks if this object represents an interface.

public String
name()

Implements abstract com.sun.codemodel.JClass.name.

Gets the name of this class.

protected JClass
substituteParams(JTypeVar[] variables, List<JClass> bindings)

Implements abstract com.sun.codemodel.JClass.substituteParams.

Substitutes the type variables with their actual arguments.

Inherited from com.sun.codemodel.JClass:
arrayboxifydotclasserasuregetBaseClassgetBaseClassgetPrimitiveTypegetTypeParametersisAssignableFromisParameterizednarrownarrownarrownarrownarrownarrowouterownerprintLinkstaticInvokestaticInvokestaticRefstaticReftoStringtypeParamsunboxifywildcard

Field Detail

boundback to summary
private JClass bound
nameback to summary
private final String name

Constructor Detail

JTypeVarback to summary
pack-priv JTypeVar(JCodeModel owner, String _name)

Method Detail

_extendsback to summary
public JClass _extends()

Implements abstract com.sun.codemodel.JClass._extends.

Returns the class bound of this variable.

If no bound is given, this method returns Object.

Annotations
@Override
_implementsback to summary
public Iterator<JClass> _implements()

Implements abstract com.sun.codemodel.JClass._implements.

Returns the interface bounds of this variable.

Annotations
@Override
_packageback to summary
public JPackage _package()

Implements abstract com.sun.codemodel.JClass._package.

Doc from com.sun.codemodel.JClass._package.

Gets the package to which this class belongs.

Todo

shall we move move this down?

Annotations
@Override
boundback to summary
public JTypeVar bound(JClass c)

Adds a bound to this variable.

Returns:JTypeVar

this

boundback to summary
public JClass bound()
Returns:JClass

bound of this variable

declareback to summary
public void declare(JFormatter f)

Implements com.sun.codemodel.JDeclaration.declare.

Prints out the declaration of the variable.

Annotations
@Override
fullNameback to summary
public String fullName()

Implements abstract com.sun.codemodel.JType.fullName.

Doc from com.sun.codemodel.JType.fullName.

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.

Annotations
@Override
generateback to summary
public void generate(JFormatter f)

Overrides com.sun.codemodel.JClass.generate.

Implements com.sun.codemodel.JGenerable.generate.

Annotations
@Override
isAbstractback to summary
public boolean isAbstract()

Implements abstract com.sun.codemodel.JClass.isAbstract.

Doc from com.sun.codemodel.JClass.isAbstract.

Checks if this class is an abstract class.

Annotations
@Override
isInterfaceback to summary
public boolean isInterface()

Implements abstract com.sun.codemodel.JClass.isInterface.

Doc from com.sun.codemodel.JClass.isInterface.

Checks if this object represents an interface.

Annotations
@Override
nameback to summary
public String name()

Implements abstract com.sun.codemodel.JClass.name.

Doc from com.sun.codemodel.JClass.name.

Gets the name of this class.

Annotations
@Override
substituteParamsback to summary
protected JClass substituteParams(JTypeVar[] variables, List<JClass> bindings)

Implements abstract com.sun.codemodel.JClass.substituteParams.

Doc from com.sun.codemodel.JClass.substituteParams.

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 for Map<String,Map<Integer>>.

This method needs to work recursively.

Annotations
@Override