org.hamcrest.generator
Class QuickReferenceWriter

java.lang.Object
  extended by org.hamcrest.generator.QuickReferenceWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, FactoryWriter

public class QuickReferenceWriter
extends java.lang.Object
implements FactoryWriter

Dumps a quick list of factory methods. Designed to be read by users, as a cheatsheet.

Author:
Joe Walnes

Constructor Summary
QuickReferenceWriter()
           
QuickReferenceWriter(java.io.PrintStream out)
           
 
Method Summary
 void close()
           
 void flush()
           
 void setColumnPosition(int columnPosition)
           
 void writeFooter()
          Write any necessary code to finish the output.
 void writeHeader()
          Write the code header.
 void writeMethod(java.lang.String generatedMethodName, FactoryMethod factoryMethod)
          Writes code that delegates to a method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuickReferenceWriter

public QuickReferenceWriter(java.io.PrintStream out)

QuickReferenceWriter

public QuickReferenceWriter()
Method Detail

setColumnPosition

public void setColumnPosition(int columnPosition)

writeHeader

public void writeHeader()
                 throws java.io.IOException
Description copied from interface: FactoryWriter
Write the code header.

Specified by:
writeHeader in interface FactoryWriter
Throws:
java.io.IOException

writeMethod

public void writeMethod(java.lang.String generatedMethodName,
                        FactoryMethod factoryMethod)
                 throws java.io.IOException
Description copied from interface: FactoryWriter
Writes code that delegates to a method.

Specified by:
writeMethod in interface FactoryWriter
Throws:
java.io.IOException

writeFooter

public void writeFooter()
                 throws java.io.IOException
Description copied from interface: FactoryWriter
Write any necessary code to finish the output.

Specified by:
writeFooter in interface FactoryWriter
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Specified by:
flush in interface java.io.Flushable
Throws:
java.io.IOException