com.itextpdf.tool.xml.svg
Class SvgPipelineContext

java.lang.Object
  extended by com.itextpdf.tool.xml.svg.SvgPipelineContext
All Implemented Interfaces:
CustomContext, Cloneable

public class SvgPipelineContext
extends Object
implements CustomContext, Cloneable


Field Summary
static String BOOKMARK_TREE
          Key for the memory, used to store bookmark nodes
static String LAST_MARGIN_BOTTOM
          Key for the memory, used in Html TagProcessing
 
Constructor Summary
SvgPipelineContext()
          Construct a new CvgPipelineContext object
 
Method Summary
 boolean acceptUnknown()
           
protected  void addFirst(StackKeeper stackKeeper)
          Add a StackKeeper to the top of the stack list.
 void addSymbolById(String id, List<Element> elements)
           
 boolean autoBookmark()
           
 SvgPipelineContext autoBookmark(boolean autoBookmark)
          Set to true to enable the automatic creation of bookmarks on <h1> to <h6> tags.
 Charset charSet()
           
 SvgPipelineContext charSet(Charset cSet)
          Set a Charset to use.
 SvgPipelineContext clone()
          Create a clone of this HtmlPipelineContext, the clone only contains the initial values, not the internal values.
protected  List<Element> currentContent()
           
 ImageProvider getImageProvider()
           
 LinkProvider getLinkProvider()
          Returns the LinkProvider, used to prepend e.g.
 Rectangle getPageSize()
          Returns a Rectangle
 List<String> getRootTags()
           
 List<Element> getSymbolById(String id)
           
 boolean isDefinition()
           
protected  boolean isEmpty()
           
protected  StackKeeper peek()
          Retrieves, but does not remove, the head (first element) of this list.
protected  StackKeeper poll()
          Retrieves and removes the top of the stack.
protected  TagProcessor resolveProcessor(String tag, String nameSpace)
           
 SvgPipelineContext setAcceptUnknown(boolean acceptUnknown)
          Set to true to allow the HtmlPipeline to accept tags it does not find in the given TagProcessorFactory
 void setDefinition(boolean definition)
           
 SvgPipelineContext setImageProvider(ImageProvider imageProvider)
          An ImageProvider can be provided and works in conjunction with Image and ListStyleTypeCssApplier for List Images.
 SvgPipelineContext setLinkProvider(LinkProvider linkprovider)
          Set the LinkProvider to use if any.
 SvgPipelineContext setPageSize(Rectangle pageSize)
          If no pageSize is set, the default value A4 is used.
 SvgPipelineContext setRootTags(List<String> roottags)
          Set the root-tags, this matters for margins.
 SvgPipelineContext setTagFactory(TagProcessorFactory tagFactory)
          Set the TagProcessorFactory to be used.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOOKMARK_TREE

public static final String BOOKMARK_TREE
Key for the memory, used to store bookmark nodes

See Also:
Constant Field Values

LAST_MARGIN_BOTTOM

public static final String LAST_MARGIN_BOTTOM
Key for the memory, used in Html TagProcessing

See Also:
Constant Field Values
Constructor Detail

SvgPipelineContext

public SvgPipelineContext()
Construct a new CvgPipelineContext object

Method Detail

isDefinition

public boolean isDefinition()

setDefinition

public void setDefinition(boolean definition)

resolveProcessor

protected TagProcessor resolveProcessor(String tag,
                                        String nameSpace)
Parameters:
tag - the tag to find a TagProcessor for
nameSpace - the namespace.
Returns:
a TagProcessor

addFirst

protected void addFirst(StackKeeper stackKeeper)
Add a StackKeeper to the top of the stack list.

Parameters:
stackKeeper - the StackKeeper

peek

protected StackKeeper peek()
                    throws NoStackException
Retrieves, but does not remove, the head (first element) of this list.

Returns:
a StackKeeper
Throws:
NoStackException - if there are no elements on the stack

currentContent

protected List<Element> currentContent()
Returns:
the current content of elements.

acceptUnknown

