@Singleton public class DefaultSerdeRegistry extends java.lang.Object implements SerdeRegistry
SerdeRegistry
interface.Constructor and Description |
---|
DefaultSerdeRegistry(io.micronaut.context.BeanContext beanContext,
ObjectSerializer objectSerializer,
ObjectDeserializer objectDeserializer,
Serde<java.lang.Object[]> objectArraySerde,
SerdeIntrospections introspections) |
Modifier and Type | Method and Description |
---|---|
<T,D extends Deserializer<? extends T>> |
findCustomDeserializer(java.lang.Class<? extends D> deserializerClass)
Gets a custom deserializer.
|
<T,D extends Serializer<? extends T>> |
findCustomSerializer(java.lang.Class<? extends D> serializerClass)
Gets a custom serializer.
|
<T> Deserializer<? extends T> |
findDeserializer(io.micronaut.core.type.Argument<? extends T> type)
Finds a deserializer for the given type.
|
<D extends PropertyNamingStrategy> |
findNamingStrategy(java.lang.Class<? extends D> namingStrategyClass)
Gets a naming strategy.
|
<T> Serializer<? super T> |
findSerializer(io.micronaut.core.type.Argument<? extends T> type)
Finds a serializer for the given type.
|
<T> java.util.Collection<io.micronaut.core.beans.BeanIntrospection<? extends T>> |
getDeserializableSubtypes(java.lang.Class<T> superType)
Locates desrializable subtypes for the given super type.
|
Deserializer.DecoderContext |
newDecoderContext(java.lang.Class<?> view)
Creates a new decoder context.
|
Serializer.EncoderContext |
newEncoderContext(java.lang.Class<?> view)
Creates a new encoder context.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
findSerializer
findDeserializer
public DefaultSerdeRegistry(io.micronaut.context.BeanContext beanContext, ObjectSerializer objectSerializer, ObjectDeserializer objectDeserializer, Serde<java.lang.Object[]> objectArraySerde, SerdeIntrospections introspections)
public <T,D extends Serializer<? extends T>> D findCustomSerializer(java.lang.Class<? extends D> serializerClass) throws SerdeException
SerializerLocator
findCustomSerializer
in interface SerializerLocator
T
- The generic typeD
- The serializer typeserializerClass
- The serializer class, should not be null
SerdeException
- if no serializer is foundpublic <T,D extends Deserializer<? extends T>> D findCustomDeserializer(java.lang.Class<? extends D> deserializerClass) throws SerdeException
DeserializerLocator
findCustomDeserializer
in interface DeserializerLocator
T
- The generic typeD
- The deserializer typedeserializerClass
- The deserializer class, should not be null
SerdeException
- if no deserializer is foundpublic <D extends PropertyNamingStrategy> D findNamingStrategy(java.lang.Class<? extends D> namingStrategyClass) throws SerdeException
NamingStrategyLocator
findNamingStrategy
in interface NamingStrategyLocator
D
- The naming strategy typenamingStrategyClass
- The naming strategy class, should not be null
SerdeException
- if no naming strategy is foundpublic <T> Deserializer<? extends T> findDeserializer(io.micronaut.core.type.Argument<? extends T> type)
DeserializerLocator
findDeserializer
in interface DeserializerLocator
T
- The generic typetype
- The type, should not be null
public <T> java.util.Collection<io.micronaut.core.beans.BeanIntrospection<? extends T>> getDeserializableSubtypes(java.lang.Class<T> superType)
DeserializerLocator
getDeserializableSubtypes
in interface DeserializerLocator
T
- The generic super typesuperType
- The super typepublic <T> Serializer<? super T> findSerializer(io.micronaut.core.type.Argument<? extends T> type) throws SerdeException
SerializerLocator
findSerializer
in interface SerializerLocator
T
- The generic typetype
- The typeSerdeException
- if an exception occurspublic Serializer.EncoderContext newEncoderContext(java.lang.Class<?> view)
SerdeRegistry
newEncoderContext
in interface SerdeRegistry
view
- The viewpublic Deserializer.DecoderContext newDecoderContext(java.lang.Class<?> view)
SerdeRegistry
newDecoderContext
in interface SerdeRegistry
view
- The view