JavaClassWriterpublic interface JavaClassWriter This interface can be used to describe a java class -- either
top level or inner. The resulting class definition
can be viewed by calling {@link java.lang.Object#toString}, but the entire
source definition is only available when used with a JavaFileWriter.
The order of the generated code is up to the implementation. For
example, one implementation may accept fields and methods in any
order and generate all fields together and all methods together, but
maintain the order within the list of fields and methods. Another
implementation may take the same input and generate fields and
methods interspersed among each other in exactly the order they were
added. Still another implementation may make no guarantee as to the
order of members at all. |
Methods Summary |
---|
public void | addClass(com.sun.jdo.spi.persistence.utility.generator.JavaClassWriter classWriter)Adds an inner class to this class.
| public void | addConstructor(java.lang.String name, int modifiers, java.lang.String[] parameterNames, java.lang.String[] parameterTypes, java.lang.String[] exceptions, java.lang.String[] body, java.lang.String[] comments)Adds a constructor to this class. Note that the type format in the
parameter type strings must be package style (that is - it can contain
. but not / or $).
| public void | addField(java.lang.String name, int modifiers, java.lang.String type, java.lang.String initialValue, java.lang.String[] comments)Adds a field to the list of those declared by this class. Note
that the type format must be package style (that is - it can contain
. but not / or $).
| public void | addInitializer(boolean isStatic, java.lang.String[] body, java.lang.String[] comments)Adds an initializer to this class.
| public void | addInterface(java.lang.String name)Adds an interface to the list of those implemented by this class.
| public void | addMethod(java.lang.String name, int modifiers, java.lang.String returnType, java.lang.String[] parameterNames, java.lang.String[] parameterTypes, java.lang.String[] exceptions, java.lang.String[] body, java.lang.String[] comments)Adds a method to this class. Note that the type format in the
return type and parameter type strings must be package style
(that is - it can contain . but not / or $).
| public void | setClassDeclaration(int modifiers, java.lang.String className, java.lang.String[] comments)Sets the information for the class declaration including modifiers,
name, and comments. Note that the name must not be fully qualified.
| public void | setSuperclass(java.lang.String name)Sets the superclass of this class. Note that the name format must
be package style (that is - it can contain . but not / or $).
|
|