|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.itextpdf.text.html.simpleparser.StyleSheet
public class StyleSheet
Old class to define styles for HTMLWorker. We've completely rewritten HTML to PDF functionality; see project XML Worker. XML Worker is able to parse CSS files and "style" attribute values.
Field Summary | |
---|---|
protected Map<String,Map<String,String>> |
classMap
Map storing possible names of the "class" attribute and their corresponding styles. |
protected Map<String,Map<String,String>> |
tagMap
Map storing tags and their corresponding styles. |
Constructor Summary | |
---|---|
StyleSheet()
Creates a new instance of StyleSheet |
Method Summary | |
---|---|
void |
applyStyle(String tag,
Map<String,String> attrs)
Resolves the styles based on the tag name and the value of the class attribute. |
void |
loadStyle(String className,
HashMap<String,String> attrs)
Associates a Map containing styles with a class name. |
void |
loadStyle(String className,
String key,
String value)
Adds an extra style key-value pair to the styles Map of a specific tag |
void |
loadTagStyle(String tag,
Map<String,String> attrs)
Associates a Map containing styles with a tag. |
void |
loadTagStyle(String tag,
String key,
String value)
Adds an extra style key-value pair to the styles Map of a specific tag |
static void |
resolveStyleAttribute(Map<String,String> h,
ChainedProperties chain)
Method contributed by Lubos Strapko |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Map<String,Map<String,String>> tagMap
protected Map<String,Map<String,String>> classMap
Constructor Detail |
---|
public StyleSheet()
Method Detail |
---|
public void loadTagStyle(String tag, Map<String,String> attrs)
tag
- the name of the HTML/XML tagattrs
- a map containing stylespublic void loadTagStyle(String tag, String key, String value)
tag
- the name of the HTML/XML tagkey
- the key specifying a specific stylevalue
- the value defining the stylepublic void loadStyle(String className, HashMap<String,String> attrs)
className
- the value of the class attributeattrs
- a map containing stylespublic void loadStyle(String className, String key, String value)
className
- the name of the HTML/XML tagkey
- the key specifying a specific stylevalue
- the value defining the stylepublic void applyStyle(String tag, Map<String,String> attrs)
tag
- the tag that needs to be resolvedattrs
- existing style map that will be updatedpublic static void resolveStyleAttribute(Map<String,String> h, ChainedProperties chain)
h
- chain
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |