| java.lang.Object org.jaffa.datatypes.Parser
Parser | public class Parser (Code) | | This class has convenience methods to parse a string into the required objects.
|
Method Summary | |
public static Boolean | parseBoolean(String input) Returns a Boolean object corresponding to the input String.
It uses the default layout specified in the corrsponding meta class.
If the layout is null, then a TRUE is returned if the input is true, t, yes, y, 1.
If the layout is null, then a FALSE is returned if the input is false, f, no, n, 0.
If the layout is null, and the input is none of the above, then it uses standard JAVA boolean parsing.
If the layout is passed, then it is assumed to have the true/false strings separated by a comma.
Parameters: input - the input. | public static Boolean | parseBoolean(String input, String layout) Returns a Boolean object corresponding to the input String.
If the layout is null, then a TRUE is returned if the input is true, t, yes, y, 1.
If the layout is null, then a FALSE is returned if the input is false, f, no, n, 0.
If the layout is null, and the input is none of the above, then it uses standard JAVA boolean parsing.
If the layout is passed, then it is assumed to have the true/false strings separated by a comma.
Parameters: input - the input. Parameters: layout - the layout. | public static Currency | parseCurrency(String input) Returns a Currency object corresponding to the input String.
It uses the default layout specified in the corrsponding meta class.
Parameters: input - the input. throws: FormatCurrencyException - if parsing fails. | public static Currency | parseCurrency(String input, String layout) Returns a Currency object corresponding to the input String.
Parameters: input - the input. Parameters: layout - the layout. throws: FormatCurrencyException - if parsing fails. | public static DateOnly | parseDateOnly(String input) Returns a DateOnly object corresponding to the input String.
It uses the default layout specified in the corrsponding meta class.
Parameters: input - the input. throws: FormatDateOnlyException - if parsing fails. | public static DateOnly | parseDateOnly(String input, String layout) Returns a DateOnly object corresponding to the input String.
Parameters: input - the input. Parameters: layout - the layout. throws: FormatDateOnlyException - if parsing fails. | public static DateTime | parseDateTime(String input) Returns a DateTime object corresponding to the input String.
It uses the default layout specified in the corrsponding meta class.
Parameters: input - the input. throws: FormatDateTimeException - if parsing fails. | public static DateTime | parseDateTime(String input, String layout) Returns a DateTime object corresponding to the input String.
Parameters: input - the input. Parameters: layout - the layout. throws: FormatDateTimeException - if parsing fails. | public static Double | parseDecimal(String input) Returns a Double object corresponding to the input String.
It uses the default layout specified in the corrsponding meta class.
Parameters: input - the input. throws: FormatDecimalException - if parsing fails. | public static Double | parseDecimal(String input, String layout) Returns a Double object corresponding to the input String.
Parameters: input - the input. Parameters: layout - the layout. throws: FormatDecimalException - if parsing fails. | public static Long | parseInteger(String input) Returns a Long object corresponding to the input String.
It uses the default layout specified in the corrsponding meta class.
Parameters: input - the input. throws: FormatIntegerException - if parsing fails. | public static Long | parseInteger(String input, String layout) Returns a Long object corresponding to the input String.
Parameters: input - the input. Parameters: layout - the layout. throws: FormatIntegerException - if parsing fails. | public static byte[] | parseRaw(String input) Converts the input into an array of bytes
Parameters: input - the input. | public static String | parseString(String input) Just returns the String as is.
Parameters: input - the input. |
parseBoolean | public static Boolean parseBoolean(String input)(Code) | | Returns a Boolean object corresponding to the input String.
It uses the default layout specified in the corrsponding meta class.
If the layout is null, then a TRUE is returned if the input is true, t, yes, y, 1.
If the layout is null, then a FALSE is returned if the input is false, f, no, n, 0.
If the layout is null, and the input is none of the above, then it uses standard JAVA boolean parsing.
If the layout is passed, then it is assumed to have the true/false strings separated by a comma.
Parameters: input - the input. the parsed object. |
parseBoolean | public static Boolean parseBoolean(String input, String layout)(Code) | | Returns a Boolean object corresponding to the input String.
If the layout is null, then a TRUE is returned if the input is true, t, yes, y, 1.
If the layout is null, then a FALSE is returned if the input is false, f, no, n, 0.
If the layout is null, and the input is none of the above, then it uses standard JAVA boolean parsing.
If the layout is passed, then it is assumed to have the true/false strings separated by a comma.
Parameters: input - the input. Parameters: layout - the layout. the parsed object. |
parseCurrency | public static Currency parseCurrency(String input) throws FormatCurrencyException(Code) | | Returns a Currency object corresponding to the input String.
It uses the default layout specified in the corrsponding meta class.
Parameters: input - the input. throws: FormatCurrencyException - if parsing fails. the parsed object. |
parseDateOnly | public static DateOnly parseDateOnly(String input) throws FormatDateOnlyException(Code) | | Returns a DateOnly object corresponding to the input String.
It uses the default layout specified in the corrsponding meta class.
Parameters: input - the input. throws: FormatDateOnlyException - if parsing fails. the parsed object. |
parseDateTime | public static DateTime parseDateTime(String input) throws FormatDateTimeException(Code) | | Returns a DateTime object corresponding to the input String.
It uses the default layout specified in the corrsponding meta class.
Parameters: input - the input. throws: FormatDateTimeException - if parsing fails. the parsed object. |
parseDecimal | public static Double parseDecimal(String input) throws FormatDecimalException(Code) | | Returns a Double object corresponding to the input String.
It uses the default layout specified in the corrsponding meta class.
Parameters: input - the input. throws: FormatDecimalException - if parsing fails. the parsed object. |
parseInteger | public static Long parseInteger(String input) throws FormatIntegerException(Code) | | Returns a Long object corresponding to the input String.
It uses the default layout specified in the corrsponding meta class.
Parameters: input - the input. throws: FormatIntegerException - if parsing fails. the parsed object. |
parseRaw | public static byte[] parseRaw(String input)(Code) | | Converts the input into an array of bytes
Parameters: input - the input. the input as an array of bytes. |
parseString | public static String parseString(String input)(Code) | | Just returns the String as is.
Parameters: input - the input. the String as is. |
|
|