public class StyleAttrCSSResolver extends Object implements CSSResolver
| Constructor and Description |
|---|
StyleAttrCSSResolver()
Construct a new
StyleAttrCSSResolver with default settings. |
StyleAttrCSSResolver(CssFiles cssFiles)
Construct a new StyleAttrCSSResolver with the given
CssFiles and the DefaultCssInheritanceRules. |
StyleAttrCSSResolver(CssFiles cssFiles,
CssUtils utils)
Construct a new StyleAttrCSSResolver with the given
CssFiles and CssUtils and the
DefaultCssInheritanceRules. |
StyleAttrCSSResolver(CssFiles cssFiles,
FileRetrieve r) |
StyleAttrCSSResolver(CssInheritanceRules rules,
CssFiles cssFiles,
CssUtils utils)
|
StyleAttrCSSResolver(CssInheritanceRules rules,
CssFiles cssFiles,
CssUtils utils,
FileRetrieve fileRetrieve)
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCss(CssFile file)
Add a file to the CssFiles Collection.
|
void |
addCss(String content,
boolean isPersistent)
Add a piece of CSS code.
|
void |
addCss(String content,
String charSet,
boolean isPersistent)
Add a piece of CSS code.
|
void |
addCssFile(String href,
boolean isPersistent)
Add a file to the CssFiles Collection.
|
CSSResolver |
clear() |
void |
resolveStyles(Tag t)
Also taking into account the CSS properties of any parent tag in the given tag.
|
void |
setCssInheritance(CssInheritanceRules cssInheritanceRules)
By setting an implementation of
CssInheritanceRules a developer can set rules on what css selectors are
inherited from parent tags. |
void |
setCssInheritanceRules(CssInheritanceRules inherit) |
void |
setFileRetrieve(FileRetrieve retrieve)
The
FileRetrieve implementation to use in addCss(String, boolean). |
public static final String STYLE
public StyleAttrCSSResolver()
StyleAttrCSSResolver with default settings.public StyleAttrCSSResolver(CssFiles cssFiles)
CssFiles and the DefaultCssInheritanceRules.cssFiles - a CssFiles implementation.public StyleAttrCSSResolver(CssFiles cssFiles, CssUtils utils)
CssFiles and CssUtils and the
DefaultCssInheritanceRules.cssFiles - a CssFiles implementation.utils - the CssUtils to use.public StyleAttrCSSResolver(CssInheritanceRules rules, CssFiles cssFiles, CssUtils utils)
rules - the CssInheritanceRules to use.cssFiles - a CssFiles implementation.utils - the CssUtils to use.public StyleAttrCSSResolver(CssInheritanceRules rules, CssFiles cssFiles, CssUtils utils, FileRetrieve fileRetrieve)
rules - the CssInheritanceRules to use.cssFiles - a CssFiles implementation.utils - the CssUtils to use.fileRetrieve - the FileRetrieve implementationpublic StyleAttrCSSResolver(CssFiles cssFiles, FileRetrieve r)
cssFiles - the CssFile implementationr - the FileRetrieve implementationpublic void resolveStyles(Tag t)
resolveStyles in interface CSSResolvert - the tag.CSSResolver.resolveStyles(com.itextpdf.tool.xml.Tag)public void setCssInheritance(CssInheritanceRules cssInheritanceRules)
CssInheritanceRules a developer can set rules on what css selectors are
inherited from parent tags.cssInheritanceRules - the inherit to setpublic void addCss(String content, String charSet, boolean isPersistent) throws CssResolverException
CSSResolveraddCss in interface CSSResolvercontent - the CSScharSet - a charsetisPersistent - true if the added css should not be deleted on a call to clearCssResolverException - thrown if something goes wrongpublic void addCssFile(String href, boolean isPersistent) throws CssResolverException
addCssFile in interface CSSResolverhref - the path, if it starts with http we try to retrieve the file
from the net, if not we try a normal file operation.isPersistent - true if the added css should not be deleted on a call to clearCssResolverException - thrown if something goes wrongpublic void addCss(CssFile file)
addCss in interface CSSResolverfile - the CssFile to add.public void addCss(String content, boolean isPersistent) throws CssResolverException
CSSResolveraddCss in interface CSSResolvercontent - the content to parse to cssisPersistent - true if the added css should not be deleted on a call to clearCssResolverException - thrown if something goes wrongpublic void setCssInheritanceRules(CssInheritanceRules inherit)
inherit - the inherit to setpublic void setFileRetrieve(FileRetrieve retrieve)
FileRetrieve implementation to use in addCss(String, boolean).setFileRetrieve in interface CSSResolverretrieve - the retrieve to setpublic CSSResolver clear() throws CssResolverException
clear in interface CSSResolverCssResolverException - thrown if something goes wrongCopyright © 2019. All rights reserved.