Class LiteralValueSerializers
java.lang.Object
cz.cvut.kbss.jsonld.serialization.serializer.LiteralValueSerializers
- All Implemented Interfaces:
Configurable,ValueSerializers
Manages serializers of non-object property values for a single
JsonLdSerializer instance.
That is, if an object is not referenced by an object property mapped attribute, it will be serialized by a serializer managed by this instance.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(Configuration configuration) Applies the specified configuration on this object.<T> ValueSerializer<T>getOrDefault(SerializationContext<T> ctx) Gets a custom serializer registered for the specified serialization context or a default serializer if there is no custom one registered.<T> Optional<ValueSerializer<T>>getSerializer(SerializationContext<T> ctx) Gets a custom serializer for the specified serialization context.<T> booleanhasCustomSerializer(Class<T> type) Checks whether a custom serializer is registered for the specified type.voidregisterIdentifierSerializer(ValueSerializer<String> idSerializer) voidregisterIndividualSerializer(ValueSerializer<?> individualSerializer) <T> voidregisterSerializer(Class<T> forType, ValueSerializer<? super T> serializer) Registers the specified serializer for the specified type.voidregisterTypesSerializer(ValueSerializer<Set<String>> typesSerializer)
-
Constructor Details
-
LiteralValueSerializers
-
-
Method Details
-
hasCustomSerializer
Description copied from interface:ValueSerializersChecks whether a custom serializer is registered for the specified type.- Specified by:
hasCustomSerializerin interfaceValueSerializers- Type Parameters:
T- Type of value- Parameters:
type- Type to check for custom serializer for- Returns:
- Whether a custom serializer exists
-
getSerializer
Description copied from interface:ValueSerializersGets a custom serializer for the specified serialization context.- Specified by:
getSerializerin interfaceValueSerializers- Type Parameters:
T- Type of the value- Parameters:
ctx- Context representing the value to serialize- Returns:
- Optional containing the custom serializer registered for the specified value or an empty optional if there is no custom serializer registered
- See Also:
-
getOrDefault
Description copied from interface:ValueSerializersGets a custom serializer registered for the specified serialization context or a default serializer if there is no custom one registered.- Specified by:
getOrDefaultin interfaceValueSerializers- Type Parameters:
T- Type of the value- Parameters:
ctx- Context representing the value to serialize- Returns:
- Value serializer for the specified context
- See Also:
-
registerSerializer
Description copied from interface:ValueSerializersRegisters the specified serializer for the specified type.- Specified by:
registerSerializerin interfaceValueSerializers- Type Parameters:
T- Value type- Parameters:
forType- Type to be serialized using the specified serializerserializer- Serializer to register
-
getIdentifierSerializer
- Specified by:
getIdentifierSerializerin interfaceValueSerializers
-
registerIdentifierSerializer
- Specified by:
registerIdentifierSerializerin interfaceValueSerializers
-
getTypesSerializer
- Specified by:
getTypesSerializerin interfaceValueSerializers
-
registerTypesSerializer
- Specified by:
registerTypesSerializerin interfaceValueSerializers
-
getIndividualSerializer
- Specified by:
getIndividualSerializerin interfaceValueSerializers
-
registerIndividualSerializer
- Specified by:
registerIndividualSerializerin interfaceValueSerializers
-
configure
Description copied from interface:ConfigurableApplies the specified configuration on this object.- Specified by:
configurein interfaceConfigurable- Parameters:
configuration- Configuration to apply
-