Class DurationConverter
- java.lang.Object
-
- org.apache.myfaces.tobago.convert.DurationConverter
-
- All Implemented Interfaces:
javax.faces.convert.Converter
public class DurationConverter extends Object implements 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
Examples 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
Fields Modifier and Type Field Description static String
CONVERTER_ID
-
Constructor Summary
Constructors Constructor Description DurationConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getAsObject(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, String string)
String
getAsString(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, Object object)
-
-
-
Field Detail
-
CONVERTER_ID
public static final String CONVERTER_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
-
-