Class ContextBuildingNumberSerializer

java.lang.Object
cz.cvut.kbss.jsonld.serialization.serializer.compact.NumberSerializer
cz.cvut.kbss.jsonld.serialization.serializer.context.ContextBuildingNumberSerializer
All Implemented Interfaces:
Configurable, ValueSerializer<Number>

public class ContextBuildingNumberSerializer extends NumberSerializer
Serializes numeric values and builds a corresponding context item for them.
  • Constructor Details

    • ContextBuildingNumberSerializer

      public ContextBuildingNumberSerializer()
  • Method Details

    • serialize

      public JsonNode serialize(Number value, SerializationContext<Number> ctx)
      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<Number>
      Overrides:
      serialize in class NumberSerializer
      Parameters:
      value - Value to serialize
      ctx - Serialization context
      Returns:
      Serialization result