Interface ValueSerializer<T>

All Superinterfaces:
Configurable
All Known Implementing Classes:
ContextBuildingDefaultValueSerializer, ContextBuildingIdentifierSerializer, ContextBuildingIndividualSerializer, ContextBuildingMultilingualStringSerializer, ContextBuildingNumberSerializer, ContextBuildingObjectPropertyValueSerializer, ContextBuildingPluralMultilingualStringSerializer, ContextBuildingTemporalAmountSerializer, ContextBuildingTemporalSerializer, ContextBuildingTypesSerializer, DateSerializer, DefaultValueSerializer, IdentifierSerializer, IndividualSerializer, MultilingualStringSerializer, NumberSerializer, ObjectPropertyValueSerializer, TemporalAmountSerializer, TemporalSerializer, TypesSerializer
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ValueSerializer<T> extends Configurable
Serializes values.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Applies the specified configuration to this serializer.
    Serializes the specified value, returning a JSON-LD node representing it.
  • Method Details

    • serialize

      JsonNode serialize(T value, SerializationContext<T> ctx)
      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).

      Parameters:
      value - Value to serialize
      ctx - Serialization context
      Returns:
      Serialization result
    • configure

      default void configure(Configuration config)
      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
      Parameters:
      config - Configuration to apply