Class WorkerContextImpl
- java.lang.Object
-
- com.itextpdf.tool.xml.pipeline.ctx.WorkerContextImpl
-
- All Implemented Interfaces:
WorkerContext
public class WorkerContextImpl extends java.lang.Object implements WorkerContext
The global WorkerContext, a storage for CustomContexts. It extendsMapContextbut overrides the MapContext methods to throwNotImplementedException.
-
-
Field Summary
Fields Modifier and Type Field Description private MapContextmcprivate Tagtag
-
Constructor Summary
Constructors Constructor Description WorkerContextImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CustomContextget(java.lang.String klass)TaggetCurrentTag()voidput(java.lang.String key, CustomContext context)Convenience method.voidsetCurrentTag(Tag t)Contains the current tag.
-
-
-
Field Detail
-
mc
private final MapContext mc
-
tag
private Tag tag
-
-
Method Detail
-
get
public CustomContext get(java.lang.String klass) throws NoCustomContextException
- Specified by:
getin interfaceWorkerContext- Parameters:
klass- the key to find the custom context for. (internally itextpdf.com uses the pipelines fully qualified klassName, so when you want to use our pipelines twice in the same 'line' you have to override it to change the key used)- Returns:
- a CustomContext for the given Class.
- Throws:
NoCustomContextException- if no CustomContext is found.
-
put
public void put(java.lang.String key, CustomContext context)Convenience method.- Specified by:
putin interfaceWorkerContext- Parameters:
key- the key to store the CustomContext for.context- the CustomContext to store.
-
setCurrentTag
public void setCurrentTag(Tag t)
Description copied from interface:WorkerContextContains the current tag.- Specified by:
setCurrentTagin interfaceWorkerContext- Parameters:
t- the Tag
-
getCurrentTag
public Tag getCurrentTag()
- Specified by:
getCurrentTagin interfaceWorkerContext- Returns:
- the current tag
-
-