Interface ValueSerializer<T>
- All Superinterfaces:
Configurable
- All Known Implementing Classes:
ContextBuildingDefaultValueSerializer
,ContextBuildingIdentifierSerializer
,ContextBuildingIndividualSerializer
,ContextBuildingMultilingualStringSerializer
,ContextBuildingNumberSerializer
,ContextBuildingObjectPropertyValueSerializer
,ContextBuildingPluralMultilingualStringSerializer
,ContextBuildingTemporalAmountSerializer
,ContextBuildingTemporalSerializer
,ContextBuildingTypesSerializer
,DateSerializer
,DefaultValueSerializer
,IdentifierSerializer
,IndividualSerializer
,MultilingualStringSerializer
,NumberSerializer
,ObjectPropertyValueSerializer
,TemporalAmountSerializer
,TemporalSerializer
,TypesSerializer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Serializes values.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
configure
(Configuration config) Applies the specified configuration to this serializer.serialize
(T value, SerializationContext<T> ctx) Serializes the specified value, returning a JSON-LD node representing it.
-
Method Details
-
serialize
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).
- Parameters:
value
- Value to serializectx
- Serialization context- Returns:
- Serialization result
-
configure
Applies the specified configuration to this serializer.Should be called at the beginning of serialization of an object graph so that potential runtime changes in configuration can be reflected by the serialization process.
Implementations are free to apply configuration on initialization and rely on the default implementation of this method which does nothing.
- Specified by:
configure
in interfaceConfigurable
- Parameters:
config
- Configuration to apply
-