Package jakarta.faces.convert
Class DateTimeConverter
- java.lang.Object
- 
- jakarta.faces.convert.DateTimeConverter
 
- 
- All Implemented Interfaces:
- PartialStateHolder,- StateHolder,- Converter
 
 @JSFConverter(name="f:convertDateTime", bodyContent="empty") @JSFJspProperty(name="binding", returnType="jakarta.faces.convert.DateTimeConverter", longDesc="A ValueExpression that evaluates to a DateTimeConverter.") public class DateTimeConverter extends Object implements Converter, PartialStateHolderThis tag associates a date time converter with the nearest parent UIComponent. Unless otherwise specified, all attributes accept static values or EL expressions. see Javadoc of Faces Specification
- 
- 
Field SummaryFields Modifier and Type Field Description static StringCONVERTER_IDstatic StringDATE_IDstatic StringDATETIME_IDstatic StringSTRING_IDstatic StringTIME_ID- 
Fields inherited from interface jakarta.faces.convert.ConverterDATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE_PARAM_NAME
 
- 
 - 
Constructor SummaryConstructors Constructor Description DateTimeConverter()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearInitialState()ObjectgetAsObject(FacesContext facesContext, UIComponent uiComponent, String value)StringgetAsString(FacesContext facesContext, UIComponent uiComponent, Object value)StringgetDateStyle()The style of the date.LocalegetLocale()The name of the locale to be used, instead of the default.StringgetPattern()A custom Date formatting pattern, in the format used by java.text.SimpleDateFormat.StringgetTimeStyle()The style of the time.TimeZonegetTimeZone()The time zone to use instead of GMT (the default timezone).StringgetType()Specifies whether the date, time, or both should be parsed/formatted.booleaninitialStateMarked()booleanisTransient()voidmarkInitialState()voidrestoreState(FacesContext facesContext, Object state)ObjectsaveState(FacesContext facesContext)voidsetDateStyle(String dateStyle)voidsetLocale(Locale locale)voidsetPattern(String pattern)voidsetTimeStyle(String timeStyle)voidsetTimeZone(TimeZone timeZone)voidsetTransient(boolean aTransient)voidsetType(String type)
 
- 
- 
- 
Field Detail- 
CONVERTER_IDpublic static final String CONVERTER_ID - See Also:
- Constant Field Values
 
 - 
DATE_IDpublic static final String DATE_ID - See Also:
- Constant Field Values
 
 - 
DATETIME_IDpublic static final String DATETIME_ID - See Also:
- Constant Field Values
 
 - 
STRING_IDpublic static final String STRING_ID - See Also:
- Constant Field Values
 
 - 
TIME_IDpublic static final String TIME_ID - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getAsObjectpublic Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String value) - Specified by:
- getAsObjectin interface- Converter
 
 - 
getAsStringpublic String getAsString(FacesContext facesContext, UIComponent uiComponent, Object value) - Specified by:
- getAsStringin interface- Converter
 
 - 
restoreStatepublic void restoreState(FacesContext facesContext, Object state) - Specified by:
- restoreStatein interface- StateHolder
 
 - 
saveStatepublic Object saveState(FacesContext facesContext) - Specified by:
- saveStatein interface- StateHolder
 
 - 
getDateStyle@JSFProperty public String getDateStyle() The style of the date. Values include: default, short, medium, long, and full.
 - 
setDateStylepublic void setDateStyle(String dateStyle) 
 - 
getLocale@JSFProperty public Locale getLocale() The name of the locale to be used, instead of the default.
 - 
setLocalepublic void setLocale(Locale locale) 
 - 
getPattern@JSFProperty public String getPattern() A custom Date formatting pattern, in the format used by java.text.SimpleDateFormat.
 - 
setPatternpublic void setPattern(String pattern) 
 - 
getTimeStyle@JSFProperty public String getTimeStyle() The style of the time. Values include: default, short, medium, long, and full.
 - 
setTimeStylepublic void setTimeStyle(String timeStyle) 
 - 
getTimeZone@JSFProperty public TimeZone getTimeZone() The time zone to use instead of GMT (the default timezone). When this value is a value-binding to a TimeZone instance, that timezone is used. Otherwise this value is treated as a String containing a timezone id, ie as the ID parameter of method java.util.TimeZone.getTimeZone(String).
 - 
setTimeZonepublic void setTimeZone(TimeZone timeZone) 
 - 
isTransientpublic boolean isTransient() - Specified by:
- isTransientin interface- StateHolder
 
 - 
setTransientpublic void setTransient(boolean aTransient) - Specified by:
- setTransientin interface- StateHolder
 
 - 
getType@JSFProperty public String getType() Specifies whether the date, time, or both should be parsed/formatted. Valid values are: "date", "time", "both", "localDate", "localDateTime", "localTime", "offsetTime", "offsetDateTime", and "zonedDateTime". The prefixes "local", "offset", "zoned" are used, when the type of the value is one of the corresponding Java 8 Date Time API classes. Default is "date".
 - 
setTypepublic void setType(String type) 
 - 
clearInitialStatepublic void clearInitialState() - Specified by:
- clearInitialStatein interface- PartialStateHolder
 
 - 
initialStateMarkedpublic boolean initialStateMarked() - Specified by:
- initialStateMarkedin interface- PartialStateHolder
 
 - 
markInitialStatepublic void markInitialState() - Specified by:
- markInitialStatein interface- PartialStateHolder
 
 
- 
 
-