|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.datatypes.DateTimePattern
public class DateTimePattern
This is a bit like SimpleDateFormat, because it accepts the same pattern String. It can also
parse the String though (see 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.
| Nested Class Summary | |
|---|---|
static class |
DateTimePattern.Element
A wrapper arround a field in a Calendar object. |
| Field Summary | |
|---|---|
static DateTimePattern |
DEFAULT
|
protected LocalizedString |
pattern
|
| Constructor Summary | |
|---|---|
DateTimePattern(String pattern)
|
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final DateTimePattern DEFAULT
protected LocalizedString pattern
| Constructor Detail |
|---|
public DateTimePattern(String pattern)
| Method Detail |
|---|
public void set(String pattern,
Locale locale)
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 Object clone()
clone in class Objectpublic String toString()
toString in class Objectpublic static void main(String[] argv)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||