Class HtmlPipeline
- java.lang.Object
-
- com.itextpdf.tool.xml.pipeline.AbstractPipeline<HtmlPipelineContext>
-
- 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 aHtmlPipelineContext.
-
-
Field Summary
Fields Modifier and Type Field Description private HtmlPipelineContexthpc
-
Constructor Summary
Constructors Constructor Description HtmlPipeline(HtmlPipelineContext hpc, Pipeline<?> next)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddStackKeeper(Tag t, HtmlPipelineContext hcc, TagProcessor tp)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, java.lang.String text, ProcessObject po)Just calls getNext.
Override this to get notified on encountered content.java.lang.StringgetContextKey()This allows the descendant classes to be fetched from the context.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
getLocalContext, getNext, setNext
-
-
-
-
Field Detail
-
hpc
private final HtmlPipelineContext hpc
-
-
Constructor Detail
-
HtmlPipeline
public HtmlPipeline(HtmlPipelineContext hpc, Pipeline<?> next)
- Parameters:
hpc- the initialHtmlPipelineContextnext- the next pipe in row
-
-
Method Detail
-
getContextKey
public java.lang.String getContextKey()
This allows the descendant classes to be fetched from the context.- Overrides:
getContextKeyin classAbstractPipeline<HtmlPipelineContext>- Returns:
getClass().getName()as name.
-
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<HtmlPipelineContext>- Overrides:
initin classAbstractPipeline<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:AbstractPipelineJust calls getNext.
Override this to get notified on encountered opening tags.- Specified by:
openin interfacePipeline<HtmlPipelineContext>- Overrides:
openin classAbstractPipeline<HtmlPipelineContext>- 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 t, 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<HtmlPipelineContext>- Overrides:
contentin classAbstractPipeline<HtmlPipelineContext>- Parameters:
context- the WorkerContextt- 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<HtmlPipelineContext>- Overrides:
closein classAbstractPipeline<HtmlPipelineContext>- 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.
-
addStackKeeper
protected void addStackKeeper(Tag t, HtmlPipelineContext hcc, TagProcessor tp)
-
-