Package org.zkoss.bind.converter.sys
Class FormattedTemporalConverter<T extends java.time.temporal.TemporalAccessor>
- java.lang.Object
-
- org.zkoss.bind.converter.sys.FormattedTemporalConverter<T>
-
public class FormattedTemporalConverter<T extends java.time.temporal.TemporalAccessor> extends java.lang.Object implements Converter<java.lang.String,T,Component>, java.io.Serializable
Converter to convert String to Temporal object.- Since:
- 9.0.0
- Author:
- rudyhuang
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.zkoss.bind.Converter
IGNORED_VALUE
-
-
Constructor Summary
Constructors Constructor Description FormattedTemporalConverter(java.time.temporal.TemporalQuery<T> parseTo)
Construct with a parseTo method.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
coerceToBean(java.lang.String compAttr, Component component, BindContext ctx)
Convert String to Temporal.java.lang.String
coerceToUi(T beanProp, Component component, BindContext ctx)
Convert Temporal to String.
-
-
-
Constructor Detail
-
FormattedTemporalConverter
public FormattedTemporalConverter(java.time.temporal.TemporalQuery<T> parseTo)
Construct with a parseTo method.- Parameters:
parseTo
- Temporal method parsed to
-
-
Method Detail
-
coerceToUi
public java.lang.String coerceToUi(T beanProp, Component component, BindContext ctx)
Convert Temporal to String.- Specified by:
coerceToUi
in interfaceConverter<java.lang.String,T extends java.time.temporal.TemporalAccessor,Component>
- Parameters:
beanProp
- temporal to be convertedcomponent
- associated componentctx
- bind context for associateBinding
and extra parameter (e.g. format)- Returns:
- the converted temporal as String
-
coerceToBean
public T coerceToBean(java.lang.String compAttr, Component component, BindContext ctx)
Convert String to Temporal.- Specified by:
coerceToBean
in interfaceConverter<java.lang.String,T extends java.time.temporal.TemporalAccessor,Component>
- Parameters:
compAttr
- temporal in string formcomponent
- associated componentctx
- bind context for associateBinding
and extra parameter (e.g. format)- Returns:
- the converted Temporal
-
-