|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pentaho.reporting.libraries.xmlns.common.ParserUtil
public class ParserUtil
Basic helper functions to ease up the process of parsing.
Method Summary | |
---|---|
static boolean |
parseBoolean(java.lang.String text,
boolean defaultVal)
Parses a boolean. |
static java.lang.Boolean |
parseBoolean(java.lang.String value,
org.xml.sax.Locator locator)
Translates an boolean string ("true" or "false") into the corresponding Boolean object. |
static float |
parseFloat(java.lang.String text,
float defaultVal)
Parses the string text into an float. |
static float |
parseFloat(java.lang.String text,
java.lang.String message)
Parses the string text into an float. |
static float |
parseFloat(java.lang.String text,
java.lang.String message,
org.xml.sax.Locator locator)
Parses the string text into an float. |
static int |
parseInt(java.lang.String text,
int defaultVal)
Parses an integer. |
static int |
parseInt(java.lang.String text,
java.lang.String message)
Parses the string text into an int. |
static int |
parseInt(java.lang.String text,
java.lang.String message,
org.xml.sax.Locator locator)
Parses the string text into an int. |
static java.lang.String |
parseString(java.lang.String text,
java.lang.String defaultVal)
Parses a string. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int parseInt(java.lang.String text, java.lang.String message, org.xml.sax.Locator locator) throws org.xml.sax.SAXException
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.
text
- the text to parse.message
- the error message if parsing fails.locator
- the SAX locator to print meaningfull error messages.
org.xml.sax.SAXException
- if there is a problem with the parsing.public static int parseInt(java.lang.String text, java.lang.String message) throws org.xml.sax.SAXException
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.
text
- the text to parse.message
- the error message if parsing fails.
org.xml.sax.SAXException
- if there is a problem with the parsing.public static int parseInt(java.lang.String text, int defaultVal)
text
- the text to parse.defaultVal
- the default value.
public static float parseFloat(java.lang.String text, java.lang.String message, org.xml.sax.Locator locator) throws ParseException
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.
text
- the text to parse.message
- the error message if parsing fails.locator
- the SAX locator to print meaningfull error messages.
ParseException
- if the text is no valid float number.public static float parseFloat(java.lang.String text, java.lang.String message) throws org.xml.sax.SAXException
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.
text
- the text to parse.message
- the error message if parsing fails.
org.xml.sax.SAXException
- if there is a problem with the parsing.public static float parseFloat(java.lang.String text, float defaultVal)
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.
text
- the text to parse.defaultVal
- the defaultValue returned if parsing fails.
public static boolean parseBoolean(java.lang.String text, boolean defaultVal)
text
contains the value of
"true", the true value is returned, else false is returned.
text
- the text to parse.defaultVal
- the default value.
public static java.lang.Boolean parseBoolean(java.lang.String value, org.xml.sax.Locator locator) throws ParseException
value
- the string that represents the boolean.locator
- the SAX locator to print meaningfull error messages.
ParseException
- if an parse error occured or the string is not
'true' or 'false'.public static java.lang.String parseString(java.lang.String text, java.lang.String defaultVal)
text
is null, defaultval is
returned.
text
- the text to parse.defaultVal
- the default value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |