public interface DateParser
DateFormat. You can obtain an object implementing this
interface by using one of the FastDateFormat factory methods.
Warning: Since binary compatible methods may be added to this interface in any release, developers are not expected to implement this interface.
| Modifier and Type | Method and Description |
|---|---|
java.util.Locale |
getLocale()
Gets the locale used by this parser.
|
java.lang.String |
getPattern()
Gets the pattern used by this parser.
|
java.util.TimeZone |
getTimeZone()
Gets the time zone used by this parser.
|
java.util.Date |
parse(java.lang.String source)
Equivalent to DateFormat.parse(String).
|
java.util.Date |
parse(java.lang.String source,
java.text.ParsePosition pos)
Equivalent to DateFormat.parse(String, ParsePosition).
|
boolean |
parse(java.lang.String source,
java.text.ParsePosition pos,
java.util.Calendar calendar)
Parses a formatted date string according to the format.
|
java.lang.Object |
parseObject(java.lang.String source)
Parses text from a string to produce a Date.
|
java.lang.Object |
parseObject(java.lang.String source,
java.text.ParsePosition pos)
Parses a date/time string according to the given parse position.
|
java.util.Date parse(java.lang.String source)
throws java.text.ParseException
DateFormat.parse(String) for more information.source - A String whose beginning should be parsed.Date parsed from the stringjava.text.ParseException - if the beginning of the specified string cannot be parsed.java.util.Date parse(java.lang.String source,
java.text.ParsePosition pos)
DateFormat.parse(String, ParsePosition) for more information.source - A String, part of which should be parsed.pos - A ParsePosition object with index and error index information
as described above.Date parsed from the string. In case of error, returns null.java.lang.NullPointerException - if text or pos is null.boolean parse(java.lang.String source,
java.text.ParsePosition pos,
java.util.Calendar calendar)
source - The text to parse.pos - On input, the position in the source to start parsing, on output, updated position.calendar - The calendar into which to set parsed fields.java.lang.IllegalArgumentException - when Calendar has been set to be not lenient, and a parsed field is
out of range.java.lang.String getPattern()
SimpleDateFormat compatiblejava.util.TimeZone getTimeZone()
The default TimeZone used to create a Date when the TimeZone is not specified by
the format pattern.
java.util.Locale getLocale()
java.lang.Object parseObject(java.lang.String source)
throws java.text.ParseException
source - A String whose beginning should be parsed.java.util.Date objectjava.text.ParseException - if the beginning of the specified string cannot be parsed.Format.parseObject(String)java.lang.Object parseObject(java.lang.String source,
java.text.ParsePosition pos)
source - A String whose beginning should be parsed.pos - the parse positionjava.util.Date objectDateFormat.parseObject(String, ParsePosition)Copyright © 2010 - 2023 Adobe. All Rights Reserved