public class DateTimePattern extends Object implements Cloneable, Serializable
getList(java.util.Locale)), which can be used to do something else
for parsing or formatting (think: format an editor entry).
This utility class is of course used in the implementation of DateTimeDataType.| Modifier and Type | Class and Description |
|---|---|
static class |
DateTimePattern.Element
A wrapper arround a field in a
Calendar object. |
| Modifier and Type | Field and Description |
|---|---|
static DateTimePattern |
DEFAULT |
protected LocalizedString |
pattern |
| Constructor and Description |
|---|
DateTimePattern(String pattern) |
| Modifier and Type | Method and Description |
|---|---|
Object |
clone() |
DateFormat |
getDateFormat(Locale locale)
Returns a DateFormat object associated with this object.
|
static DateTimePattern.Element |
getElement(char c,
Calendar minDate,
Calendar maxDate)
Returns an
DateTimePattern.Element structure assiocated with the characters of the format
pattern. |
List<String> |
getList(Locale locale)
Returns the pattern 'parsed'.
|
LocalizedString |
getPattern()
Returns the original pattern, which can e.g.
|
static void |
main(String[] argv) |
void |
set(String pattern) |
void |
set(String pattern,
Locale locale) |
String |
toString() |
public static final DateTimePattern DEFAULT
protected LocalizedString pattern
public DateTimePattern(String pattern)
public void set(String pattern)
public DateFormat getDateFormat(Locale locale)
public LocalizedString getPattern()
getDateFormat(java.util.Locale).public List<String> getList(Locale locale)
public static DateTimePattern.Element getElement(char c, Calendar minDate, Calendar maxDate)
DateTimePattern.Element structure assiocated with the characters of the format
pattern. This utility function can be usefull when generating drop-downs based on the result
of getList(java.util.Locale).c - The pattern character. 'y', 'M', 'd', 'H', 'K', 'h', 'k', 'm', 's', 'E', 'w', 'D', 'F', 'G', 'a', or 'S'. Also u is recognized (as in the ICU version of SimpleDateFormat), for years which can also be negative (targeted at GregorianCalendar with 2 era's)minDate - If for example the parameter is 'y' then the 'getMin' property of the result
Element will be the year of this date.maxDate - If for example the parameter is 'y' then the 'getMax' property of the result
Element will be the year of this date.public static void main(String[] argv)
MMBase 1.9-SNAPSHOT - ${javadoctimestamp}