public class HtmlPipelineContext extends Object implements CustomContext, Cloneable, MarginMemory, PageSizeContainable, CssAppliersAware
HtmlPipeline
.
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
HtmlPipelineContext(CssAppliers cssAppliers)
Construct a new HtmlPipelineContext object
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptUnknown() |
protected void |
addFirst(StackKeeper stackKeeper)
Add a StackKeeper to the top of the stack list.
|
boolean |
autoBookmark() |
HtmlPipelineContext |
autoBookmark(boolean autoBookmark)
Set to true to enable the automatic creation of bookmarks on to |
Charset |
charSet() |
HtmlPipelineContext |
charSet(Charset cSet)
Set a Charset to use.
|
HtmlPipelineContext |
clone()
Create a clone of this HtmlPipelineContext, the clone only contains the initial values, not the internal values.
|
protected List<Element> |
currentContent() |
CssAppliers |
getCssAppliers() |
ImageProvider |
getImageProvider() |
Float |
getLastMarginBottom() |
LinkProvider |
getLinkProvider()
Returns the LinkProvider, used to prepend e.g. http://www.example.org/ to found tags that have no absolute url.
|
Map<String,Object> |
getMemory() |
Rectangle |
getPageSize()
Returns a Rectangle
|
String |
getResourcesRootPath() |
List<String> |
getRootTags() |
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) |
HtmlPipelineContext |
setAcceptUnknown(boolean acceptUnknown)
Set to true to allow the HtmlPipeline to accept tags it does not find in the given TagProcessorFactory
|
HtmlPipelineContext |
setCssApplier(CssAppliers cssAppliers)
Fluent variant of setCssAppliers(CssAppliers)
|
void |
setCssAppliers(CssAppliers cssAppliers) |
HtmlPipelineContext |
setImageProvider(ImageProvider imageProvider)
An ImageProvider can be provided and works in conjunction with Image and ListStyleTypeCssApplier for List Images.
|
void |
setLastMarginBottom(Float lmb)
Set the last margin bottom.
|
HtmlPipelineContext |
setLinkProvider(LinkProvider linkprovider)
Set the LinkProvider to use if any.
|
HtmlPipelineContext |
setPageSize(Rectangle pageSize)
If no pageSize is set, the default value A4 is used.
|
void |
setResourcesRootPath(String resourcesRootPath) |
HtmlPipelineContext |
setRootTags(List<String> roottags)
Set the root-tags, this matters for margins.
|
HtmlPipelineContext |
setTagFactory(TagProcessorFactory tagFactory)
Set the TagProcessorFactory to be used.
|
public static final String BOOKMARK_TREE
public static final String LAST_MARGIN_BOTTOM
public HtmlPipelineContext(CssAppliers cssAppliers)
protected TagProcessor resolveProcessor(String tag, String nameSpace)
tag
- the tag to find a TagProcessor for
nameSpace
- the namespace.
protected void addFirst(StackKeeper stackKeeper)
StackKeeper
to the top of the stack list.
stackKeeper
- the StackKeeper
protected StackKeeper peek()
public boolean acceptUnknown()
protected boolean isEmpty()
protected StackKeeper poll() throws NoStackException
NoStackException
- if there are no elements on the stack
public boolean autoBookmark()
public ImageProvider getImageProvider()
ImageProvider
.
@Experimental public HtmlPipelineContext charSet(Charset cSet)
Charset
to use.
cSet
- the charset.
HtmlPipelineContext
public Rectangle getPageSize()
Rectangle
getPageSize
in interface PageSizeContainable
public List<String> getRootTags()
getRootTags
in interface MarginMemory
public LinkProvider getLinkProvider()
public HtmlPipelineContext setPageSize(Rectangle pageSize)
pageSize
- the pageSize to set
HtmlPipelineContext
public HtmlPipelineContext clone() throws CloneNotSupportedException
AbstractImageProvider
with same ImageRootPath) , TagProcessorFactory (same object), acceptUnknown (primitive), charset (Charset.forName to get a new charset), autobookmark (primitive) are copied.
clone
in class Object
CloneNotSupportedException
public HtmlPipelineContext setAcceptUnknown(boolean acceptUnknown)
TagProcessorFactory
acceptUnknown
- true or false
HtmlPipelineContext
public HtmlPipelineContext setTagFactory(TagProcessorFactory tagFactory)
TagProcessorFactory
to be used. For HTML use Tags.getHtmlTagProcessorFactory()
tagFactory
- the TagProcessorFactory
that should be used
HtmlPipelineContext
public HtmlPipelineContext autoBookmark(boolean autoBookmark)
Header
.
autoBookmark
- true or false
HtmlPipelineContext
public HtmlPipelineContext setRootTags(List<String> roottags)
roottags
- the root tags
HtmlPipelineContext
public HtmlPipelineContext setImageProvider(ImageProvider imageProvider)
Image
and ListStyleTypeCssApplier
for List Images.
imageProvider
- the ImageProvider
to use.
HtmlPipelineContext
public HtmlPipelineContext setLinkProvider(LinkProvider linkprovider)
linkprovider
- the LinkProvider (@see getLinkProvider()
HtmlPipelineContext
public Float getLastMarginBottom() throws NoDataException
getLastMarginBottom
in interface MarginMemory
NoDataException
- if there is no LastMarginBottom set
public void setLastMarginBottom(Float lmb)
MarginMemory
setLastMarginBottom
in interface MarginMemory
lmb
- set the float for lmb
public void setCssAppliers(CssAppliers cssAppliers)
setCssAppliers
in interface CssAppliersAware
cssAppliers
- the CssAppliers
public CssAppliers getCssAppliers()
getCssAppliers
in interface CssAppliersAware
public HtmlPipelineContext setCssApplier(CssAppliers cssAppliers)
setCssAppliers(CssAppliers)
cssAppliers
- the cssAppliers
public String getResourcesRootPath()
public void setResourcesRootPath(String resourcesRootPath)
Copyright © 1998–2016. All rights reserved.