com.itextpdf.tool.xml.pipeline.css
Class CssResolverPipeline

java.lang.Object
  extended by com.itextpdf.tool.xml.pipeline.AbstractPipeline<ObjectContext<CSSResolver>>
      extended by com.itextpdf.tool.xml.pipeline.css.CssResolverPipeline
All Implemented Interfaces:
Pipeline<ObjectContext<CSSResolver>>

public class CssResolverPipeline
extends AbstractPipeline<ObjectContext<CSSResolver>>

This Pipeline resolves CSS for the Tags it receives in open(WorkerContext, Tag, ProcessObject)

Author:
redlab_b

Field Summary
static String CSS_RESOLVER
           
 
Constructor Summary
CssResolverPipeline(CSSResolver cssResolver, Pipeline<?> next)
           
 
Method Summary
 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 setResolver(CSSResolver resolver)
          Stores the cssResolver for the calling thread.
 
Methods inherited from class com.itextpdf.tool.xml.pipeline.AbstractPipeline
close, content, getContextKey, getLocalContext, getNext, setNext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CSS_RESOLVER

public static final String CSS_RESOLVER
See Also:
Constant Field Values
Constructor Detail

CssResolverPipeline

public CssResolverPipeline(CSSResolver cssResolver,
                           Pipeline<?> next)
Parameters:
next - the next pipeline.
cssResolver - the CSSResolver to use in this Pipeline, it will be stored in a ThreadLocal variable.
Method Detail

init

public Pipeline<?> init(WorkerContext context)
                 throws PipelineException
Description copied from interface: Pipeline
The init method allows implementation to initialize the pipeline. e.g. Initialize their CustomContext here and add it to the WorkerContext through WorkerContext.put(String, CustomContext).

Specified by:
init in interface Pipeline<ObjectContext<CSSResolver>>
Overrides:
init in class AbstractPipeline<ObjectContext<CSSResolver>>
Parameters:
context - the WorkerContext
Returns:
the next pipeline in line
Throws:
PipelineException - can be thrown to indicate that something went wrong.

open

public Pipeline<?> open(WorkerContext context,
                        Tag t,
                        ProcessObject po)
                 throws PipelineException
Description copied from class: AbstractPipeline
Just calls getNext.
Override this to get notified on encountered opening tags.

Specified by:
open in interface Pipeline<ObjectContext<CSSResolver>>
Overrides:
open in class AbstractPipeline<ObjectContext<CSSResolver>>
Parameters:
context - the WorkerContext
t - the Tag
po - a processObject to put Writables in
Returns:
the next pipeline in line
Throws:
PipelineException - can be thrown to indicate that something went wrong.

setResolver

public void setResolver(CSSResolver resolver)
Stores the cssResolver for the calling thread.

Parameters:
resolver - the CSSResolver to use.


Copyright © 2012. All Rights Reserved.