T
- the type of CustomContextPipeline<T>
AutoDocPipeline
, CssResolverPipeline
, ElementHandlerPipeline
, HtmlPipeline
, PdfWriterPipeline
public abstract class AbstractPipeline<T extends CustomContext> extends java.lang.Object implements Pipeline<T>
Constructor | Description |
---|---|
AbstractPipeline(Pipeline<?> next) |
Modifier and Type | Method | Description |
---|---|---|
Pipeline<?> |
close(WorkerContext context,
Tag t,
ProcessObject po) |
Just calls getNext.
Override this to get notified on encountered closing tags. |
Pipeline<?> |
content(WorkerContext ctx,
Tag currentTag,
java.lang.String text,
ProcessObject po) |
Just calls getNext.
Override this to get notified on encountered content. |
java.lang.String |
getContextKey() |
Defaults to the fully qualified class name of the object.
|
T |
getLocalContext(WorkerContext context) |
Returns the local context for this class using getContextKey, override
this together with getContextKey to change the key usage in case you want
to add multiple identical pipelines to the worker.
|
Pipeline<?> |
getNext() |
Returns the next pipeline in line.
|
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 |
setNext(Pipeline<?> next) |
setNext method.
|
public AbstractPipeline(Pipeline<?> next)
next
- the pipeline that's next in the sequence.public Pipeline<?> getNext()
Pipeline
getNext
in interface Pipeline<T extends CustomContext>
public Pipeline<?> open(WorkerContext context, Tag t, ProcessObject po) throws PipelineException
open
in interface Pipeline<T extends CustomContext>
context
- the WorkerContextt
- the Tagpo
- a processObject to put Writable
s inPipelineException
- can be thrown to indicate that something went wrong.public Pipeline<?> content(WorkerContext ctx, Tag currentTag, java.lang.String text, ProcessObject po) throws PipelineException
content
in interface Pipeline<T extends CustomContext>
ctx
- the WorkerContextcurrentTag
- the Tagtext
- the contentpo
- a processObject to put Writable
s inPipelineException
- can be thrown to indicate that something went wrong.public Pipeline<?> close(WorkerContext context, Tag t, ProcessObject po) throws PipelineException
close
in interface Pipeline<T extends CustomContext>
context
- the WorkerContextt
- the Tagpo
- a processObject to put Writable
s inPipelineException
- can be thrown to indicate that something went wrong.public T getLocalContext(WorkerContext context) throws PipelineException
context
- the WorkerContextgetContextKey()
PipelineException
- thrown when there is no CustomContext
or the CustomContext is null.public void setNext(Pipeline<?> next)
next
- set the next pipelinepublic java.lang.String getContextKey()
getClass().getName()
as name.public Pipeline<?> init(WorkerContext context) throws PipelineException
Pipeline
WorkerContext.put(String, CustomContext)
.init
in interface Pipeline<T extends CustomContext>
context
- the WorkerContextPipelineException
- can be thrown to indicate that something went wrong.Copyright © 1998–2018. All rights reserved.