org.hamcrest.generator
Interface FactoryWriter

All Superinterfaces:
java.io.Closeable, java.io.Flushable
All Known Implementing Classes:
EasyMock2FactoryWriter, HamcrestFactoryWriter, QuickReferenceWriter

public interface FactoryWriter
extends java.io.Closeable, java.io.Flushable

Writes syntactic sugar code for factories.

Implementations of this could include vanilla factory methods for Hamcrest matchers, wrapped factories for other libraries or factories in other languages (jython, jruby, groovy, etc).

Usage:

 writer.writeHeader(...);
 

writer.writeMethod(...); writer.writeMethod(...); writer.writeMethod(...); ... writer.writeFooter(...); writer.close();

Author:
Joe Walnes
See Also:
FactoryMethod, SugarGenerator, HamcrestFactoryWriter

Method Summary
 void writeFooter()
          Write any necessary code to finish the output.
 void writeHeader()
          Write the code header.
 void writeMethod(java.lang.String generatedMethodName, FactoryMethod factoryMethodToDelegateTo)
          Writes code that delegates to a method.
 
Methods inherited from interface java.io.Closeable
close
 
Methods inherited from interface java.io.Flushable
flush
 

Method Detail

writeHeader

void writeHeader()
                 throws java.io.IOException
Write the code header.

Throws:
java.io.IOException

writeMethod

void writeMethod(java.lang.String generatedMethodName,
                 FactoryMethod factoryMethodToDelegateTo)
                 throws java.io.IOException
Writes code that delegates to a method.

Parameters:
generatedMethodName -
factoryMethodToDelegateTo -
Throws:
java.io.IOException

writeFooter

void writeFooter()
                 throws java.io.IOException
Write any necessary code to finish the output.

Throws:
java.io.IOException