Class JavaDateTimeBundle
- java.lang.Object
-
- com.oracle.coherence.io.json.genson.ext.GensonBundle
-
- com.oracle.coherence.io.json.genson.datetime.JavaDateTimeBundle
-
public class JavaDateTimeBundle extends GensonBundle
Provides support for Java 8 Date & Time API (JSR 310).
-
-
Constructor Summary
Constructors Constructor Description JavaDateTimeBundle()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(GensonBuilder builder)This method does not provide any guarantee to when it is called: before user config, during, or after.JavaDateTimeBundlesetFormatter(Class<? extends TemporalAccessor> clazz, DateTimeFormatter formatter)Sets theDateTimeFormatterto use when parsing/formatting a value of the provided class.JavaDateTimeBundlesetTemporalAccessorTimestampFormat(Class<? extends TemporalAccessor> clazz, TimestampFormat format)TheTimestampFormatto use when serializing/deserializing aTemporalAccessorvalue of the provided class.JavaDateTimeBundlesetTemporalAmountTimestampFormat(Class<? extends TemporalAmount> clazz, TimestampFormat format)TheTimestampFormatto use when serializing/deserializing aTemporalAmountvalue of the provided class.JavaDateTimeBundlesetZoneId(ZoneId zoneId)The default zoneId to use when parsing DateTime type objects.-
Methods inherited from class com.oracle.coherence.io.json.genson.ext.GensonBundle
createBeanDescriptorProvider
-
-
-
-
Method Detail
-
configure
public void configure(GensonBuilder builder)
Description copied from class:GensonBundleThis method does not provide any guarantee to when it is called: before user config, during, or after. Thus it should not rely on accessor methods from GensonBuilder they might not reflect the final configuration. Use the builder to register your components.- Specified by:
configurein classGensonBundle
-
setFormatter
public JavaDateTimeBundle setFormatter(Class<? extends TemporalAccessor> clazz, DateTimeFormatter formatter)
Sets theDateTimeFormatterto use when parsing/formatting a value of the provided class.- Parameters:
clazz- the class to formatformatter- the formatter for the class- Returns:
- this
JavaDateTimeBundle
-
setTemporalAccessorTimestampFormat
public JavaDateTimeBundle setTemporalAccessorTimestampFormat(Class<? extends TemporalAccessor> clazz, TimestampFormat format)
TheTimestampFormatto use when serializing/deserializing aTemporalAccessorvalue of the provided class.This only applies if
GensonBuilder.isDateAsTimestamp()is true or ifJsonDateFormat.asTimeInMillis()is true.- Parameters:
clazz- the class to formatformat- the format for the class- Returns:
- this
JavaDateTimeBundle
-
setTemporalAmountTimestampFormat
public JavaDateTimeBundle setTemporalAmountTimestampFormat(Class<? extends TemporalAmount> clazz, TimestampFormat format)
TheTimestampFormatto use when serializing/deserializing aTemporalAmountvalue of the provided class.Use this method to set timestamp format for
DurationorPeriod.- Parameters:
clazz- the class to formatformat- the format for the class- Returns:
- this
JavaDateTimeBundle
-
setZoneId
public JavaDateTimeBundle setZoneId(ZoneId zoneId)
The default zoneId to use when parsing DateTime type objects.By default, this will be set to the value returned by
ZoneId.systemDefault().- Parameters:
zoneId- the Zone ID- Returns:
- this
JavaDateTimeBundle
-
-