java.lang.Object
cz.cvut.kbss.jsonld.serialization.serializer.compact.datetime.TemporalSerializer
All Implemented Interfaces:
Configurable, ValueSerializer<TemporalAccessor>
Direct Known Subclasses:
ContextBuildingTemporalSerializer

public class TemporalSerializer extends Object implements ValueSerializer<TemporalAccessor>
Serializes Java 8 date/time values represented by the TemporalAccessor interface.
  • Field Details

  • Constructor Details

  • Method Details

    • serialize

      Description copied from interface: ValueSerializer
      Serializes the specified value, returning a JSON-LD node representing it.

      Note that if the value is a singular, the returned node should also contain the identifier of the serialized attribute (available through the provided serialization context).

      Specified by:
      serialize in interface ValueSerializer<TemporalAccessor>
      Parameters:
      value - Value to serialize
      ctx - Serialization context
      Returns:
      Serialization result
    • configure

      public void configure(Configuration config)
      Description copied from interface: ValueSerializer
      Applies the specified configuration to this serializer.

      Should be called at the beginning of serialization of an object graph so that potential runtime changes in configuration can be reflected by the serialization process.

      Implementations are free to apply configuration on initialization and rely on the default implementation of this method which does nothing.

      Specified by:
      configure in interface Configurable
      Specified by:
      configure in interface ValueSerializer<TemporalAccessor>
      Parameters:
      config - Configuration to apply
    • getSupportedTypes

      public static List<Class<? extends TemporalAccessor>> getSupportedTypes()
      Gets the Java types supported by this serializer.
      Returns:
      List of Java classes