Interface Converter<T>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE_PARAM_NAME
      If this param is set, and calling toLowerCase().equals("true") on a String representation of its value returns true, Application.createConverter() must guarantee that the default for the timezone of all jakarta.faces.convert.DateTimeConverter instances must be equal to TimeZone.getDefault() instead of "GMT".
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      T getAsObject​(FacesContext context, UIComponent component, String value)
      Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Process Validations phase of the request processing lifecycle.
      String getAsString​(FacesContext context, UIComponent component, T value)
      Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.
    • Field Detail

      • DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE_PARAM_NAME

        static final String DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE_PARAM_NAME

        If this param is set, and calling toLowerCase().equals("true") on a String representation of its value returns true, Application.createConverter() must guarantee that the default for the timezone of all jakarta.faces.convert.DateTimeConverter instances must be equal to TimeZone.getDefault() instead of "GMT".

        Since:
        2.0
        See Also:
        Constant Field Values
    • Method Detail

      • getAsObject

        T getAsObject​(FacesContext context,
                      UIComponent component,
                      String value)

        Convert the specified string value, which is associated with the specified UIComponent, into a model data object that is appropriate for being stored during the Process Validations phase of the request processing lifecycle.

        Parameters:
        context - FacesContext for the request being processed
        component - UIComponent with which this model object value is associated
        value - String value to be converted (may be null)
        Returns:
        null if the value to convert is null, otherwise the result of the conversion
        Throws:
        ConverterException - if conversion cannot be successfully performed
        NullPointerException - if context or component is null
      • getAsString

        String getAsString​(FacesContext context,
                           UIComponent component,
                           T value)

        Convert the specified model object value, which is associated with the specified UIComponent, into a String that is suitable for being included in the response generated during the Render Response phase of the request processing lifeycle.

        Parameters:
        context - FacesContext for the request being processed
        component - UIComponent with which this model object value is associated
        value - Model object value to be converted (may be null)
        Returns:
        a zero-length String if value is null, otherwise the result of the conversion
        Throws:
        ConverterException - if conversion cannot be successfully performed
        NullPointerException - if context or component is null