com.advancedpwr.record
Class ClassWriter

java.lang.Object
  extended by com.advancedpwr.record.ClassWriter
Direct Known Subclasses:
AbstractRecorder

public abstract class ClassWriter
extends Object

ClassWriter wraps a PrintWriter with convenience methods for creating Java source code output.

Author:
Matthew Avery, mavery@advancedpwr.com on Mar 26, 2010

Field Summary
static String CLASS
           
protected  ClassDescriptor fieldDescriptor
           
protected  Object fieldObject
           
protected  PrintWriter fieldPrintWriter
           
protected  Class fieldSuperClass
           
static String IMPORT
           
static String PACKAGE
           
static String PRIVATE
           
static String PROTECTED
           
static String PUBLIC
           
static String SPACE
           
protected  int tabDepth
           
 
Constructor Summary
ClassWriter()
           
 
Method Summary
protected abstract  Set<Class> classes()
           
 ClassWriter closeBrace()
           
protected abstract  ClassDescriptor createDefaultDescriptor()
           
protected  String extendClass()
           
 String getClassName()
           
 ClassDescriptor getDescriptor()
           
protected  Object getObject()
           
 String getPackageName()
           
 PrintWriter getPrintWriter()
           
 Class getSuperClass()
           
 ClassWriter newLine()
           
 ClassWriter openBrace()
           
protected  String packageName()
           
 void setClassName(String inName)
          This method is a "short cut" to easily set the ClassDescriptor
 void setDescriptor(ClassDescriptor descriptor)
           
protected  void setObject(Object object)
           
 void setSuperClass(Class superClass)
           
 void setWriter(Writer writer)
           
protected  ClassWriter tab()
           
protected  ClassWriter tabs()
           
 void write(String inString)
           
protected  void writeClassDeclaration()
           
protected  void writeImports()
           
 void writeLine(String inString)
           
protected  void writeObject()
           
protected abstract  void writeObjectBuilderMethod()
           
protected  void writePackage()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPACE

public static final String SPACE
See Also:
Constant Field Values

PACKAGE

public static final String PACKAGE
See Also:
Constant Field Values

IMPORT

public static final String IMPORT
See Also:
Constant Field Values

CLASS

public static final String CLASS
See Also:
Constant Field Values

PUBLIC

public static final String PUBLIC
See Also:
Constant Field Values

PROTECTED

public static final String PROTECTED
See Also:
Constant Field Values

PRIVATE

public static final String PRIVATE
See Also:
Constant Field Values

fieldPrintWriter

protected PrintWriter fieldPrintWriter

tabDepth

protected int tabDepth

fieldDescriptor

protected ClassDescriptor fieldDescriptor

fieldObject

protected Object fieldObject

fieldSuperClass

protected Class fieldSuperClass
Constructor Detail

ClassWriter

public ClassWriter()
Method Detail

getObject

protected Object getObject()

setObject

protected void setObject(Object object)

getPrintWriter

public PrintWriter getPrintWriter()

setWriter

public void setWriter(Writer writer)

writeLine

public void writeLine(String inString)

write

public void write(String inString)

tab

protected ClassWriter tab()

tabs

protected ClassWriter tabs()

openBrace

public ClassWriter openBrace()

closeBrace

public ClassWriter closeBrace()

newLine

public ClassWriter newLine()

getDescriptor

public ClassDescriptor getDescriptor()

createDefaultDescriptor

protected abstract ClassDescriptor createDefaultDescriptor()

setDescriptor

public void setDescriptor(ClassDescriptor descriptor)

setClassName

public void setClassName(String inName)
This method is a "short cut" to easily set the ClassDescriptor

Parameters:
The - fully qualified class name

writeClassDeclaration

protected void writeClassDeclaration()

extendClass

protected String extendClass()

writePackage

protected void writePackage()

writeImports

protected void writeImports()

classes

protected abstract Set<Class> classes()

packageName

protected String packageName()

getClassName

public String getClassName()

getPackageName

public String getPackageName()

writeObject

protected void writeObject()

writeObjectBuilderMethod

protected abstract void writeObjectBuilderMethod()

getSuperClass

public Class getSuperClass()

setSuperClass

public void setSuperClass(Class superClass)


Copyright © 2011 Advanced Power Co. All Rights Reserved.