|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.codemodel.JCodeModel
public final class JCodeModel
Root of the code DOM.
Field Summary | |
---|---|
JPrimitiveType |
BOOLEAN
|
JPrimitiveType |
BYTE
|
JPrimitiveType |
CHAR
|
JPrimitiveType |
DOUBLE
|
JPrimitiveType |
FLOAT
|
JPrimitiveType |
INT
|
protected static boolean |
isCaseSensitiveFileSystem
If the flag is true, we will consider two classes "Foo" and "foo" as a collision. |
JPrimitiveType |
LONG
|
JNullType |
NULL
Obtains a reference to the special "null" type. |
JPrimitiveType |
SHORT
|
JPrimitiveType |
VOID
|
Constructor Summary | |
---|---|
JCodeModel()
|
Method Summary | |
---|---|
JDefinedClass |
_class(java.lang.String fullyqualifiedName)
Creates a new generated class. |
JDefinedClass |
_getClass(java.lang.String fullyQualifiedName)
Gets a reference to the already created generated class. |
JPackage |
_package(java.lang.String name)
Add a package to the list of packages to be generated |
void |
build(CodeWriter out)
Generates Java source code. |
void |
build(java.io.File destDir)
A convenience method for build(destDir,System.out) . |
void |
build(java.io.File destDir,
java.io.PrintStream status)
Generates Java source code. |
JDefinedClass |
newAnonymousClass(JClass baseType)
Creates a new anonymous class. |
java.util.Iterator |
packages()
Returns an iterator that walks the packages defined using this code writer. |
JClass |
ref(java.lang.Class clazz)
Obtains a reference to an existing class from its Class object. |
JClass |
ref(java.lang.String fullyQualifiedClassName)
Obtains a reference to an existing class from its fully-qualified class name. |
JPackage |
rootPackage()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final JNullType NULL
public final JPrimitiveType VOID
public final JPrimitiveType BOOLEAN
public final JPrimitiveType BYTE
public final JPrimitiveType SHORT
public final JPrimitiveType CHAR
public final JPrimitiveType INT
public final JPrimitiveType FLOAT
public final JPrimitiveType LONG
public final JPrimitiveType DOUBLE
protected static final boolean isCaseSensitiveFileSystem
Constructor Detail |
---|
public JCodeModel()
Method Detail |
---|
public JPackage _package(java.lang.String name)
name
- Name of the package. Use "" to indicate the root package.
public final JPackage rootPackage()
public java.util.Iterator packages()
public JDefinedClass _class(java.lang.String fullyqualifiedName) throws JClassAlreadyExistsException
JClassAlreadyExistsException
- When the specified class/interface was already created.public JDefinedClass _getClass(java.lang.String fullyQualifiedName)
public JDefinedClass newAnonymousClass(JClass baseType)
public void build(java.io.File destDir, java.io.PrintStream status) throws java.io.IOException
build(CodeWriter)
.
destDir
- source files are generated into this directory.status
- if non-null, progress indication will be sent to this stream.
java.io.IOException
public void build(java.io.File destDir) throws java.io.IOException
build(destDir,System.out)
.
java.io.IOException
public void build(CodeWriter out) throws java.io.IOException
java.io.IOException
public JClass ref(java.lang.Class clazz)
public JClass ref(java.lang.String fullyQualifiedClassName) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
- If the specified class is not available in the current class path.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |