Package | Description |
---|---|
com.sun.codemodel |
Library for generating Java source code
|
com.sun.codemodel.fmt | |
com.sun.codemodel.util |
Modifier and Type | Class and Description |
---|---|
(package private) class |
JAnonymousClass
Anonymous class quick hack.
|
(package private) class |
JArrayClass
Array class.
|
private class |
JCodeModel.JReferencedClass
References to existing classes.
|
class |
JDefinedClass
A generated Java class/interface/enum/....
|
(package private) class |
JDirectClass
A special
JClass that represents an unknown class (except its name.) |
(package private) class |
JNarrowedClass
Represents X<Y>.
|
class |
JNullType
Special class object that represents the type of "null".
|
class |
JTypeVar
Type variable used to declare generics.
|
(package private) class |
JTypeWildcard
Represents a wildcard type like "? extends Foo".
|
Modifier and Type | Field and Description |
---|---|
private JClass |
JPrimitiveType.arrayClass |
private JClass |
JClass.arrayClass |
private JClass |
JAnonymousClass.base
Base interface/class from which this anonymous class is built.
|
(package private) JClass |
JNarrowedClass.basis
A generic class with type parameters.
|
private JClass |
JTypeVar.bound |
private JClass |
JTypeWildcard.bound |
private JClass |
JAnnotationUse.clazz
The
Annotation class |
(package private) JClass |
JCatchBlock.exception |
private JClass |
JDefinedClass.superClass
Name of the super class of this class.
|
private JClass |
JCodeModel.wildcard
Cached for
JCodeModel.wildcard() . |
private JClass |
JPrimitiveType.wrapperClass
Corresponding wrapper class.
|
Modifier and Type | Field and Description |
---|---|
private java.util.Set<JClass> |
JMethod._throws
Set of exceptions that this method may throw.
|
private java.util.List<JClass> |
JNarrowedClass.args
Arguments to those parameters.
|
private java.util.Map<JClass,JCommentPart> |
JDocComment.atThrows
list of @throws tags
|
private java.util.ArrayList<JClass> |
JFormatter.ReferenceList.classes |
private java.util.HashSet<JClass> |
JFormatter.importedClasses
set of imported types (including package java types, eventhough we won't generate imports for them)
|
private java.util.Set<JClass> |
JDefinedClass.interfaces
List of interfaces that this class implements
|
Modifier and Type | Method and Description |
---|---|
JClass |
JNarrowedClass._extends() |
JClass |
JNullType._extends() |
JClass |
JArrayClass._extends() |
JClass |
JTypeVar._extends()
Returns the class bound of this variable.
|
JClass |
JDefinedClass._extends()
Returns the class extended by this class.
|
JClass |
JTypeWildcard._extends()
Returns the class bound of this variable.
|
JClass |
JCodeModel.JReferencedClass._extends() |
JClass |
JDirectClass._extends() |
abstract JClass |
JClass._extends()
Gets the super class of this class.
|
JClass |
JPrimitiveType.array() |
JClass |
JClass.array() |
abstract JClass |
JType.array()
Create an array type of this type.
|
JClass |
JPrimitiveType.boxify()
Obtains the wrapper class for this primitive type.
|
JClass |
JClass.boxify()
Deprecated.
calling this method from
JClass
would be meaningless, since it's always guaranteed to
return this. |
abstract JClass |
JType.boxify()
If this class is a primitive type, return the boxed class.
|
JClass |
JCodeModel.directClass(java.lang.String name)
Creates a dummy, unknown
JClass that represents a given name. |
JClass |
JNarrowedClass.erasure() |
JClass |
JClass.erasure() |
JClass |
JAnnotationUse.getAnnotationClass() |
JClass |
JClass.getBaseClass(java.lang.Class<?> baseType) |
JClass |
JClass.getBaseClass(JClass baseType)
Gets the parameterization of the given base type.
|
JClass |
JPrimitiveType.getWrapperClass()
Deprecated.
|
JClass[] |
JDefinedClass.listClasses()
Returns all the nested classes defined in this class.
|
JClass |
JClass.narrow(java.lang.Class<?>... clazz) |
JClass |
JClass.narrow(java.lang.Class<?> clazz)
"Narrows" a generic class to a concrete class by specifying
a type argument.
|
JClass |
JNarrowedClass.narrow(JClass... clazz) |
JClass |
JClass.narrow(JClass... clazz) |
JClass |
JNarrowedClass.narrow(JClass clazz) |
JClass |
JClass.narrow(JClass clazz)
"Narrows" a generic class to a concrete class by specifying
a type argument.
|
JClass |
JClass.narrow(JType type) |
JClass |
JClass.narrow(java.util.List<? extends JClass> clazz) |
JClass |
JDefinedClass.outer() |
JClass |
JCodeModel.JReferencedClass.outer() |
JClass |
JClass.outer()
Returns the class in which this class is nested, or null if
this is a top-level class.
|
private JClass |
JCodeModel.TypeNameParser.parseArguments(JClass rawType)
Parses '<T1,T2,...,Tn>'
|
private JClass |
JCodeModel.TypeNameParser.parseSuffix(JClass clazz)
Parses additional left-associative suffixes, like type arguments
and array specifiers.
|
(package private) JClass |
JCodeModel.TypeNameParser.parseTypeName()
Parses a type name token T (which can be potentially of the form Tr&ly;T1,T2,...>,
or "? extends/super T".)
|
JClass |
JCodeModel.ref(java.lang.Class<?> clazz)
Obtains a reference to an existing class from its Class object.
|
JClass |
JPackage.ref(java.lang.String name)
Reference a class within this package.
|
JClass |
JCodeModel.ref(java.lang.String fullyQualifiedClassName)
Obtains a reference to an existing class from its fully-qualified
class name.
|
protected JClass |
JNarrowedClass.substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings) |
protected JClass |
JNullType.substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings) |
protected JClass |
JArrayClass.substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings) |
protected JClass |
JTypeVar.substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings) |
protected JClass |
JDefinedClass.substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings) |
protected JClass |
JTypeWildcard.substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings) |
protected JClass |
JCodeModel.JReferencedClass.substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings) |
protected JClass |
JDirectClass.substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings) |
protected abstract JClass |
JClass.substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings)
Substitutes the type variables with their actual arguments.
|
JClass |
JCodeModel.wildcard()
Gets a
JClass representation for "?",
which is equivalent to "? extends Object". |
JClass |
JClass.wildcard()
Create "? extends T" from T.
|
Modifier and Type | Method and Description |
---|---|
java.util.Iterator<JClass> |
JNarrowedClass._implements() |
java.util.Iterator<JClass> |
JNullType._implements() |
java.util.Iterator<JClass> |
JArrayClass._implements() |
java.util.Iterator<JClass> |
JTypeVar._implements()
Returns the interface bounds of this variable.
|
java.util.Iterator<JClass> |
JDefinedClass._implements()
Returns an iterator that walks the nested classes defined in this
class.
|
java.util.Iterator<JClass> |
JTypeWildcard._implements()
Returns the interface bounds of this variable.
|
java.util.Iterator<JClass> |
JCodeModel.JReferencedClass._implements() |
java.util.Iterator<JClass> |
JDirectClass._implements() |
abstract java.util.Iterator<JClass> |
JClass._implements()
Iterates all super interfaces directly implemented by
this class/interface.
|
java.util.List<JClass> |
JFormatter.ReferenceList.getClasses() |
private java.util.Set<JClass> |
JMethod.getThrows() |
java.util.List<JClass> |
JNarrowedClass.getTypeParameters() |
java.util.List<JClass> |
JClass.getTypeParameters()
If this class is parameterized, return the type parameter of the given index.
|
Modifier and Type | Method and Description |
---|---|
JCatchBlock |
JTryBlock._catch(JClass exception) |
JDefinedClass |
JDefinedClass._extends(JClass superClass)
This class extends the specifed class.
|
JDefinedClass |
JDefinedClass._implements(JClass iface)
This class implements the specifed interface.
|
static JInvocation |
JExpr._new(JClass c) |
JMethod |
JMethod._throws(JClass exception)
Add an exception to the list of exceptions that this
method may throw.
|
void |
JFormatter.ReferenceList.add(JClass clazz) |
JCommentPart |
JDocComment.addThrows(JClass exception)
add an @throws tag to the javadoc
|
JAnnotationUse |
JVar.annotate(JClass clazz)
Adds an annotation to this variable.
|
JAnnotationUse |
JPackage.annotate(JClass clazz) |
JAnnotationUse |
JEnumConstant.annotate(JClass clazz)
Adds an annotation to this variable.
|
JAnnotationUse |
JDefinedClass.annotate(JClass clazz)
Adding ability to annotate a class
|
JAnnotationUse |
JAnnotatable.annotate(JClass clazz)
Adds an annotation to this program element.
|
JAnnotationUse |
JAnnotationArrayMember.annotate(JClass clazz)
Adds a new annotation to the array.
|
JAnnotationUse |
JMethod.annotate(JClass clazz)
Adds an annotation to this variable.
|
JDefinedClass |
JCodeModel.anonymousClass(JClass baseType)
Creates a new anonymous class.
|
JTypeVar |
JTypeVar.bound(JClass c)
Adds a bound to this variable.
|
static JExpression |
JExpr.dotclass(JClass cl) |
JTypeVar |
JDefinedClass.generify(java.lang.String name,
JClass bound) |
JTypeVar |
JGenerifiableImpl.generify(java.lang.String name,
JClass bound) |
JTypeVar |
JGenerifiable.generify(java.lang.String name,
JClass bound)
Adds a new type variable to this declaration with a bound.
|
JClass |
JClass.getBaseClass(JClass baseType)
Gets the parameterization of the given base type.
|
boolean |
JClass.isAssignableFrom(JClass derived)
Checks the relationship between two classes.
|
JClass |
JNarrowedClass.narrow(JClass... clazz) |
JClass |
JClass.narrow(JClass... clazz) |
JClass |
JNarrowedClass.narrow(JClass clazz) |
JClass |
JClass.narrow(JClass clazz)
"Narrows" a generic class to a concrete class by specifying
a type argument.
|
JDefinedClass |
JCodeModel.newAnonymousClass(JClass baseType)
Deprecated.
The naming convention doesn't match the rest of the CodeModel.
Use
JCodeModel.anonymousClass(JClass) instead. |
private JClass |
JCodeModel.TypeNameParser.parseArguments(JClass rawType)
Parses '<T1,T2,...,Tn>'
|
private JClass |
JCodeModel.TypeNameParser.parseSuffix(JClass clazz)
Parses additional left-associative suffixes, like type arguments
and array specifiers.
|
void |
JPackage.remove(JClass c)
Removes a class from this package.
|
JInvocation |
JBlock.staticInvoke(JClass type,
java.lang.String method)
Creates a static invocation statement.
|
private boolean |
JFormatter.supressImport(JClass clazz,
JClass c)
determine if an import statement should be supressed
|
JFormatter |
JFormatter.t(JClass type)
Print a type name.
|
Modifier and Type | Method and Description |
---|---|
JClass |
JClass.narrow(java.util.List<? extends JClass> clazz) |
protected JClass |
JNarrowedClass.substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings) |
protected JClass |
JNullType.substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings) |
protected JClass |
JArrayClass.substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings) |
protected JClass |
JTypeVar.substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings) |
protected JClass |
JDefinedClass.substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings) |
protected JClass |
JTypeWildcard.substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings) |
protected JClass |
JCodeModel.JReferencedClass.substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings) |
protected JClass |
JDirectClass.substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings) |
protected abstract JClass |
JClass.substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings)
Substitutes the type variables with their actual arguments.
|
Constructor and Description |
---|
JAnnotationUse(JClass clazz) |
JAnonymousClass(JClass _base) |
JCatchBlock(JClass exception) |
JInvocation(JClass type,
JMethod method) |
JInvocation(JClass type,
java.lang.String name)
Invokes a static method on a class.
|
JNarrowedClass(JClass basis,
JClass arg) |
JNarrowedClass(JClass basis,
java.util.List<JClass> args) |
JTypeWildcard(JClass bound) |
Constructor and Description |
---|
JNarrowedClass(JClass basis,
java.util.List<JClass> args) |
Modifier and Type | Class and Description |
---|---|
private class |
JStaticJavaFile.JStaticClass |
Modifier and Type | Method and Description |
---|---|
JClass |
JStaticJavaFile.JStaticClass._extends() |
JClass |
JStaticJavaFile.getJClass()
Returns a class object that represents a statically generated code.
|
protected JClass |
JStaticJavaFile.JStaticClass.substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings) |
Modifier and Type | Method and Description |
---|---|
java.util.Iterator<JClass> |
JStaticJavaFile.JStaticClass._implements() |
Modifier and Type | Method and Description |
---|---|
protected JClass |
JStaticJavaFile.JStaticClass.substituteParams(JTypeVar[] variables,
java.util.List<JClass> bindings) |
Modifier and Type | Field and Description |
---|---|
static java.util.Comparator<JClass> |
ClassNameComparator.theInstance |
Modifier and Type | Method and Description |
---|---|
int |
ClassNameComparator.compare(JClass l,
JClass r) |