Package com.google.gwt.codegen.server
Class JavaSourceWriterBuilder
java.lang.Object
com.google.gwt.codegen.server.JavaSourceWriterBuilder
A builder for
JavaSourceWriter
instances.
Experimental API - subject to change.
-
Constructor Summary
ConstructorDescriptionJavaSourceWriterBuilder
(AbortablePrintWriter printWriter, String packageName, String className) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAnnotationDeclaration
(String declaration) Add an class/interface annotation.void
addImplementedInterface
(String intfName) Add an implemented/extended interface.void
Add an import entry.Creates an implementation ofJavaSourceWriter
that can be used to write the innards of a class.Get the annotations.Get the simple name of the class being created.Get the fully-qualified source name of the class being created.Get the implemented/extended interfaces for the class being created.Get the package of the class being created.Get the superclass for the class being created.void
We are creating an interface instead of a class.void
setJavaDocCommentForClass
(String comment) Sets the java doc comment forthis
.void
setSuperclass
(String superclassName) Set the superclass of the class being created.
-
Constructor Details
-
JavaSourceWriterBuilder
public JavaSourceWriterBuilder(AbortablePrintWriter printWriter, String packageName, String className) - Parameters:
printWriter
-packageName
-className
-
-
-
Method Details
-
addAnnotationDeclaration
Add an class/interface annotation.- Parameters:
declaration
-
-
addImplementedInterface
Add an implemented/extended interface.- Parameters:
intfName
-
-
addImport
Add an import entry.- Parameters:
typeName
- fully-qualified source name
-
createSourceWriter
Creates an implementation ofJavaSourceWriter
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.- Returns:
- a
JavaSourceWriter
instance - Throws:
RuntimeException
- If the settings on this factory are inconsistent or invalid
-
getAnnotationDeclarations
Get the annotations.- Returns:
- list of annotations
-
getClassName
Get the simple name of the class being created.- Returns:
- class name
-
getFullyQualifiedClassName
Get the fully-qualified source name of the class being created.- Returns:
- fqcn
-
getInterfaceNames
Get the implemented/extended interfaces for the class being created.- Returns:
- list of interface names
-
getPackageName
Get the package of the class being created.- Returns:
- package name
-
getSuperclassName
Get the superclass for the class being created.- Returns:
- superclass name
-
makeInterface
public void makeInterface()We are creating an interface instead of a class. -
setJavaDocCommentForClass
Sets the java doc comment forthis
.- Parameters:
comment
- java doc comment.
-
setSuperclass
Set the superclass of the class being created.- Parameters:
superclassName
-
-