org.jfree.xml
public class ParserUtil extends Object
Method Summary | |
---|---|
static Rectangle2D | getElementPosition(Attributes atts)
Parses an element position. |
static boolean | parseBoolean(String text, boolean defaultVal)
Parses a boolean. |
static Color | parseColor(String color)
Parses a color entry. |
static Color | parseColor(String color, Color defaultValue)
Parses a color entry. |
static float | parseFloat(String text, String message)
Parses the string text into an float. |
static float | parseFloat(String text, float defaultVal)
Parses the string text into an float. |
static int | parseInt(String text, String message)
Parses the string text into an int. |
static int | parseInt(String text, int defaultVal)
Parses an integer.
|
static float | parseRelativeFloat(String value, String exceptionMessage)
Parses a position of an element. |
static String | parseString(String text, String defaultVal)
Parses a string. |
static Stroke | parseStroke(String weight)
Creates a basic stroke given the width contained as float in the given string.
|
Parameters: atts the attributes.
Returns: the element position.
Throws: SAXException if there is a problem getting the element position.
text
contains the value of "true", the
true value is returned, else false is returned.
Parameters: text the text to parse. defaultVal the default value.
Returns: a boolean.
As fallback the color black is returned if no color can be parsed.
Parameters: color the color (as a string).
Returns: the paint.
As fallback the supplied default value is returned if no color can be parsed.
Parameters: color the color (as a string). defaultValue the default value (returned if no color can be parsed).
Returns: the paint.
text
into an float. If text is null or does not
contain a parsable value, the message given in message
is used to
throw a SAXException.
Parameters: text the text to parse. message the error message if parsing fails.
Returns: the float value.
Throws: SAXException if there is a problem with the parsing.
text
into an float. If text is null or does not
contain a parsable value, the message given in message
is used to
throw a SAXException.
Parameters: text the text to parse. defaultVal the defaultValue returned if parsing fails.
Returns: the float value.
text
into an int. If text is null or does not
contain a parsable value, the message given in message
is used to
throw a SAXException.
Parameters: text the text to parse. message the error message if parsing fails.
Returns: the int value.
Throws: SAXException if there is a problem with the parsing.
Parameters: text the text to parse. defaultVal the default value.
Returns: the integer.
Parameters: value the value. exceptionMessage the exception message.
Returns: the float value.
Throws: SAXException if there is a problem parsing the string.
text
is null, defaultval is returned.
Parameters: text the text to parse. defaultVal the default value.
Returns: a string.
Parameters: weight a string containing a number (the stroke weight).
Returns: the stroke.