|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.itextpdf.tool.xml.pipeline.AbstractPipeline<T>
T
- the type of CustomContextpublic abstract class AbstractPipeline<T extends CustomContext>
Abstract class with default implementations. Override this instead of implementing Pipeline and let your pipeline override only the methods relevant to your implementation.
Constructor Summary | |
---|---|
AbstractPipeline(Pipeline<?> next)
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractPipeline(Pipeline<?> next)
next
- the pipeline that's next in the sequence.Method Detail |
---|
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 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 WorkerContextcurrentTag
- the Tagtext
- the contentpo
- 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 WorkerContextt
- the Tagpo
- 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 pipelinepublic 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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |