|
Novell exteNd Director 5.2 API |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.sssw.fw.util.EboParse
The EboParse class provides static methods to perform parsing of the strings representing long, double, date, time and timestamp objects. It tries to "intelligently" parse the string - if the specified style or pattern doesn't work, we try a list of our own common styles and patterns.
Note that expontial notation is not currently supported for BigDecimals.
| Field Summary | |
static int |
TYPE_BIGDECIMAL
The big decimal type value for the type parameter of the parse methods. |
static int |
TYPE_DATE
The date type value for the type parameter of the parse methods. |
static int |
TYPE_DOUBLE
The double type value for the type parameter of the parse methods. |
static int |
TYPE_INT
The integer type value for the type parameter of the parse methods. |
static int |
TYPE_LONG
The long type value for the type parameter of the parse methods. |
static int |
TYPE_TIME
The time type value for the type parameter of the parse methods. |
static int |
TYPE_TIMESTAMP
The timestamp type value for the type parameter of the parse methods. |
| Constructor Summary | |
EboParse()
|
|
| Method Summary | |
static void |
allow2DigitYears(boolean allow2DigitYears)
Turns on or off the ability to enter years from 1 to 99. |
static int |
get2DigitYearWindow()
Gets the 2-digit year "sliding window" value, which determines how 2-digit years are parsed |
static Object |
parse(int type,
String parseStr,
String pattern)
Parses a string and produces respective object, e.g. |
static Object |
parse(int type,
String parseStr,
String pattern,
int style)
Parses a string and produces respective object |
static Object |
parse(int type,
String parseStr,
String pattern,
int timeStyle,
int dateStyle)
Parses a string and produces respective object |
static Object |
parse(int type,
String parseStr,
String pattern,
int style1,
int style2,
Locale locale,
String zoneStr)
Parses a string and produces respective object |
static Object |
parse(int type,
String parseStr,
String pattern,
int style1,
int style2,
String lang,
String country,
String variant,
String zoneStr)
Parses a string and produces respective object |
static void |
set2DigitYearWindow(int value)
Sets the 2-digit year "sliding window" value, which determines how 2-digit years are parsed. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static final int TYPE_INT
public static final int TYPE_LONG
public static final int TYPE_DOUBLE
public static final int TYPE_DATE
public static final int TYPE_TIME
public static final int TYPE_TIMESTAMP
public static final int TYPE_BIGDECIMAL
| Constructor Detail |
public EboParse()
| Method Detail |
public static Object parse(int type,
String parseStr,
String pattern)
throws IllegalArgumentException
Timestamp ts = (Timestamp)EboParse.parse(EboParse.TYPE_TIMESTAMP,
"1992-10-10 20:20:20 PST", "yyyy-MM-dd hh:mm:ss z");
type - the data type to parse out of the stringparseStr - the string to parsepattern - string's pattern
public static Object parse(int type,
String parseStr,
String pattern,
int style)
throws IllegalArgumentException
type - the data type to parse out of the stringparseStr - the string to parsepattern - describes the pattern of the data contained in the string,
overrides the default patternstyle - overrides the default style
public static Object parse(int type,
String parseStr,
String pattern,
int timeStyle,
int dateStyle)
throws IllegalArgumentException
type - the type of data contained in the stringparseStr - the string to parsepattern - overrides default patterntimeStyle - overrides default style for timedateStyle - overrides default style for date
public static Object parse(int type,
String parseStr,
String pattern,
int style1,
int style2,
String lang,
String country,
String variant,
String zoneStr)
throws IllegalArgumentException
type - the type of the data contained in the stringparseStr - the string to parsepattern - overrides default patternstyle1 - overrides default style for timestyle2 - overrides default style for datelang - overrides default language (part of Locale)country - overrides default country (part of Locale)variant - overrides default variant (part of Locale)zoneStr - overrides default time zone
public static Object parse(int type,
String parseStr,
String pattern,
int style1,
int style2,
Locale locale,
String zoneStr)
throws IllegalArgumentException
type - the type to parse out of the stringparseStr - the string to parsepattern - describes the pattern of the datastyle1 - overrides default style for timestyle2 - overrides default style for datelocale - overrides default localezoneStr - overrides default time zonepublic static void allow2DigitYears(boolean allow2DigitYears)
set2DigitYearWindow method).allow2DigitYears - if true, 2-digit years are allowedpublic static void set2DigitYearWindow(int value)
For example, if the window value is 50 (the default), then:
To turn windowing off, so that all 2-digit years are interpreted as 20th-centry dates, set this value to zero.
Note that if the user enters a 4-digit year, this window value is ignored, and the year is always parsed correctly.
value - the 2-digit year "sliding window" valuepublic static int get2DigitYearWindow()
EboParse.set2DigitYearWindow(int)
|
Novell exteNd Director 5.2 API |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||