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.- Author:
- redlab_b
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONTINUOUSThe key for the a boolean in theMapContextused asCustomContext.static java.lang.StringDOCUMENTstatic 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.-
Methods inherited from class com.itextpdf.tool.xml.pipeline.AbstractPipeline
getContextKey, getLocalContext, getNext, setNext
-
-
-
-
Field Detail
-
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
-
-
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.
-
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.
-
-