use of com.fasterxml.jackson.dataformat.ion.IonGenerator in project jackson-dataformats-binary by FasterXML.
the class IonValueSerializer method serialize.
@Override
public void serialize(IonValue value, JsonGenerator g, SerializerProvider provider) {
IonGenerator joiGenerator = (IonGenerator) g;
joiGenerator.writeValue(value);
}
use of com.fasterxml.jackson.dataformat.ion.IonGenerator in project jackson-dataformats-binary by FasterXML.
the class TimestampSerializer method serialize.
@Override
public void serialize(Timestamp value, JsonGenerator jgen, SerializerProvider provider) {
IonGenerator joiGenerator = (IonGenerator) jgen;
joiGenerator.writeValue(value);
}
use of com.fasterxml.jackson.dataformat.ion.IonGenerator in project jackson-dataformats-binary by FasterXML.
the class IonTimestampInstantSerializer method serialize.
@Override
public void serialize(T value, JsonGenerator gen, SerializerProvider provider) throws JacksonException {
final Instant instant = getInstant.apply(value);
if (provider.isEnabled(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)) {
if (shouldWriteTimestampsAsNanos(provider)) {
gen.writeNumber(TimestampUtils.getFractionalSeconds(instant));
} else {
gen.writeNumber(instant.toEpochMilli());
}
} else {
final ZoneOffset offset = getOffset(value);
((IonGenerator) gen).writeValue(TimestampUtils.toTimestamp(instant, offset));
}
}
use of com.fasterxml.jackson.dataformat.ion.IonGenerator in project amazon-qldb-dmv-sample-java by aws-samples.
the class IonLocalDateSerializer method serialize.
@Override
public void serialize(LocalDate date, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
Timestamp timestamp = Timestamp.forDay(date.getYear(), date.getMonthValue(), date.getDayOfMonth());
((IonGenerator) jsonGenerator).writeValue(timestamp);
}
Aggregations