com.itextpdf.tool.xml.pipeline.html
Class HtmlPipeline

java.lang.Object
  extended by com.itextpdf.tool.xml.pipeline.AbstractPipeline<HtmlPipelineContext>
      extended by com.itextpdf.tool.xml.pipeline.html.HtmlPipeline
All Implemented Interfaces:
Pipeline<HtmlPipelineContext>

public class HtmlPipeline
extends AbstractPipeline<HtmlPipelineContext>

The HtmlPipeline transforms received tags and content to PDF Elements.
To configure this pipeline a HtmlPipelineContext.

Author:
redlab_b

Constructor Summary
HtmlPipeline(HtmlPipelineContext hpc, 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 t, 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.
 
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
 

Constructor Detail

HtmlPipeline

public HtmlPipeline(HtmlPipelineContext hpc,
                    Pipeline<?> next)
Parameters:
hpc - the initial HtmlPipelineContext
next - the next pipe in row
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<HtmlPipelineContext>
Overrides:
init in class AbstractPipeline<HtmlPipelineContext>
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<HtmlPipelineContext>
Overrides:
open in class AbstractPipeline<HtmlPipelineContext>
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 t,
                           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<HtmlPipelineContext>
Overrides:
content in class AbstractPipeline<HtmlPipelineContext>
Parameters:
context - the WorkerContext
t - 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<HtmlPipelineContext>
Overrides:
close in class AbstractPipeline<HtmlPipelineContext>
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.


Copyright © 2012. All Rights Reserved.