Package com.opentext.ia.sdk.sip
Class PrintWriterAssembler<D>
- java.lang.Object
-
- com.opentext.ia.sdk.sip.PrintWriterAssembler<D>
-
- Type Parameters:
D
- The type of domain objects to assemble the product from
- All Implemented Interfaces:
Assembler<D>
- Direct Known Subclasses:
InfoArchivePackagingInformationAssembler
,PdiAssembler
public abstract class PrintWriterAssembler<D> extends java.lang.Object implements Assembler<D>
Base class for assembling a product from domain objects by writing to a PrintWriter.
-
-
Constructor Summary
Constructors Constructor Description PrintWriterAssembler()
Create an instance that will not validate the assembled product.PrintWriterAssembler(Validator validator)
Create an instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Constructor Detail
-
PrintWriterAssembler
public PrintWriterAssembler()
Create an instance that will not validate the assembled product.
-
PrintWriterAssembler
public PrintWriterAssembler(Validator validator)
Create an instance.- Parameters:
validator
- Optional validator for checking whether the assembled product meets expectations
-
-
Method Detail
-
start
protected abstract void start(java.io.PrintWriter writer) throws java.io.IOException
Start the assembly process.- Parameters:
writer
- Where to write output- Throws:
java.io.IOException
- When an I/O error occures
-
add
protected abstract void add(D domainObject, java.io.PrintWriter writer) throws java.io.IOException
Add a domain object.- Parameters:
domainObject
- The domain object to addwriter
- Where to write output- Throws:
java.io.IOException
- When an I/O error occures
-
end
protected abstract void end(java.io.PrintWriter writer) throws java.io.IOException
End the assembly process.- Parameters:
writer
- Where to write output- Throws:
java.io.IOException
- When an I/O error occures
-
start
public final void start(DataBuffer dataBuffer) throws java.io.IOException
Description copied from interface:Assembler
Start the assembly process.
-
add
public final void add(D domainObject) throws java.io.IOException
Description copied from interface:Assembler
Add a component to the assembly. The assembler must be opened first.
-
end
public final void end() throws java.io.IOException
Description copied from interface:Assembler
Finish the assembly process.
-
getMetrics
@Nullable public Metrics getMetrics()
Description copied from interface:Assembler
Return metrics about the assembly process. Implementations will generally provide dedicated classes that you should cast the result to.- Specified by:
getMetrics
in interfaceAssembler<D>
- Returns:
- Metrics about the assembly process, or
null
if no metrics are provided
-
-