public boolean acceptUnknown()
Returns:
if this pipelines tag processing accept unknown tags: true. False otherwise

isEmpty

protected boolean isEmpty()
Returns:
returns true if the stack is empty

poll

protected StackKeeper poll()
                    throws NoStackException
Retrieves and removes the top of the stack.

Returns:
a StackKeeper
Throws:
NoStackException - if there are no elements on the stack

autoBookmark

public boolean autoBookmark()
Returns:
true if auto-bookmarks should be enabled. False otherwise.

getSymbolById

public List<Element> getSymbolById(String id)

addSymbolById

public void addSymbolById(String id,
                          List<Element> elements)

getImageProvider

public ImageProvider getImageProvider()
                               throws NoImageProviderException
Returns:
the image provider.
Throws:
NoImageProviderException - if there is no ImageProvider

charSet

@Experimental
public SvgPipelineContext charSet(Charset cSet)
Set a Charset to use.

Parameters:
cSet - the charset.
Returns:
this HtmlPipelineContext

charSet

public Charset charSet()
Returns:
the Charset to use, or null if none configured.

getPageSize

public Rectangle getPageSize()
Returns a Rectangle

Returns:
the pagesize.

getRootTags

public List<String> getRootTags()
Returns:
a list of tags to be taken as root-tags. This matters for margins. By default the root-tags are <body> and <div>

getLinkProvider

public LinkProvider getLinkProvider()
Returns the LinkProvider, used to prepend e.g. http://www.example.org/ to found <a> tags that have no absolute url.

Returns:
the LinkProvider if any.

setPageSize

public SvgPipelineContext setPageSize(Rectangle pageSize)
If no pageSize is set, the default value A4 is used.

Parameters:
pageSize - the pageSize to set
Returns:
this HtmlPipelineContext

clone

public SvgPipelineContext clone()
                         throws CloneNotSupportedException
Create a clone of this HtmlPipelineContext, the clone only contains the initial values, not the internal values. Beware, the state of the current Context is not copied to the clone. Only the configurational important stuff like the LinkProvider (same object), ImageProvider (new AbstractImageProvider with same ImageRootPath) , TagProcessorFactory (same object), acceptUnknown (primitive), charset (Charset.forName to get a new charset), autobookmark (primitive) are copied.

Overrides:
clone in class Object
Throws:
CloneNotSupportedException

setAcceptUnknown

public SvgPipelineContext setAcceptUnknown(boolean acceptUnknown)
Set to true to allow the HtmlPipeline to accept tags it does not find in the given TagProcessorFactory

Parameters:
acceptUnknown - true or false
Returns:
this HtmlPipelineContext

setTagFactory

public SvgPipelineContext setTagFactory(TagProcessorFactory tagFactory)
Set the TagProcessorFactory to be used. For HTML use Tags.getHtmlTagProcessorFactory()

Parameters:
tagFactory - the TagProcessorFactory that should be used
Returns:
this HtmlPipelineContext

autoBookmark

public SvgPipelineContext autoBookmark(boolean autoBookmark)
Set to true to enable the automatic creation of bookmarks on <h1> to <h6> tags. Works in conjunction with Header.

Parameters:
autoBookmark - true or false
Returns:
this HtmlPipelineContext

setRootTags

public SvgPipelineContext setRootTags(List<String> roottags)
Set the root-tags, this matters for margins. By default these are set to <body> and <div>.

Parameters:
roottags - the root tags
Returns:
this HtmlPipelineContext

setImageProvider

public SvgPipelineContext setImageProvider(ImageProvider imageProvider)
An ImageProvider can be provided and works in conjunction with Image and ListStyleTypeCssApplier for List Images.

Parameters:
imageProvider - the ImageProvider to use.
Returns:
this HtmlPipelineContext

setLinkProvider

public SvgPipelineContext setLinkProvider(LinkProvider linkprovider)
Set the LinkProvider to use if any.

Parameters:
linkprovider - the LinkProvider (@see HtmlPipelineContext.getLinkProvider()
Returns:
this HtmlPipelineContext


Copyright © 2012. All Rights Reserved.