com.itextpdf.tool.xml.pipeline.css
Interface CSSResolver

All Known Implementing Classes:
StyleAttrCSSResolver, StyleAttrSvgCSSResolver

public interface CSSResolver

Resolves CSS rules for a given tag.

Author:
redlab_b

Method Summary
 void addCss(CssFile file)
          Add a CssFile
 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
 CSSResolver clear()
           
 void resolveStyles(Tag t)
          This method should resolve css, meaning, it will look at the css and retrieve relevant css rules for the given tag.
 void setFileRetrieve(FileRetrieve retrieve)
          The FileRetrieve implementation to use in addCss(String, boolean).
 

Method Detail

resolveStyles

void resolveStyles(Tag t)
This method should resolve css, meaning, it will look at the css and retrieve relevant css rules for the given tag. The rules must then be set in Tag.setCSS(java.util.Map).

Parameters:
t - the tag.

addCss

void addCss(String content,
            String charSet,
            boolean isPersistent)
            throws CssResolverException
Add a piece of CSS code.

Parameters:
content - the CSS
charSet - a charset
isPersistent - true if the added css should not be deleted on a call to clear
Throws:
CssResolverException - thrown if something goes wrong

addCssFile

void addCssFile(String href,
                boolean isPersistent)
                throws CssResolverException
Add a

Parameters:
href - the link to the css file ( an absolute uri )
isPersistent - true if the added css should not be deleted on a call to clear
Throws:
CssResolverException - thrown if something goes wrong

addCss

void addCss(String content,
            boolean isPersistent)
            throws CssResolverException
Add a piece of CSS code.

Parameters:
content - the content to parse to css
isPersistent - true if the added css should not be deleted on a call to clear
Throws:
CssResolverException - thrown if something goes wrong

addCss

void addCss(CssFile file)
Add a CssFile

Parameters:
file - the CssFile

setFileRetrieve

void setFileRetrieve(FileRetrieve retrieve)
The FileRetrieve implementation to use in addCss(String, boolean).

Parameters:
retrieve - the retrieve to set

clear

CSSResolver clear()
                  throws CssResolverException
Returns:
an instance of this resolver
Throws:
CssResolverException - thrown if something goes wrong


Copyright © 2012. All Rights Reserved.