com.lowagie.text.markup
Class MarkupParser

java.lang.Object
  |
  +--com.lowagie.text.markup.MarkupParser

public class MarkupParser
extends Object

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

Author:
blowagie

Constructor Summary
private 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarkupParser

private MarkupParser()
Creates new MarkupParser

Method Detail

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

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