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, PartialStateHolder
This 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 SummaryFieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface jakarta.faces.convert.ConverterDATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE_PARAM_NAME
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidgetAsObject(FacesContext facesContext, UIComponent uiComponent, String value) getAsString(FacesContext facesContext, UIComponent uiComponent, Object value) The style of the date.The name of the locale to be used, instead of the default.A custom Date formatting pattern, in the format used by java.text.SimpleDateFormat.The style of the time.The time zone to use instead of GMT (the default timezone).getType()Specifies whether the date, time, or both should be parsed/formatted.booleanbooleanvoidvoidrestoreState(FacesContext facesContext, Object state) saveState(FacesContext facesContext) voidsetDateStyle(String dateStyle) voidvoidsetPattern(String pattern) voidsetTimeStyle(String timeStyle) voidsetTimeZone(TimeZone timeZone) voidsetTransient(boolean aTransient) void
- 
Field Details- 
CONVERTER_ID- See Also:
 
- 
DATE_ID- See Also:
 
- 
DATETIME_ID- See Also:
 
- 
STRING_ID- See Also:
 
- 
TIME_ID- See Also:
 
 
- 
- 
Constructor Details- 
DateTimeConverterpublic DateTimeConverter()
 
- 
- 
Method Details- 
getAsObject- Specified by:
- getAsObjectin interface- Converter
 
- 
getAsString- Specified by:
- getAsStringin interface- Converter
 
- 
restoreState- Specified by:
- restoreStatein interface- StateHolder
 
- 
saveState- Specified by:
- saveStatein interface- StateHolder
 
- 
getDateStyleThe style of the date. Values include: default, short, medium, long, and full.
- 
setDateStyle
- 
getLocaleThe name of the locale to be used, instead of the default.
- 
setLocale
- 
getPatternA custom Date formatting pattern, in the format used by java.text.SimpleDateFormat.
- 
setPattern
- 
getTimeStyleThe style of the time. Values include: default, short, medium, long, and full.
- 
setTimeStyle
- 
getTimeZoneThe 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).
- 
setTimeZone
- 
isTransientpublic boolean isTransient()- Specified by:
- isTransientin interface- StateHolder
 
- 
setTransientpublic void setTransient(boolean aTransient) - Specified by:
- setTransientin interface- StateHolder
 
- 
getTypeSpecifies 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".
- 
setType
- 
clearInitialStatepublic void clearInitialState()- Specified by:
- clearInitialStatein interface- PartialStateHolder
 
- 
initialStateMarkedpublic boolean initialStateMarked()- Specified by:
- initialStateMarkedin interface- PartialStateHolder
 
- 
markInitialStatepublic void markInitialState()- Specified by:
- markInitialStatein interface- PartialStateHolder
 
 
-