com.advancedpwr.record
Class AbstractRecorder

java.lang.Object
  extended by com.advancedpwr.record.ClassWriter
      extended by com.advancedpwr.record.AbstractRecorder
All Implemented Interfaces:
ObjectRecorder
Direct Known Subclasses:
BeanRecorder, XstreamRecorder

public abstract class AbstractRecorder
extends ClassWriter
implements ObjectRecorder

AbstractRecorder is the common base class for recorders. This class provides some convenience methods for specifying the output directory for recorded classes. It also provides the default ClassDescriptor for the superclass ClassWriter. It is not necessary for future class recorders to extend AbstractRecorder. This abstract class exists for convenience only.

Author:
Matthew Avery, mavery@advancedpwr.com on Sep 30, 2010

Field Summary
protected  File fieldDestinationDirectory
           
protected  FileWriter fieldJavaFileWriter
           
 
Fields inherited from class com.advancedpwr.record.ClassWriter
CLASS, fieldDescriptor, fieldObject, fieldPrintWriter, fieldSuperClass, IMPORT, PACKAGE, PRIVATE, PROTECTED, PUBLIC, SPACE, tabDepth
 
Constructor Summary
AbstractRecorder()
           
 
Method Summary
protected  void close(Writer inWriter)
           
protected  ClassDescriptor createDefaultDescriptor()
           
protected  FileWriter createFileWriter(File inFile)
           
 File getDestination()
           
protected  FileWriter getJavaFileWriter()
           
protected  File javaFile()
           
protected  Class objectClass()
           
protected  String packagePath()
           
protected  File parentDirectory()
           
 void setDestination(File testDirectory)
          Set the generated output directory as a File
 void setDestination(String inFileName)
          Set the generated output directory as the name of a File.
 
Methods inherited from class com.advancedpwr.record.ClassWriter
classes, closeBrace, extendClass, getClassName, getDescriptor, getObject, getPackageName, getPrintWriter, getSuperClass, newLine, openBrace, packageName, setClassName, setDescriptor, setObject, setSuperClass, setWriter, tab, tabs, write, writeClassDeclaration, writeImports, writeLine, writeObject, writeObjectBuilderMethod, writePackage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.advancedpwr.record.ObjectRecorder
record
 

Field Detail

fieldDestinationDirectory

protected File fieldDestinationDirectory

fieldJavaFileWriter

protected FileWriter fieldJavaFileWriter
Constructor Detail

AbstractRecorder

public AbstractRecorder()
Method Detail

createFileWriter

protected FileWriter createFileWriter(File inFile)

getJavaFileWriter

protected FileWriter getJavaFileWriter()

parentDirectory

protected File parentDirectory()

javaFile

protected File javaFile()

packagePath

protected String packagePath()

getDestination

public File getDestination()

setDestination

public void setDestination(File testDirectory)
Set the generated output directory as a File

Parameters:
directory -

setDestination

public void setDestination(String inFileName)
Set the generated output directory as the name of a File.

Parameters:
directory -

createDefaultDescriptor

protected ClassDescriptor createDefaultDescriptor()
Specified by:
createDefaultDescriptor in class ClassWriter

objectClass

protected Class objectClass()

close

protected void close(Writer inWriter)


Copyright © 2011 Advanced Power Co. All Rights Reserved.