MarginMemory
, PageSizeContainable
, CustomContext
, CssAppliersAware
, java.lang.Cloneable
public class HtmlPipelineContext extends java.lang.Object implements CustomContext, java.lang.Cloneable, MarginMemory, PageSizeContainable, CssAppliersAware
HtmlPipeline
.Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
BOOKMARK_TREE |
Key for the memory, used to store bookmark nodes
|
static java.lang.String |
LAST_MARGIN_BOTTOM |
Key for the memory, used in Html TagProcessing
|
Constructor | Description |
---|---|
HtmlPipelineContext(CssAppliers cssAppliers) |
Construct a new HtmlPipelineContext object
|
Modifier and Type | Method | 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 <h1>
to <h6> tags.
|
java.nio.charset.Charset |
charSet() |
|
HtmlPipelineContext |
charSet(java.nio.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 java.util.List<Element> |
currentContent() |
|
CssAppliers |
getCssAppliers() |
|
ImageProvider |
getImageProvider() |
|
java.lang.Float |
getLastMarginBottom() |
|
LinkProvider |
getLinkProvider() |
Returns the LinkProvider, used to prepend e.g.
|
java.util.Map<java.lang.String,java.lang.Object> |
getMemory() |
|
Rectangle |
getPageSize() |
Returns a
Rectangle |
java.lang.String |
getResourcesRootPath() |
|
java.util.List<java.lang.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(java.lang.String tag,
java.lang.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(java.lang.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(java.lang.String resourcesRootPath) |
|
HtmlPipelineContext |
setRootTags(java.util.List<java.lang.String> roottags) |
Set the root-tags, this matters for margins.
|
HtmlPipelineContext |
setTagFactory(TagProcessorFactory tagFactory) |
Set the
TagProcessorFactory to be used. |
public static final java.lang.String BOOKMARK_TREE
public static final java.lang.String LAST_MARGIN_BOTTOM
public HtmlPipelineContext(CssAppliers cssAppliers)
protected TagProcessor resolveProcessor(java.lang.String tag, java.lang.String nameSpace)
tag
- the tag to find a TagProcessor fornameSpace
- the namespace.protected void addFirst(StackKeeper stackKeeper)
StackKeeper
to the top of the stack list.stackKeeper
- the StackKeeper
protected StackKeeper peek()
protected java.util.List<Element> currentContent()
public boolean acceptUnknown()
protected boolean isEmpty()
protected StackKeeper poll() throws NoStackException
NoStackException
- if there are no elements on the stackpublic boolean autoBookmark()
public java.util.Map<java.lang.String,java.lang.Object> getMemory()
public ImageProvider getImageProvider()
ImageProvider
.@Experimental public HtmlPipelineContext charSet(java.nio.charset.Charset cSet)
Charset
to use.cSet
- the charset.HtmlPipelineContext
public java.nio.charset.Charset charSet()
Charset
to use, or null if none configured.public Rectangle getPageSize()
Rectangle
getPageSize
in interface PageSizeContainable
public java.util.List<java.lang.String> getRootTags()
getRootTags
in interface MarginMemory
public LinkProvider getLinkProvider()
public HtmlPipelineContext setPageSize(Rectangle pageSize)
pageSize
- the pageSize to setHtmlPipelineContext
public HtmlPipelineContext clone() throws java.lang.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 java.lang.Object
java.lang.CloneNotSupportedException
public HtmlPipelineContext setAcceptUnknown(boolean acceptUnknown)
TagProcessorFactory
acceptUnknown
- true or falseHtmlPipelineContext
public HtmlPipelineContext setTagFactory(TagProcessorFactory tagFactory)
TagProcessorFactory
to be used. For HTML use Tags.getHtmlTagProcessorFactory()
tagFactory
- the TagProcessorFactory
that should be usedHtmlPipelineContext
public HtmlPipelineContext autoBookmark(boolean autoBookmark)
Header
.autoBookmark
- true or falseHtmlPipelineContext
public HtmlPipelineContext setRootTags(java.util.List<java.lang.String> roottags)
roottags
- the root tagsHtmlPipelineContext
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 java.lang.Float getLastMarginBottom() throws NoDataException
getLastMarginBottom
in interface MarginMemory
NoDataException
- if there is no LastMarginBottom setpublic void setLastMarginBottom(java.lang.Float lmb)
MarginMemory
setLastMarginBottom
in interface MarginMemory
lmb
- set the float for lmbpublic void setCssAppliers(CssAppliers cssAppliers)
setCssAppliers
in interface CssAppliersAware
cssAppliers
- the CssApplierspublic CssAppliers getCssAppliers()
getCssAppliers
in interface CssAppliersAware
public HtmlPipelineContext setCssApplier(CssAppliers cssAppliers)
setCssAppliers(CssAppliers)
cssAppliers
- the cssApplierspublic java.lang.String getResourcesRootPath()
public void setResourcesRootPath(java.lang.String resourcesRootPath)
Copyright © 1998–2018. All rights reserved.