com.itextpdf.tool.xml.pipeline.end
Class PdfWriterPipeline

java.lang.Object
  extended by com.itextpdf.tool.xml.pipeline.AbstractPipeline<MapContext>
      extended by 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
static String CONTINUOUS
          The key for the a boolean in the MapContext used as CustomContext.
static String DOCUMENT
          The key for the Document in the MapContext used as CustomContext.
static String WRITER
          The key for the PdfWriter in the MapContext used as CustomContext.
 
Constructor Summary
PdfWriterPipeline()
           
PdfWriterPipeline(Document doc, PdfWriter writer)
           
PdfWriterPipeline(Pipeline<?> next)
           
 
Method Summary
 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, 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.
 void setDocument(Document document)
          The document to write to.
 void setWriter(PdfWriter writer)
          The writer used to write to the document.
 
Methods inherited from class com.itextpdf.tool.xml.pipeline.AbstractPipeline
getContextKey, getLocalContext, getNext, setNext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOCUMENT

public static final String DOCUMENT
The key for the Document in the MapContext used as CustomContext.

See Also:
Constant Field Values

WRITER

public static final String WRITER
The key for the PdfWriter in the MapContext used as CustomContext.

See Also:
Constant Field Values

CONTINUOUS

public static final String CONTINUOUS
The key for the a boolean in the MapContext used as CustomContext. Setting to true enables swallowing of DocumentExceptions

See Also:
Constant Field Values
Constructor Detail

PdfWriterPipeline

public PdfWriterPipeline()

PdfWriterPipeline

public PdfWriterPipeline(Pipeline<?> next)
Parameters:
next - the next pipeline if any.

PdfWriterPipeline

public PdfWriterPipeline(Document doc,
                         PdfWriter writer)
Parameters:
doc - the document
writer - the writer
Method Detail

init

public Pipeline<?> init(WorkerContext context)
                 throws PipelineException
Description copied from interface: Pipeline
The init method allows implementation to initialize the pipeline. e.g. Initialize their CustomContext here and add it to the WorkerContext through WorkerContext.put(String, CustomContext).

Specified by:
init in interface Pipeline<MapContext>
Overrides:
init in class AbstractPipeline<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: AbstractPipeline
Just calls getNext.
Override this to get notified on encountered opening tags.

Specified by:
open in interface Pipeline<MapContext>
Overrides:
open in class AbstractPipeline<MapContext>
Parameters:
context - the WorkerContext
t - the Tag
po - a processObject to put Writables 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: AbstractPipeline
Just calls getNext.
Override this to get notified on encountered content.

Specified by:
content in interface Pipeline<MapContext>
Overrides:
content in class AbstractPipeline<MapContext>
Parameters:
context - the WorkerContext
currentTag - the Tag
text - the content
po - a processObject to put Writables 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: AbstractPipeline
Just calls getNext.
Override this to get notified on encountered closing tags.

Specified by:
close in interface Pipeline<MapContext>
Overrides:
close in class AbstractPipeline<MapContext>
Parameters:
context - the WorkerContext
t - the Tag
po - a processObject to put Writables 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.


Copyright © 2012. All Rights Reserved.