org.eclipse.jpt.core.utility
Class BodySourceWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.PrintWriter
          extended by org.eclipse.jpt.utility.IndentingPrintWriter
              extended by org.eclipse.jpt.core.utility.BodySourceWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class BodySourceWriter
extends IndentingPrintWriter

Extend IndentingPrintWriter with some methods that facilitate building class source code.


Field Summary
 
Fields inherited from class org.eclipse.jpt.utility.IndentingPrintWriter
DEFAULT_INDENT
 
Constructor Summary
BodySourceWriter(java.lang.String packageName, java.lang.String className)
           
 
Method Summary
 java.lang.Iterable<java.lang.String> getImports()
           
 int getLength()
           
 java.lang.String getSource()
           
 void printAnnotation(java.lang.String annotationName)
           
 void printStringLiteral(java.lang.String string)
          Convert the specified string to a String Literal and print it, adding the surrounding double-quotes and escaping characters as necessary.
 void printTypeDeclaration(java.lang.String typeDeclaration)
           
 
Methods inherited from class org.eclipse.jpt.utility.IndentingPrintWriter
decrementIndentLevel, getIndentLevel, incrementIndentLevel, indent, println, setIndentLevel, undent, write, write, write
 
Methods inherited from class java.io.PrintWriter
append, append, append, checkError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, write, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BodySourceWriter

public BodySourceWriter(java.lang.String packageName,
                        java.lang.String className)
Method Detail

getSource

public java.lang.String getSource()

getLength

public int getLength()

printAnnotation

public void printAnnotation(java.lang.String annotationName)

printTypeDeclaration

public void printTypeDeclaration(java.lang.String typeDeclaration)

printStringLiteral

public void printStringLiteral(java.lang.String string)
Convert the specified string to a String Literal and print it, adding the surrounding double-quotes and escaping characters as necessary.


getImports

public java.lang.Iterable<java.lang.String> getImports()