Class HtmlPipeline
java.lang.Object
com.itextpdf.tool.xml.pipeline.AbstractPipeline<HtmlPipelineContext>
com.itextpdf.tool.xml.pipeline.html.HtmlPipeline
- All Implemented Interfaces:
Pipeline<HtmlPipelineContext>
The HtmlPipeline transforms received tags and content to PDF Elements.
To configure this pipeline a
To configure this pipeline a
HtmlPipelineContext
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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, String text, ProcessObject po) Just calls getNext.
Override this to get notified on encountered content.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 Details
-
hpc
-
-
Constructor Details
-
HtmlPipeline
- Parameters:
hpc
- the initialHtmlPipelineContext
next
- the next pipe in row
-
-
Method Details
-
getContextKey
This allows the descendant classes to be fetched from the context.- Overrides:
getContextKey
in classAbstractPipeline<HtmlPipelineContext>
- Returns:
getClass().getName()
as name.
-
init
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
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, 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
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
-