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