|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap
java.util.HashMap
com.lowagie.text.markup.MarkupParser
This class is a HashMap that contains selectors (String) and styles (a Properties object). Given a tag and its attributes (id/class), this class can return an iText object with the according style.
Nested Class Summary |
Nested classes inherited from class java.util.HashMap |
|
Nested classes inherited from class java.util.AbstractMap |
|
Field Summary | |
protected HashMap |
fontcache
HashMap with fonts for each known combination of tag/id/class. |
protected HashMap |
stylecache
HashMap with styles for each known combination of tag/id/class. |
Fields inherited from class java.util.HashMap |
|
Fields inherited from class java.util.AbstractMap |
|
Constructor Summary | |
MarkupParser(String file)
Creates new MarkupParser |
Method Summary | |
private void |
applyBordersColors(Rectangle rect,
Properties attributes,
Properties styleattributes)
Applies colors to a Rectangle object. |
static Color |
decodeColor(String color)
Converts a Color into a HTML representation of this
Color . |
Font |
getFont(Properties attributes)
Returns a font based on the ID and CLASS attributes of a tag. |
private String |
getKey(Properties attributes)
Generates a key for an tag/id/class combination and adds the style attributes to the stylecache. |
Element |
getObject(Properties attributes)
Returns an object based on a tag and its attributes. |
boolean |
getPageBreakAfter(Properties attributes)
Returns pagebreak information. |
boolean |
getPageBreakBefore(Properties attributes)
Returns pagebreak information. |
Rectangle |
getRectangle(Properties attrs)
Returns a rectangle based on the width and height attributes of a tag, can be overridden by the ID and CLASS attributes. |
static Properties |
parseAttributes(String string)
This method parses a String with attributes and returns a Properties object. |
static float |
parseLength(String string)
Parses a length. |
static String |
removeComment(String string,
String startComment,
String endComment)
Removes the comments sections of a String. |
Font |
retrieveFont(Properties styleAttributes)
Retrieves a font from the FontFactory based on some style attributes. |
private Element |
retrieveListItem(Font font,
Properties styleattributes)
Returns a ListItem based on the styleattributes. |
Element |
retrieveParagraph(Font font,
Properties styleattributes)
Retrieves a Paragraph based on some style attributes. |
Element |
retrievePhrase(Font font,
Properties styleattributes)
Retrieves a Phrase based on some style attributes. |
private Element |
retrieveTable(Properties attributes,
Properties styleattributes)
Gets a table based on the styleattributes. |
private Element |
retrieveTableCell(Properties attributes,
Properties styleattributes)
Returns a Cell based on the styleattributes. |
private Element |
retrieveTableRow(Properties attributes,
Properties styleattributes)
Returns a Cell based on the styleattributes. |
Methods inherited from class java.util.HashMap |
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
Field Detail |
protected HashMap stylecache
protected HashMap fontcache
Constructor Detail |
public MarkupParser(String file)
file
- the path to a CSS file.Method Detail |
public static String removeComment(String string, String startComment, String endComment)
string
- the original StringstartComment
- the String that marks the start of a Comment sectionendComment
- the String that marks the end of a Comment section.
public static Properties parseAttributes(String string)
string
- a String of this form: 'key1="value1"; key2="value2";...
keyN="valueN" '
public static float parseLength(String string)
string
- a length in the form of an optional + or -, followed by a
number and a unit.
public static Color decodeColor(String color)
Color
into a HTML representation of this
Color
.
color
- the Color
that has to be converted.
private String getKey(Properties attributes)
attributes
- a Properties object with the tagname and the attributes of the
tag.
public boolean getPageBreakBefore(Properties attributes)
attributes
-
public boolean getPageBreakAfter(Properties attributes)
attributes
-
public Element getObject(Properties attributes)
attributes
- a Properties object with the tagname and the attributes of the
tag.
public Font getFont(Properties attributes)
attributes
- a Properties object with the tagname and the attributes of the
tag.
public Rectangle getRectangle(Properties attrs)
attrs
- the attributes that came with the tag
public Element retrievePhrase(Font font, Properties styleattributes)
font
- styleattributes
- a Properties object containing keys and values
public Element retrieveParagraph(Font font, Properties styleattributes)
font
- styleattributes
- a Properties object containing keys and values
private Element retrieveTable(Properties attributes, Properties styleattributes)
attributes
- styleattributes
-
private Element retrieveTableRow(Properties attributes, Properties styleattributes)
attributes
- styleattributes
-
private Element retrieveTableCell(Properties attributes, Properties styleattributes)
attributes
- styleattributes
-
private Element retrieveListItem(Font font, Properties styleattributes)
font
- styleattributes
-
private void applyBordersColors(Rectangle rect, Properties attributes, Properties styleattributes)
rect
- attributes
- styleattributes
- public Font retrieveFont(Properties styleAttributes)
styleAttributes
- a Properties object containing keys and values
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |