Class JTypeWildcard
java.lang.Object
com.sun.codemodel.JType
com.sun.codemodel.JClass
com.sun.codemodel.JTypeWildcard
- All Implemented Interfaces:
JGenerable, Comparable<JType>
Represents a wildcard type like "? extends Foo".
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.
-
Field Summary
FieldsFields inherited from class JClass
EMPTY_ARRAY -
Constructor Summary
Constructors -
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.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 JClass
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, wildcardMethods inherited from class JType
binaryName, compareTo, elementType, isArray, isPrimitive, isReference, parse
-
Field Details
-
bound
-
-
Constructor Details
-
JTypeWildcard
JTypeWildcard(JClass bound)
-
-
Method Details
-
name
-
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
-
_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
-
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 a
JClassforMap<String,Map<Integer>>.This method needs to work recursively.
- Specified by:
substituteParamsin classJClass
-
generate
- Specified by:
generatein interfaceJGenerable- Overrides:
generatein classJClass
-