|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.faces.convert.DateTimeConverter com.ibm.xsp.convert.DateTimeConverter
public class DateTimeConverter
The xp:convertDateTime
tag extends the standard date time converter to use the ICU library.
Not intended to be subclassed.
Field Summary | |
---|---|
static java.lang.String |
CONVERTER_ID
The converter id for this converter. |
static java.lang.String |
TYPE_BOTH
The "both date and time" value of the type property. |
static java.lang.String |
TYPE_DATE
The date-only value of the type property. |
static java.lang.String |
TYPE_TIME
The time-only value of the type property. |
Constructor Summary | |
---|---|
DateTimeConverter()
|
Method Summary | |
---|---|
protected java.lang.Object |
createDateOnlyFormat(java.util.Locale locale,
int dateStyleInt)
Return date for locale given the dateStyleInt |
protected java.lang.Object |
createDateTimeFormat(java.util.Locale locale,
int dateStyleInt,
int timeStyleInt)
Return date/time for locale give the dateStyleInt and timeStyleInt |
protected java.lang.String |
createFormatKey(boolean date,
boolean time)
Constructs an apostrophe delimited string given DateTimeConverter.getPattern() , date, time, locale and timezone |
protected java.lang.Object |
createPatternFormat(java.util.Locale locale,
java.lang.String pattern)
Return SimpleDateFormat for locale with pattern |
protected java.lang.Object |
createTimeOnlyFormat(java.util.Locale locale,
int timeStyleInt)
Return time for locale given the timeStyleInt |
protected java.lang.Object |
findDateFormat(javax.faces.context.FacesContext context,
boolean date,
boolean time)
Return date and / or time format for given context |
protected java.lang.String |
format(java.lang.Object dateFormat,
java.util.Date dateValue)
Return dateValue as a String in dateFormat |
java.lang.String |
generateClientSideConverter(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Return string depending on value of DateTimeConverter.getType()
Otherwise, null if no type is set |
java.lang.Object |
getAsObject(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.lang.String value)
Return value as an object |
java.lang.String |
getAsString(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.lang.Object value)
Return value as a string. |
java.lang.String |
getBothDatePattern(javax.faces.context.FacesContext context)
Return the pattern for formatting and parsing a date string. |
java.lang.String |
getBothTimePattern(javax.faces.context.FacesContext context)
Return the pattern for formatting and parsing a time string. |
protected java.lang.Object |
getCachedFormat(java.lang.String key)
Look for the cached date/time format |
java.lang.String |
getDatePattern(javax.faces.context.FacesContext context)
Return the pattern for formatting and parsing a date string. |
protected java.util.Locale |
getDefaultLocale()
Return the Locale of the root component for the current FacesContext instance. |
protected java.util.TimeZone |
getDefaultTimeZone()
Return the user time zone if possible. |
static SystemCache |
getICUDateFormats()
Not intended to be used by 3rd parties, only by the XPages runtime. |
com.ibm.icu.util.TimeZone |
getICUTimeZone()
Return the TimeZone as an ICU TimeZone |
java.util.Locale |
getLocale()
Return the Locale set using setLocale(Locale) . |
java.lang.String |
getTimePattern(javax.faces.context.FacesContext context)
Return the pattern for formatting and parsing a time string. |
java.util.TimeZone |
getTimeZone()
Return the TimeZone set using setTimeZone(TimeZone) . |
protected void |
initFormat(java.lang.Object dateFormatObj)
Initialize dateFormatObj with ICU time zone |
boolean |
isDatePatternSet()
Return true if a pattern has been set using setPattern(String) . |
boolean |
isIgnoreUserTimeZone()
Return true if this has been set using setIgnoreUserTimeZone(boolean) |
protected java.util.Date |
parse(java.lang.Object dateFormat,
java.lang.String value)
Return value as a Date object in dateFormat |
protected void |
putCachedFormat(java.lang.String key,
java.lang.Object format)
Add the cached date format |
void |
restoreState(javax.faces.context.FacesContext context,
java.lang.Object state)
|
java.lang.Object |
saveState(javax.faces.context.FacesContext context)
|
void |
setIgnoreUserTimeZone(boolean ignoreUserTimeZone)
Specify whether the user time zone should be ignored. |
void |
setLocale(java.util.Locale locale)
Specifies a locale to use when formatting and parsing styles for dates and times. |
void |
setPattern(java.lang.String pattern)
Specifies a pattern for formatting and parsing the date and time string. |
void |
setTimeZone(java.util.TimeZone timeZone)
Specifies a time zone to use when formatting and parsing styles for dates and times. |
protected java.lang.String |
toPattern(java.lang.Object dateFormat)
Return date/time as string in dateFormat |
Methods inherited from class javax.faces.convert.DateTimeConverter |
---|
getDateStyle, getPattern, getTimeStyle, getType, isTransient, setDateStyle, setTimeStyle, setTransient, setType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CONVERTER_ID
public static final java.lang.String TYPE_DATE
DateTimeConverter.getType()
, this indicates that only the date is used, not the
time portion of the Date object
public static final java.lang.String TYPE_TIME
DateTimeConverter.getType()
, this indicates that only the time is used, not the
date portion of the Date object
public static final java.lang.String TYPE_BOTH
DateTimeConverter.getType()
, this indicates that both the date and the
time are used from the Date object.
Constructor Detail |
---|
public DateTimeConverter()
Method Detail |
---|
public static SystemCache getICUDateFormats()
public java.util.Locale getLocale()
setLocale(Locale)
.
Otherwise, the default Locale is returned.
getLocale
in class javax.faces.convert.DateTimeConverter
protected java.util.Locale getDefaultLocale()
public void setLocale(java.util.Locale locale)
setLocale
in class javax.faces.convert.DateTimeConverter
public void setPattern(java.lang.String pattern)
setPattern
in class javax.faces.convert.DateTimeConverter
public java.util.TimeZone getTimeZone()
setTimeZone(TimeZone)
.
Otherwise, the default TimeZone is returned.
getTimeZone
in class javax.faces.convert.DateTimeConverter
public void setTimeZone(java.util.TimeZone timeZone)
setTimeZone
in class javax.faces.convert.DateTimeConverter
public com.ibm.icu.util.TimeZone getICUTimeZone()
protected java.util.TimeZone getDefaultTimeZone()
public boolean isDatePatternSet()
setPattern(String)
.
public java.lang.String getDatePattern(javax.faces.context.FacesContext context)
public java.lang.String getTimePattern(javax.faces.context.FacesContext context)
public java.lang.String getBothDatePattern(javax.faces.context.FacesContext context)
public java.lang.String getBothTimePattern(javax.faces.context.FacesContext context)
public boolean isIgnoreUserTimeZone()
setIgnoreUserTimeZone(boolean)
public void setIgnoreUserTimeZone(boolean ignoreUserTimeZone)
public java.lang.String getAsString(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.Object value)
getAsString
in interface javax.faces.convert.Converter
getAsString
in class javax.faces.convert.DateTimeConverter
public java.lang.Object getAsObject(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.String value)
getAsObject
in interface javax.faces.convert.Converter
getAsObject
in class javax.faces.convert.DateTimeConverter
protected java.lang.String createFormatKey(boolean date, boolean time)
DateTimeConverter.getPattern()
, date, time, locale and timezone
protected java.lang.Object getCachedFormat(java.lang.String key)
protected void putCachedFormat(java.lang.String key, java.lang.Object format)
protected java.lang.Object findDateFormat(javax.faces.context.FacesContext context, boolean date, boolean time)
public void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
restoreState
in interface javax.faces.component.StateHolder
restoreState
in class javax.faces.convert.DateTimeConverter
public java.lang.Object saveState(javax.faces.context.FacesContext context)
saveState
in interface javax.faces.component.StateHolder
saveState
in class javax.faces.convert.DateTimeConverter
protected java.lang.String toPattern(java.lang.Object dateFormat)
protected java.lang.Object createDateOnlyFormat(java.util.Locale locale, int dateStyleInt)
protected java.lang.Object createTimeOnlyFormat(java.util.Locale locale, int timeStyleInt)
protected java.lang.Object createDateTimeFormat(java.util.Locale locale, int dateStyleInt, int timeStyleInt)
protected java.lang.Object createPatternFormat(java.util.Locale locale, java.lang.String pattern)
protected void initFormat(java.lang.Object dateFormatObj)
protected java.util.Date parse(java.lang.Object dateFormat, java.lang.String value) throws java.text.ParseException
java.text.ParseException
protected java.lang.String format(java.lang.Object dateFormat, java.util.Date dateValue)
public java.lang.String generateClientSideConverter(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws java.io.IOException
DateTimeConverter.getType()
Otherwise, null if no type is set
generateClientSideConverter
in interface ClientSideConverter
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |