| java.lang.Object org.jfree.xml.ParserUtil
ParserUtil | public class ParserUtil (Code) | | Basic helper functions to ease up the process of parsing.
author: Thomas Morgner |
getElementPosition | public static Rectangle2D getElementPosition(Attributes atts) throws SAXException(Code) | | Parses an element position. The position is stored in the attributes "x", "y", "width" and
"height". The attributes are allowed to have relative notion.
Parameters: atts - the attributes. the element position. throws: SAXException - if there is a problem getting the element position. |
parseBoolean | public static boolean parseBoolean(String text, boolean defaultVal)(Code) | | Parses a boolean. If the string text contains the value of "true", the
true value is returned, else false is returned.
Parameters: text - the text to parse. Parameters: defaultVal - the default value. a boolean. |
parseColor | public static Color parseColor(String color)(Code) | | Parses a color entry. If the entry is in hexadecimal or ocal notation, the color is
created using Color.decode(). If the string denotes a constant name of on of the color
constants defined in java.awt.Color, this constant is used.
As fallback the color black is returned if no color can be parsed.
Parameters: color - the color (as a string). the paint. |
parseColor | public static Color parseColor(String color, Color defaultValue)(Code) | | Parses a color entry. If the entry is in hexadecimal or octal notation, the color is
created using Color.decode(). If the string denotes a constant name of one of the color
constants defined in java.awt.Color, this constant is used.
As fallback the supplied default value is returned if no color can be parsed.
Parameters: color - the color (as a string). Parameters: defaultValue - the default value (returned if no color can be parsed). the paint. |
parseFloat | public static float parseFloat(String text, String message) throws SAXException(Code) | | Parses the string 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. Parameters: message - the error message if parsing fails. the float value. throws: SAXException - if there is a problem with the parsing. |
parseFloat | public static float parseFloat(String text, float defaultVal)(Code) | | Parses the string 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. Parameters: defaultVal - the defaultValue returned if parsing fails. the float value. |
parseInt | public static int parseInt(String text, String message) throws SAXException(Code) | | Parses the string 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. Parameters: message - the error message if parsing fails. the int value. throws: SAXException - if there is a problem with the parsing. |
parseInt | public static int parseInt(String text, int defaultVal)(Code) | | Parses an integer.
Parameters: text - the text to parse. Parameters: defaultVal - the default value. the integer. |
parseRelativeFloat | public static float parseRelativeFloat(String value, String exceptionMessage) throws SAXException(Code) | | Parses a position of an element. If a relative postion is given, the returnvalue
is a negative number between 0 and -100.
Parameters: value - the value. Parameters: exceptionMessage - the exception message. the float value. throws: SAXException - if there is a problem parsing the string. |
parseString | public static String parseString(String text, String defaultVal)(Code) | | Parses a string. If the text is null, defaultval is returned.
Parameters: text - the text to parse. Parameters: defaultVal - the default value. a string. |
parseStroke | public static Stroke parseStroke(String weight)(Code) | | Creates a basic stroke given the width contained as float in the given string.
If the string could not be parsed into a float, a basic stroke with the width of
1 is returned.
Parameters: weight - a string containing a number (the stroke weight). the stroke. |
|
|