com.itextpdf.tool.xml.css
Class CSSFileWrapper

java.lang.Object
  extended by com.itextpdf.tool.xml.css.CSSFileWrapper
All Implemented Interfaces:
CssFile

public class CSSFileWrapper
extends Object
implements CssFile

This Wrapper disables the add and isPersistent(final boolean b) methods.

Author:
redlab_b

Constructor Summary
CSSFileWrapper(CssFile css, boolean b)
          Constructs a CssFile that does not allow adding of new CSS (given you don't mess with the CssFile provided on construction).
 
Method Summary
 void add(String selector, Map<String,String> props)
          Add CSS to this CssFile.
 Map<String,String> get(String selector)
          Return CSS for the given selector.
 boolean isPersistent()
           
 void isPersistent(boolean b)
          Indicates that this file should be kept.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSSFileWrapper

public CSSFileWrapper(CssFile css,
                      boolean b)
Constructs a CssFile that does not allow adding of new CSS (given you don't mess with the CssFile provided on construction).

Parameters:
css - the css file
b - true if this file should be kept forever.
Method Detail

add

public void add(String selector,
                Map<String,String> props)
Description copied from interface: CssFile
Add CSS to this CssFile.

Specified by:
add in interface CssFile
Parameters:
selector - the CSS selector
props - the properties for the given selector

get

public Map<String,String> get(String selector)
Description copied from interface: CssFile
Return CSS for the given selector.

Specified by:
get in interface CssFile
Parameters:
selector - the selector to look for
Returns:
a map with all CSS properties for this selector or an empty map if none found.

isPersistent

public boolean isPersistent()
Specified by:
isPersistent in interface CssFile
Returns:
if this CSS file should never be thrown away. Used in CSSFilesImpl#clear

isPersistent

public void isPersistent(boolean b)
Description copied from interface: CssFile
Indicates that this file should be kept.

Specified by:
isPersistent in interface CssFile
Parameters:
b - true if this file should be kept.


Copyright © 2012. All Rights Reserved.