Class DurationConverter

java.lang.Object
org.apache.myfaces.tobago.convert.DurationConverter

public class DurationConverter extends Object
Converts durations. The duration value in the model is of type long. The string format must have one of this patterns:
  • hh:MM:ss
  • MM:ss
  • ss
There may be an optional attribute "unit" in the component, which allows to set the unit of the model. The default unit is "millis".
Examples
input stringunitresulting long in modelRemark
1:15milli75000
1:15:00hour1Loosing 15 Minutes!
1:15:00null4500000
  • Field Details

    • CONVERTER_ID

      public static final String CONVERTER_ID
      See Also:
    • DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE_PARAM_NAME

      static final String DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE_PARAM_NAME
      See Also:
  • Constructor Details

    • DurationConverter

      public DurationConverter()
  • Method Details

    • getAsString

      public String getAsString(jakarta.faces.context.FacesContext facesContext, jakarta.faces.component.UIComponent component, Object object) throws jakarta.faces.convert.ConverterException
      Throws:
      jakarta.faces.convert.ConverterException
    • getAsObject

      public Object getAsObject(jakarta.faces.context.FacesContext facesContext, jakarta.faces.component.UIComponent component, String string) throws jakarta.faces.convert.ConverterException
      Throws:
      jakarta.faces.convert.ConverterException