javax.faces.convert
Class DateTimeConverter

java.lang.Object
  extended by javax.faces.convert.DateTimeConverter
All Implemented Interfaces:
PartialStateHolder, StateHolder, Converter

@JSFConverter(name="f:convertDateTime",
              bodyContent="empty",
              tagClass="org.apache.myfaces.taglib.core.ConvertDateTimeTag")
@JSFJspProperty(name="binding",
                returnType="javax.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 JSF Specification

Version:
$Revision: 1188415 $ $Date: 2011-10-24 17:13:21 -0500 (Mon, 24 Oct 2011) $
Author:
Thomas Spiegl (latest modification by $Author: struberg $)

Field Summary
static String CONVERTER_ID
           
static String DATE_ID
           
static String DATETIME_ID
           
static String STRING_ID
           
static String TIME_ID
           
 
Constructor Summary
DateTimeConverter()
           
 
Method Summary
 void clearInitialState()
           
 Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String value)
           
 String getAsString(FacesContext facesContext, UIComponent uiComponent, Object value)
           
 String getDateStyle()
          The style of the date.
 Locale getLocale()
          The name of the locale to be used, instead of the default.
 String getPattern()
          A custom Date formatting pattern, in the format used by java.text.SimpleDateFormat.
 String getTimeStyle()
          The style of the time.
 TimeZone getTimeZone()
          The time zone to use instead of GMT (the default timezone).
 String getType()
          Specifies whether the date, time, or both should be parsed/formatted.
 boolean initialStateMarked()
           
 boolean isTransient()
           
 void markInitialState()
           
 void restoreState(FacesContext facesContext, Object state)
           
 Object saveState(FacesContext facesContext)
           
 void setDateStyle(String dateStyle)
           
 void setLocale(Locale locale)
           
 void setPattern(String pattern)
           
 void setTimeStyle(String timeStyle)
           
 void setTimeZone(TimeZone timeZone)
           
 void setTransient(boolean aTransient)
           
 void setType(String type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONVERTER_ID

public static final String CONVERTER_ID
See Also:
Constant Field Values

DATE_ID

public static final String DATE_ID
See Also:
Constant Field Values

DATETIME_ID

public static final String DATETIME_ID
See Also:
Constant Field Values

STRING_ID

public static final String STRING_ID
See Also:
Constant Field Values

TIME_ID

public static final String TIME_ID
See Also:
Constant Field Values
Constructor Detail

DateTimeConverter

public DateTimeConverter()
Method Detail

getAsObject

public Object getAsObject(FacesContext facesContext,
                          UIComponent uiComponent,
                          String value)
Specified by:
getAsObject in interface Converter

getAsString

public String getAsString(FacesContext facesContext,
                          UIComponent uiComponent,
                          Object value)
Specified by:
getAsString in interface Converter

restoreState

public void restoreState(FacesContext facesContext,
                         Object state)
Specified by:
restoreState in interface StateHolder

saveState

public Object saveState(FacesContext facesContext)
Specified by:
saveState in interface StateHolder

getDateStyle

@JSFProperty
public String getDateStyle()
The style of the date. Values include: default, short, medium, long, and full.


setDateStyle

public void setDateStyle(String dateStyle)

getLocale

@JSFProperty
public Locale getLocale()
The name of the locale to be used, instead of the default.


setLocale

public void setLocale(Locale locale)

getPattern

@JSFProperty
public String getPattern()
A custom Date formatting pattern, in the format used by java.text.SimpleDateFormat.


setPattern

public void setPattern(String pattern)

getTimeStyle

@JSFProperty
public String getTimeStyle()
The style of the time. Values include: default, short, medium, long, and full.


setTimeStyle

public 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).


setTimeZone

public void setTimeZone(TimeZone timeZone)

isTransient

public boolean isTransient()
Specified by:
isTransient in interface StateHolder

setTransient

public void setTransient(boolean aTransient)
Specified by:
setTransient in interface StateHolder

getType

@JSFProperty
public String getType()
Specifies whether the date, time, or both should be parsed/formatted. Values include: date, time, and both. Default based on setting of timeStyle and dateStyle.


setType

public void setType(String type)

clearInitialState

public void clearInitialState()
Specified by:
clearInitialState in interface PartialStateHolder

initialStateMarked

public boolean initialStateMarked()
Specified by:
initialStateMarked in interface PartialStateHolder

markInitialState

public void markInitialState()
Specified by:
markInitialState in interface PartialStateHolder


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.