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

public class NumberSerializer extends Object implements ValueSerializer<Number>
Serializes numeric values.
  • Constructor Details

    • NumberSerializer

      public NumberSerializer()
  • 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>
      Parameters:
      value - Value to serialize
      ctx - Serialization context
      Returns:
      Serialization result
    • getDatatype

      protected String getDatatype(Number value)
    • getSupportedTypes

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