T
- the type of CustomContext
public abstract class AbstractPipelineCustomContext> extends Object implements Pipeline
Constructor and Description |
---|
AbstractPipeline(Pipeline> next) |
Modifier and Type | Method and 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, String text, ProcessObject po)
Just calls getNext.
Override this to get notified on encountered content. |
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 WorkerContext
t
- the Tag
po
- a processObject to put Writable
s in
PipelineException
- can be thrown to indicate that something went wrong.
public Pipeline> content(WorkerContext ctx, Tag currentTag, String text, ProcessObject po) throws PipelineException
content
in interface Pipeline<T extends CustomContext>
ctx
- the WorkerContext
currentTag
- the Tag
text
- the content
po
- a processObject to put Writable
s in
PipelineException
- 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 WorkerContext
t
- the Tag
po
- a processObject to put Writable
s in
PipelineException
- can be thrown to indicate that something went wrong.
public T getLocalContext(WorkerContext context) throws PipelineException
context
- the WorkerContext
getContextKey()
PipelineException
- thrown when there is no CustomContext
or the CustomContext is null.
public void setNext(Pipeline> next)
next
- set the next pipeline
public 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 WorkerContext
PipelineException
- can be thrown to indicate that something went wrong.
Copyright © 1998–2018. All rights reserved.