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 HtmlPipelineContext
hpc
-
Constructor Summary
Constructors Constructor Description HtmlPipeline(HtmlPipelineContext hpc, Pipeline<?> next)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addStackKeeper(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.String
getContextKey()
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 initialHtmlPipelineContext
next
- 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:
getContextKey
in classAbstractPipeline<HtmlPipelineContext>
- Returns:
getClass().getName()
as name.
-
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 throughWorkerContext.put(String, CustomContext)
.- Specified by:
init
in interfacePipeline<HtmlPipelineContext>
- Overrides:
init
in 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:AbstractPipeline
Just calls getNext.
Override this to get notified on encountered opening tags.- Specified by:
open
in interfacePipeline<HtmlPipelineContext>
- Overrides:
open
in classAbstractPipeline<HtmlPipelineContext>
- Parameters:
context
- the WorkerContextt
- the Tagpo
- a processObject to putWritable
s 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:AbstractPipeline
Just calls getNext.
Override this to get notified on encountered content.- Specified by:
content
in interfacePipeline<HtmlPipelineContext>
- Overrides:
content
in classAbstractPipeline<HtmlPipelineContext>
- Parameters:
context
- the WorkerContextt
- the Tagtext
- the contentpo
- a processObject to putWritable
s 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 interfacePipeline<HtmlPipelineContext>
- Overrides:
close
in classAbstractPipeline<HtmlPipelineContext>
- Parameters:
context
- the WorkerContextt
- the Tagpo
- a processObject to putWritable
s 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)
-
-