Class JsonLdSerializer
java.lang.Object
cz.cvut.kbss.jsonld.serialization.JsonLdSerializer
- All Implemented Interfaces:
- Configured
- Direct Known Subclasses:
- CompactedJsonLdSerializer,- ContextBuildingJsonLdSerializer
Base class for all JSON-LD serializers.
 
The serializers will mostly differ in the form of the generated JSON. E.g. the output can be expanded, using contexts etc.
- 
Field SummaryFields
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedJsonLdSerializer(JsonGenerator jsonGenerator) JsonLdSerializer(JsonGenerator jsonGenerator, Configuration configuration) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract JsonNodebuildJsonTree(Object root) Builds the JSON-LD tree model.Gets the configuration holder for this JSON-LD processor.static JsonLdSerializercreateCompactedJsonLdSerializer(JsonGenerator jsonWriter) static JsonLdSerializercreateCompactedJsonLdSerializer(JsonGenerator jsonWriter, Configuration configuration) static JsonLdSerializercreateContextBuildingJsonLdSerializer(JsonGenerator jsonWriter) static JsonLdSerializercreateContextBuildingJsonLdSerializer(JsonGenerator jsonWriter, Configuration configuration) protected abstract ValueSerializers<T> voidregisterSerializer(Class<T> type, ValueSerializer<T> serializer) Registers a custom serializer for the specified type.voidSerializes object graph with the specified root.
- 
Field Details- 
jsonGenerator
- 
serializers
 
- 
- 
Constructor Details- 
JsonLdSerializer
- 
JsonLdSerializer
 
- 
- 
Method Details- 
configurationDescription copied from interface:ConfiguredGets the configuration holder for this JSON-LD processor.- Specified by:
- configurationin interface- Configured
- Returns:
- Configuration
 
- 
registerSerializerRegisters a custom serializer for the specified type.If a serializer already existed for the type, it is replaced by the new one. - Type Parameters:
- T- Serialized type
- Parameters:
- type- Type to register the serializer for
- serializer- Serializer to register
 
- 
serializeSerializes object graph with the specified root.The serialization builds a JSON-LD tree model and then writes it using a JsonGenerator, which was passed to this instance in constructor.- Parameters:
- root- Object graph root
 
- 
initSerializers
- 
buildJsonTreeBuilds the JSON-LD tree model.- Parameters:
- root- Object graph root
- Returns:
- JsonNodecorresponding to the JSON-LD's tree root
 
- 
createCompactedJsonLdSerializer
- 
createCompactedJsonLdSerializerpublic static JsonLdSerializer createCompactedJsonLdSerializer(JsonGenerator jsonWriter, Configuration configuration) 
- 
createContextBuildingJsonLdSerializer
- 
createContextBuildingJsonLdSerializerpublic static JsonLdSerializer createContextBuildingJsonLdSerializer(JsonGenerator jsonWriter, Configuration configuration) 
 
-