Package com.google.gwt.codegen.server
Class JavaSourceWriterBuilder
- java.lang.Object
-
- com.google.gwt.codegen.server.JavaSourceWriterBuilder
-
public class JavaSourceWriterBuilder extends java.lang.ObjectA builder forJavaSourceWriterinstances.Experimental API - subject to change.
-
-
Constructor Summary
Constructors Constructor Description JavaSourceWriterBuilder(AbortablePrintWriter printWriter, java.lang.String packageName, java.lang.String className)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAnnotationDeclaration(java.lang.String declaration)Add an class/interface annotation.voidaddImplementedInterface(java.lang.String intfName)Add an implemented/extended interface.voidaddImport(java.lang.String typeName)Add an import entry.SourceWritercreateSourceWriter()Creates an implementation ofJavaSourceWriterthat can be used to write the innards of a class.java.lang.Iterable<java.lang.String>getAnnotationDeclarations()Get the annotations.java.lang.StringgetClassName()Get the simple name of the class being created.java.lang.StringgetFullyQualifiedClassName()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.StringgetPackageName()Get the package of the class being created.java.lang.StringgetSuperclassName()Get the superclass for the class being created.voidmakeInterface()We are creating an interface instead of a class.voidsetJavaDocCommentForClass(java.lang.String comment)Sets the java doc comment forthis.voidsetSuperclass(java.lang.String superclassName)Set the superclass of the class being created.
-
-
-
Constructor Detail
-
JavaSourceWriterBuilder
public JavaSourceWriterBuilder(AbortablePrintWriter printWriter, java.lang.String packageName, java.lang.String className)
- Parameters:
printWriter-packageName-className-
-
-
Method Detail
-
addAnnotationDeclaration
public void addAnnotationDeclaration(java.lang.String declaration)
Add an class/interface annotation.- Parameters:
declaration-
-
addImplementedInterface
public void addImplementedInterface(java.lang.String intfName)
Add an implemented/extended interface.- Parameters:
intfName-
-
addImport
public void addImport(java.lang.String typeName)
Add an import entry.- Parameters:
typeName- fully-qualified source name
-
createSourceWriter
public SourceWriter createSourceWriter()
Creates an implementation ofJavaSourceWriterthat 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
JavaSourceWriterinstance - Throws:
java.lang.RuntimeException- If the settings on this factory are inconsistent or invalid
-
getAnnotationDeclarations
public java.lang.Iterable<java.lang.String> getAnnotationDeclarations()
Get the annotations.- Returns:
- list of annotations
-
getClassName
public java.lang.String getClassName()
Get the simple name of the class being created.- Returns:
- class name
-
getFullyQualifiedClassName
public java.lang.String getFullyQualifiedClassName()
Get the fully-qualified source name of the class being created.- Returns:
- fqcn
-
getInterfaceNames
public java.lang.Iterable<java.lang.String> getInterfaceNames()
Get the implemented/extended interfaces for the class being created.- Returns:
- list of interface names
-
getPackageName
public java.lang.String getPackageName()
Get the package of the class being created.- Returns:
- package name
-
getSuperclassName
public java.lang.String 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
public void setJavaDocCommentForClass(java.lang.String comment)
Sets the java doc comment forthis.- Parameters:
comment- java doc comment.
-
setSuperclass
public void setSuperclass(java.lang.String superclassName)
Set the superclass of the class being created.- Parameters:
superclassName-
-
-