D
- The type of domain objects to assemble the product frompublic abstract class PrintWriterAssembler<D> extends java.lang.Object implements Assembler<D>
Constructor and Description |
---|
PrintWriterAssembler()
Create an instance that will not validate the assembled product.
|
PrintWriterAssembler(Validator validator)
Create an instance.
|
Modifier and Type | Method and Description |
---|---|
void |
add(D domainObject)
Add a component to the assembly.
|
protected abstract void |
add(D domainObject,
java.io.PrintWriter writer)
Add a domain object.
|
void |
end()
Finish the assembly process.
|
protected abstract void |
end(java.io.PrintWriter writer)
End the assembly process.
|
Metrics |
getMetrics()
Return metrics about the assembly process.
|
void |
start(DataBuffer dataBuffer)
Start the assembly process.
|
protected abstract void |
start(java.io.PrintWriter writer)
Start the assembly process.
|
public PrintWriterAssembler()
public PrintWriterAssembler(Validator validator)
validator
- Optional validator for checking whether the assembled product meets expectationsprotected abstract void start(java.io.PrintWriter writer) throws java.io.IOException
writer
- Where to write outputjava.io.IOException
- When an I/O error occuresprotected abstract void add(D domainObject, java.io.PrintWriter writer) throws java.io.IOException
domainObject
- The domain object to addwriter
- Where to write outputjava.io.IOException
- When an I/O error occuresprotected abstract void end(java.io.PrintWriter writer) throws java.io.IOException
writer
- Where to write outputjava.io.IOException
- When an I/O error occurespublic final void start(DataBuffer dataBuffer) throws java.io.IOException
Assembler
public final void add(D domainObject) throws java.io.IOException
Assembler
public final void end() throws java.io.IOException
Assembler
public Metrics getMetrics()
Assembler
getMetrics
in interface Assembler<D>
null
if no metrics are provided