Class JavaSourceWriterBuilder

java.lang.Object
com.google.gwt.codegen.server.JavaSourceWriterBuilder

public class JavaSourceWriterBuilder extends Object
A builder for JavaSourceWriter instances.

Experimental API - subject to change.

  • Constructor Details

    • JavaSourceWriterBuilder

      public JavaSourceWriterBuilder(AbortablePrintWriter printWriter, String packageName, String className)
      Parameters:
      printWriter -
      packageName -
      className -
  • Method Details

    • addAnnotationDeclaration

      public void addAnnotationDeclaration(String declaration)
      Add an class/interface annotation.
      Parameters:
      declaration -
    • addImplementedInterface

      public void addImplementedInterface(String intfName)
      Add an implemented/extended interface.
      Parameters:
      intfName -
    • addImport

      public void addImport(String typeName)
      Add an import entry.
      Parameters:
      typeName - fully-qualified source name
    • createSourceWriter

      public SourceWriter createSourceWriter()
      Creates an implementation of 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.
      Returns:
      a JavaSourceWriter instance
      Throws:
      RuntimeException - If the settings on this factory are inconsistent or invalid
    • getAnnotationDeclarations

      public Iterable<String> getAnnotationDeclarations()
      Get the annotations.
      Returns:
      list of annotations
    • getClassName

      public String getClassName()
      Get the simple name of the class being created.
      Returns:
      class name
    • getFullyQualifiedClassName

      public String getFullyQualifiedClassName()
      Get the fully-qualified source name of the class being created.
      Returns:
      fqcn
    • getInterfaceNames

      public Iterable<String> getInterfaceNames()
      Get the implemented/extended interfaces for the class being created.
      Returns:
      list of interface names
    • getPackageName

      public String getPackageName()
      Get the package of the class being created.
      Returns:
      package name
    • getSuperclassName

      public 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(String comment)
      Sets the java doc comment for this.
      Parameters:
      comment - java doc comment.
    • setSuperclass

      public void setSuperclass(String superclassName)
      Set the superclass of the class being created.
      Parameters:
      superclassName -