Home » Mojarra-2.0.1 » javax » faces » convert » [javadoc | source]
javax.faces.convert
public class: DateTimeConverter [javadoc | source]
java.lang.Object
   javax.faces.convert.DateTimeConverter

All Implemented Interfaces:
    PartialStateHolder, Converter

Converter implementation for java.util.Date values.

The getAsObject() method parses a String into a java.util.Date, according to the following algorithm:

The getAsString() method expects a value of type java.util.Date (or a subclass), and creates a formatted String according to the following algorithm:

Field Summary
public static final  String CONVERTER_ID   

The standard converter id for this converter.

 
public static final  String DATE_ID   

The message identifier of the javax.faces.application.FacesMessage to be created if the conversion to Date fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the unconverted value.
  • {1} replaced by an example value.
  • {2} replaced by a String whose value is the label of the input component that produced this message.

 
public static final  String TIME_ID   

The message identifier of the javax.faces.application.FacesMessage to be created if the conversion to Time fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the unconverted value.
  • {1} replaced by an example value.
  • {2} replaced by a String whose value is the label of the input component that produced this message.

 
public static final  String DATETIME_ID   

The message identifier of the javax.faces.application.FacesMessage to be created if the conversion to DateTime fails. The message format string for this message may optionally include the following placeholders:

  • {0} replaced by the unconverted value.
  • {1} replaced by an example value.
  • {2} replaced by a String whose value is the label of the input component that produced this message.

 
public static final  String STRING_ID   

The message identifier of the javax.faces.application.FacesMessage to be created if the conversion of the DateTime value to String fails. The message format string for this message may optionally include the following placeholders:

  • {0} relaced by the unconverted value.
  • {1} replaced by a String whose value is the label of the input component that produced this message.

 
Method from javax.faces.convert.DateTimeConverter Summary:
clearInitialState,   getAsObject,   getAsString,   getDateStyle,   getLocale,   getPattern,   getTimeStyle,   getTimeZone,   getType,   initialStateMarked,   isTransient,   markInitialState,   restoreState,   saveState,   setDateStyle,   setLocale,   setPattern,   setTimeStyle,   setTimeZone,   setTransient,   setType
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.faces.convert.DateTimeConverter Detail:
 public  void clearInitialState() 
 public Object getAsObject(FacesContext context,
    UIComponent component,
    String value) 
 public String getAsString(FacesContext context,
    UIComponent component,
    Object value) 
 public String getDateStyle() 

    Return the style to be used to format or parse dates. If not set, the default value, default, is returned.

 public Locale getLocale() 

    Return the Locale to be used when parsing or formatting dates and times. If not explicitly set, the Locale stored in the javax.faces.component.UIViewRoot for the current request is returned.

 public String getPattern() 

    Return the format pattern to be used when formatting and parsing dates and times.

 public String getTimeStyle() 

    Return the style to be used to format or parse times. If not set, the default value, default, is returned.

 public TimeZone getTimeZone() 

    Return the TimeZone used to interpret a time value. If not explicitly set, the default time zone of GMT returned.

 public String getType() 

    Return the type of value to be formatted or parsed. If not explicitly set, the default type, date is returned.

 public boolean initialStateMarked() 
 public boolean isTransient() 
 public  void markInitialState() 
 public  void restoreState(FacesContext context,
    Object state) 
 public Object saveState(FacesContext context) 
 public  void setDateStyle(String dateStyle) 

    Set the style to be used to format or parse dates. Valid values are default, short, medium, long, and full. An invalid value will cause a ConverterException when getAsObject() or getAsString() is called.

 public  void setLocale(Locale locale) 

    Set the Locale to be used when parsing or formatting dates and times. If set to null, the Locale stored in the javax.faces.component.UIViewRoot for the current request will be utilized.

 public  void setPattern(String pattern) 

    Set the format pattern to be used when formatting and parsing dates and times. Valid values are those supported by java.text.SimpleDateFormat. An invalid value will cause a ConverterException when getAsObject() or getAsString() is called.

 public  void setTimeStyle(String timeStyle) 

    Set the style to be used to format or parse times. Valid values are default, short, medium, long, and full. An invalid value will cause a ConverterException when getAsObject() or getAsString() is called.

 public  void setTimeZone(TimeZone timeZone) 

    Set the TimeZone used to interpret a time value.

 public  void setTransient(boolean transientFlag) 
 public  void setType(String type) 

    Set the type of value to be formatted or parsed. Valid values are both, date, or time. An invalid value will cause a ConverterException when getAsObject() or getAsString() is called.