javax.faces.convert
Class DateTimeConverter

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

public class DateTimeConverter
extends Object
implements Converter, StateHolder

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: 676278 $ $Date: 2008-07-13 03:35:04 -0500 (Sun, 13 Jul 2008) $
Author:
Thomas Spiegl (latest modification by $Author: skitching $)

Field Summary
static String CONVERTER_ID
           
 
Constructor Summary
DateTimeConverter()
           
 
Method Summary
 Object getAsObject(FacesContext context, UIComponent component, String value)
           
 String getAsString(FacesContext context, UIComponent component, 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 isTransient()
           
 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
Constructor Detail

DateTimeConverter

public DateTimeConverter()
Method Detail

getAsObject

public Object getAsObject(FacesContext context,
                          UIComponent component,
                          String value)
                   throws ConverterException
Specified by:
getAsObject in interface Converter
Throws:
ConverterException

getAsString

public String getAsString(FacesContext context,
                          UIComponent component,
                          Object value)
                   throws ConverterException
Specified by:
getAsString in interface Converter
Throws:
ConverterException

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

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


setDateStyle

public void setDateStyle(String dateStyle)

getLocale

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


setLocale

public void setLocale(Locale locale)

getPattern

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


setPattern

public void setPattern(String pattern)

getTimeStyle

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


setTimeStyle

public void setTimeStyle(String timeStyle)

getTimeZone

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

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)


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