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
implementation
public StyleAttrCSSResolver(CssFiles cssFiles, FileRetrieve r)
cssFiles
- the CssFile
implementation
r
- the FileRetrieve
implementation
public void resolveStyles(Tag t)
resolveStyles
in interface CSSResolver
t
- 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 set
public void addCss(String content, String charSet, boolean isPersistent) throws CssResolverException
CSSResolver
addCss
in interface CSSResolver
content
- the CSS
charSet
- a charset
isPersistent
- true if the added css should not be deleted on a call to clear
CssResolverException
- thrown if something goes wrong
public void addCssFile(String href, boolean isPersistent) throws CssResolverException
addCssFile
in interface CSSResolver
href
- 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 clear
CssResolverException
- thrown if something goes wrong
public void addCss(CssFile file)
addCss
in interface CSSResolver
file
- the CssFile to add.
public void addCss(String content, boolean isPersistent) throws CssResolverException
CSSResolver
addCss
in interface CSSResolver
content
- the content to parse to css
isPersistent
- true if the added css should not be deleted on a call to clear
CssResolverException
- thrown if something goes wrong
public void setCssInheritanceRules(CssInheritanceRules inherit)
inherit
- the inherit to set
public void setFileRetrieve(FileRetrieve retrieve)
FileRetrieve
implementation to use in addCss(String, boolean)
.
setFileRetrieve
in interface CSSResolver
retrieve
- the retrieve to set
public CSSResolver clear() throws CssResolverException
clear
in interface CSSResolver
CssResolverException
- thrown if something goes wrong
Copyright © 1998–2019. All rights reserved.