Class PdfWriterPipeline
java.lang.Object
com.itextpdf.tool.xml.pipeline.AbstractPipeline<MapContext>
com.itextpdf.tool.xml.pipeline.end.PdfWriterPipeline
- All Implemented Interfaces:
Pipeline<MapContext>
This pipeline writes to a Document.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Booleanstatic final StringThe key for the a boolean in theMapContextused asCustomContext.private Documentstatic final Stringprivate static final Loggerprivate PdfWriterstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionPdfWriterPipeline(Document doc, PdfWriter writer) PdfWriterPipeline(Pipeline<?> next) -
Method Summary
Modifier and TypeMethodDescriptionPipeline<?> close(WorkerContext context, Tag t, ProcessObject po) Just calls getNext.
Override this to get notified on encountered closing tags.Pipeline<?> content(WorkerContext context, Tag currentTag, String text, ProcessObject po) Just calls getNext.
Override this to get notified on encountered content.Pipeline<?> init(WorkerContext context) The init method allows implementation to initialize the pipeline.Pipeline<?> open(WorkerContext context, Tag t, ProcessObject po) Just calls getNext.
Override this to get notified on encountered opening tags.voidsetDocument(Document document) The document to write to.voidThe writer used to write to the document.private voidwrite(WorkerContext context, ProcessObject po) Methods inherited from class com.itextpdf.tool.xml.pipeline.AbstractPipeline
getContextKey, getLocalContext, getNext, setNext
-
Field Details
-
LOG
-
doc
-
writer
-
DOCUMENT
- See Also:
-
WRITER
- See Also:
-
CONTINUOUS
The key for the a boolean in theMapContextused asCustomContext. Setting to true enables swallowing of DocumentExceptions- See Also:
-
continiously
-
-
Constructor Details
-
PdfWriterPipeline
public PdfWriterPipeline() -
PdfWriterPipeline
- Parameters:
next- the next pipeline if any.
-
PdfWriterPipeline
- Parameters:
doc- the documentwriter- the writer
-
-
Method Details
-
init
Description copied from interface:PipelineThe init method allows implementation to initialize the pipeline. e.g. Initialize their CustomContext here and add it to the WorkerContext throughWorkerContext.put(String, CustomContext).- Specified by:
initin interfacePipeline<MapContext>- Overrides:
initin classAbstractPipeline<MapContext>- Parameters:
context- the WorkerContext- Returns:
- the next pipeline in line
- Throws:
PipelineException- can be thrown to indicate that something went wrong.
-
write
- Parameters:
po-- Throws:
PipelineException
-
open
Description copied from class:AbstractPipelineJust calls getNext.
Override this to get notified on encountered opening tags.- Specified by:
openin interfacePipeline<MapContext>- Overrides:
openin classAbstractPipeline<MapContext>- Parameters:
context- the WorkerContextt- the Tagpo- a processObject to putWritables in- Returns:
- the next pipeline in line
- Throws:
PipelineException- can be thrown to indicate that something went wrong.
-
content
public Pipeline<?> content(WorkerContext context, Tag currentTag, String text, ProcessObject po) throws PipelineException Description copied from class:AbstractPipelineJust calls getNext.
Override this to get notified on encountered content.- Specified by:
contentin interfacePipeline<MapContext>- Overrides:
contentin classAbstractPipeline<MapContext>- Parameters:
context- the WorkerContextcurrentTag- the Tagtext- the contentpo- a processObject to putWritables in- Returns:
- the next pipeline in line
- Throws:
PipelineException- can be thrown to indicate that something went wrong.
-
close
Description copied from class:AbstractPipelineJust calls getNext.
Override this to get notified on encountered closing tags.- Specified by:
closein interfacePipeline<MapContext>- Overrides:
closein classAbstractPipeline<MapContext>- Parameters:
context- the WorkerContextt- the Tagpo- a processObject to putWritables in- Returns:
- the next pipeline in line
- Throws:
PipelineException- can be thrown to indicate that something went wrong.
-
setDocument
The document to write to.- Parameters:
document- the Document
-
setWriter
The writer used to write to the document.- Parameters:
writer- the writer.
-