Class SerializerUtils

java.lang.Object
cz.cvut.kbss.jsonld.serialization.serializer.SerializerUtils

public class SerializerUtils extends Object
Utilities for serializers.
  • Method Details

    • isAnnotationReference

      public static boolean isAnnotationReference(Object value, SerializationContext<?> ctx)
      Checks whether the specified value in the specified context is an annotation property value referencing an individual (resource).
      Parameters:
      value - Value to examine
      ctx - Serialization context
      Returns:
      true if the value is an annotation property value reference, false otherwise
    • createTypedTermDefinition

      public static ObjectNode createTypedTermDefinition(String term, String id, String type)
      Creates a term definition node containing identifier and type attributes.
      Parameters:
      term - Term whose definition to create
      id - Mapped term identifier (IRI)
      type - Type of the mapped term
      Returns:
      Term definition node
    • createdTypedValueNode

      public static JsonNode createdTypedValueNode(String term, Object value, String type)
      Serializes the specified value as a JSON object with value (JsonLd.VALUE) and type (JsonLd.TYPE).
      Parameters:
      term - Term to identify the object in the enclosing object
      value - Value to serialize
      type - Value type to use
      Returns:
      Resulting JSON node