public class JavaSourceWriterBuilder
extends java.lang.Object
JavaSourceWriter
instances.
Experimental API - subject to change.
Constructor and Description |
---|
JavaSourceWriterBuilder(AbortablePrintWriter printWriter,
java.lang.String packageName,
java.lang.String className) |
Modifier and Type | Method and Description |
---|---|
void |
addAnnotationDeclaration(java.lang.String declaration)
Add an class/interface annotation.
|
void |
addImplementedInterface(java.lang.String intfName)
Add an implemented/extended interface.
|
void |
addImport(java.lang.String typeName)
Add an import entry.
|
SourceWriter |
createSourceWriter()
Creates an implementation of
JavaSourceWriter that can be used to write
the innards of a class. |
java.lang.Iterable<java.lang.String> |
getAnnotationDeclarations()
Get the annotations.
|
java.lang.String |
getClassName()
Get the simple name of the class being created.
|
java.lang.String |
getFullyQualifiedClassName()
Get the fully-qualified source name of the class being created.
|
java.lang.Iterable<java.lang.String> |
getInterfaceNames()
Get the implemented/extended interfaces for the class being created.
|
java.lang.String |
getPackageName()
Get the package of the class being created.
|
java.lang.String |
getSuperclassName()
Get the superclass for the class being created.
|
void |
makeInterface()
We are creating an interface instead of a class.
|
void |
setJavaDocCommentForClass(java.lang.String comment)
Sets the java doc comment for
this . |
void |
setSuperclass(java.lang.String superclassName)
Set the superclass of the class being created.
|
public JavaSourceWriterBuilder(AbortablePrintWriter printWriter, java.lang.String packageName, java.lang.String className)
printWriter
- packageName
- className
- public void addAnnotationDeclaration(java.lang.String declaration)
declaration
- public void addImplementedInterface(java.lang.String intfName)
intfName
- public void addImport(java.lang.String typeName)
typeName
- fully-qualified source namepublic SourceWriter createSourceWriter()
JavaSourceWriter
that can be used to write
the innards of a class. Note that the subsequent changes to this factory do
not affect the returned instance.JavaSourceWriter
instancejava.lang.RuntimeException
- If the settings on this factory are inconsistent
or invalidpublic java.lang.Iterable<java.lang.String> getAnnotationDeclarations()
public java.lang.String getClassName()
public java.lang.String getFullyQualifiedClassName()
public java.lang.Iterable<java.lang.String> getInterfaceNames()
public java.lang.String getPackageName()
public java.lang.String getSuperclassName()
public void makeInterface()
public void setJavaDocCommentForClass(java.lang.String comment)
this
.comment
- java doc comment.public void setSuperclass(java.lang.String superclassName)
superclassName
-