Class DurationConverter
java.lang.Object
org.apache.myfaces.tobago.convert.DurationConverter
- All Implemented Interfaces:
javax.faces.convert.Converter
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
input string | unit | resulting long in model | Remark |
---|---|---|---|
1:15 | milli | 75000 | |
1:15:00 | hour | 1 | Loosing 15 Minutes! |
1:15:00 | null | 4500000 |
-
Field Summary
FieldsFields inherited from interface javax.faces.convert.Converter
DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE_PARAM_NAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAsObject
(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, String string) getAsString
(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, Object object)
-
Field Details
-
CONVERTER_ID
- See Also:
-
-
Constructor Details
-
DurationConverter
public DurationConverter()
-
-
Method Details
-
getAsString
public String getAsString(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, Object object) throws javax.faces.convert.ConverterException - Specified by:
getAsString
in interfacejavax.faces.convert.Converter
- Throws:
javax.faces.convert.ConverterException
-
getAsObject
public Object getAsObject(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, String string) throws javax.faces.convert.ConverterException - Specified by:
getAsObject
in interfacejavax.faces.convert.Converter
- Throws:
javax.faces.convert.ConverterException
-