Class PdfWriterPipeline
- java.lang.Object
-
- com.itextpdf.tool.xml.pipeline.AbstractPipeline<MapContext>
-
- com.itextpdf.tool.xml.pipeline.end.PdfWriterPipeline
-
- All Implemented Interfaces:
Pipeline<MapContext>
public class PdfWriterPipeline extends AbstractPipeline<MapContext>
This pipeline writes to a Document.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Booleancontiniouslystatic java.lang.StringCONTINUOUSThe key for the a boolean in theMapContextused asCustomContext.private Documentdocstatic java.lang.StringDOCUMENTprivate static LoggerLOGprivate PdfWriterwriterstatic java.lang.StringWRITER
-
Constructor Summary
Constructors Constructor Description PdfWriterPipeline()PdfWriterPipeline(Document doc, PdfWriter writer)PdfWriterPipeline(Pipeline<?> next)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Pipeline<?>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, java.lang.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.voidsetWriter(PdfWriter writer)The 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 Detail
-
LOG
private static final Logger LOG
-
doc
private Document doc
-
writer
private PdfWriter writer
-
DOCUMENT
public static final java.lang.String DOCUMENT
- See Also:
- Constant Field Values
-
WRITER
public static final java.lang.String WRITER
- See Also:
- Constant Field Values
-
CONTINUOUS
public static final java.lang.String CONTINUOUS
The key for the a boolean in theMapContextused asCustomContext. Setting to true enables swallowing of DocumentExceptions- See Also:
- Constant Field Values
-
continiously
private java.lang.Boolean continiously
-
-
Method Detail
-
init
public Pipeline<?> init(WorkerContext context) throws PipelineException
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
private void write(WorkerContext context, ProcessObject po) throws PipelineException
- Parameters:
po-- Throws:
PipelineException
-
open
public Pipeline<?> open(WorkerContext context, Tag t, ProcessObject po) throws PipelineException
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, java.lang.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
public Pipeline<?> close(WorkerContext context, Tag t, ProcessObject po) throws PipelineException
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
public void setDocument(Document document)
The document to write to.- Parameters:
document- the Document
-
setWriter
public void setWriter(PdfWriter writer)
The writer used to write to the document.- Parameters:
writer- the writer.
-
-