Class SerializerUtils
java.lang.Object
cz.cvut.kbss.jsonld.serialization.serializer.SerializerUtils
Utilities for serializers.
-
Method Summary
Modifier and TypeMethodDescriptionstatic JsonNodecreatedTypedValueNode(String term, Object value, String type) Serializes the specified value as a JSON object with value (JsonLd.VALUE) and type (JsonLd.TYPE).static ObjectNodecreateTypedTermDefinition(String term, String id, String type) Creates a term definition node containing identifier and type attributes.static booleanisAnnotationReference(Object value, SerializationContext<?> ctx) Checks whether the specified value in the specified context is an annotation property value referencing an individual (resource).
-
Method Details
-
isAnnotationReference
Checks whether the specified value in the specified context is an annotation property value referencing an individual (resource).- Parameters:
value- Value to examinectx- Serialization context- Returns:
trueif the value is an annotation property value reference,falseotherwise
-
createTypedTermDefinition
Creates a term definition node containing identifier and type attributes.- Parameters:
term- Term whose definition to createid- Mapped term identifier (IRI)type- Type of the mapped term- Returns:
- Term definition node
-
createdTypedValueNode
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 objectvalue- Value to serializetype- Value type to use- Returns:
- Resulting JSON node
-