com.itextpdf.tool.xml.pipeline.ctx
Class WorkerContextImpl

java.lang.Object
  extended by com.itextpdf.tool.xml.pipeline.ctx.WorkerContextImpl
All Implemented Interfaces:
WorkerContext

public class WorkerContextImpl
extends Object
implements WorkerContext

The global WorkerContext, a storage for CustomContexts. It extends MapContext but overrides the MapContext methods to throw NotImplementedException.

Author:
redlab_b

Constructor Summary
WorkerContextImpl()
           
 
Method Summary
 CustomContext get(String klass)
           
 Tag getCurrentTag()
           
 void put(String key, CustomContext context)
          Convenience method.
 void setCurrentTag(Tag t)
          Contains the current tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkerContextImpl

public WorkerContextImpl()
Method Detail

get

public CustomContext get(String klass)
                  throws NoCustomContextException
Specified by:
get in interface WorkerContext
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(String key,
                CustomContext context)
Convenience method.

Specified by:
put in interface WorkerContext
Parameters:
key - the key to store the CustomContext for.
context - the CustomContext to store.

setCurrentTag

public void setCurrentTag(Tag t)
Description copied from interface: WorkerContext
Contains the current tag.

Specified by:
setCurrentTag in interface WorkerContext
Parameters:
t - the Tag

getCurrentTag

public Tag getCurrentTag()
Specified by:
getCurrentTag in interface WorkerContext
Returns:
the current tag


Copyright © 2012. All Rights Reserved.