final class JTypeWildcard extends JClass
Instances of this class can be obtained from JClass.wildcard()
TODO: extend this to cover "? super Integer".
Our modeling of types are starting to look really ugly. ideally it should have been done somewhat like APT, but it's too late now.
Modifier and Type | Field and Description |
---|---|
private JClass |
bound |
EMPTY_ARRAY
Constructor and Description |
---|
JTypeWildcard(JClass bound) |
Modifier and Type | Method and Description |
---|---|
JClass |
_extends()
Returns the class bound of this variable.
|
java.util.Iterator<JClass> |
_implements()
Returns the interface bounds of this variable.
|
JPackage |
_package()
Gets the package to which this class belongs.
|
java.lang.String |
fullName()
Gets the full name of the type.
|
void |
generate(JFormatter f) |
boolean |
isAbstract()
Checks if this class is an abstract class.
|
boolean |
isInterface()
Checks if this object represents an interface.
|
java.lang.String |
name()
Gets the name of this class.
|
protected JClass |
substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings)
Substitutes the type variables with their actual arguments.
|
array, boxify, dotclass, erasure, getBaseClass, getBaseClass, getPrimitiveType, getTypeParameters, isAssignableFrom, isParameterized, narrow, narrow, narrow, narrow, narrow, narrow, outer, owner, printLink, staticInvoke, staticInvoke, staticRef, staticRef, toString, typeParams, unboxify, wildcard
binaryName, compareTo, elementType, isArray, isPrimitive, isReference, parse
private final JClass bound
JTypeWildcard(JClass bound)
public java.lang.String name()
JClass
public java.lang.String fullName()
JType
public JPackage _package()
JClass
public JClass _extends()
If no bound is given, this method returns Object
.
_extends
in class JClass
JClass
.
Even if no super class is given explicitly or this JClass
is not a class, this method still returns
JClass
for Object
.
If this JClass represents Object
, return null.public java.util.Iterator<JClass> _implements()
_implements
in class JClass
JClass
objects that represents those interfaces
implemented by this object.public boolean isInterface()
JClass
isInterface
in class JClass
public boolean isAbstract()
JClass
isAbstract
in class JClass
protected JClass substituteParams(JTypeVar[] variables, java.util.List<JClass> bindings)
JClass
For example, when this class is Map<String,Map<V>>,
(where V then doing
substituteParams( V, Integer ) returns a JClass
for Map<String,Map<Integer>>
.
This method needs to work recursively.
substituteParams
in class JClass
public void generate(JFormatter f)
generate
in interface JGenerable
generate
in class JClass