com.lowagie.text.markup

Class MarkupParser


public class MarkupParser
extends java.lang.Object

This class contains several static methods that can be used to parse markup.
Author:
blowagie

Constructor Summary

MarkupParser()
Creates new MarkupParser

Method Summary

static Color
decodeColor(String color)
Converts a Color into a HTML representation of this Color.
static Properties
parseAttributes(String string)
This method parses a String with attributes and returns a Properties object.
static Properties
parseFont(String string)
This method parses the value of 'font' attribute and returns a Properties object.
static float
parseLength(String string)
Parses a length.

Constructor Details

MarkupParser

private MarkupParser()
Creates new MarkupParser

Method Details

decodeColor

public static Color decodeColor(String color)
Converts a Color into a HTML representation of this Color.
Parameters:
color - the Color that has to be converted.
Returns:
the HTML representation of this Color

parseAttributes

public static Properties parseAttributes(String string)
This method parses a String with attributes and returns a Properties object.
Parameters:
string - a String of this form: 'key1="value1"; key2="value2";... keyN="valueN" '
Returns:
a Properties object

parseFont

public static Properties parseFont(String string)
This method parses the value of 'font' attribute and returns a Properties object.
Parameters:
string - a String of this form: 'style1 ... styleN size/leading font1 ... fontN'
Returns:
a Properties object

parseLength

public static float parseLength(String string)
Parses a length.
Parameters:
string - a length in the form of an optional + or -, followed by a number and a unit.
Returns:
a float