Interface SerdeIntrospections
- All Known Implementing Classes:
DefaultSerdeIntrospections
public interface SerdeIntrospections
Interface that abstracts the lookup for introspections usable for serialization and/or deserialization.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe kind of runtime introspection being requested.static final recordA runtime introspection request.static interfaceResolves runtime-built introspections. -
Method Summary
Modifier and TypeMethodDescriptiondefault <T> Collection<io.micronaut.core.beans.BeanIntrospection<? extends T>> findSubtypeDeserializables(Class<T> type) Gets an subtype introspection for the given type for deserialization.default io.micronaut.core.beans.BeanIntrospectorThe bean introspector to use.<T> io.micronaut.core.beans.BeanIntrospection<T> getDeserializableIntrospection(io.micronaut.core.type.Argument<T> type) Gets an introspection for the given type for deserialization.<T> io.micronaut.core.beans.BeanIntrospection<T> getSerializableIntrospection(io.micronaut.core.type.Argument<T> type) Gets an introspection for the given type for serialization.default SerdeIntrospectionsCreates introspections that first consult the given runtime resolver.
-
Method Details
-
getBeanIntrospector
default io.micronaut.core.beans.BeanIntrospector getBeanIntrospector()The bean introspector to use.- Returns:
- The introspector
-
getSerializableIntrospection
<T> io.micronaut.core.beans.BeanIntrospection<T> getSerializableIntrospection(io.micronaut.core.type.Argument<T> type) Gets an introspection for the given type for serialization.- Type Parameters:
T- The generic type- Parameters:
type- The type- Returns:
- The introspection, never
null - Throws:
io.micronaut.core.beans.exceptions.IntrospectionException- if no introspection exists
-
getDeserializableIntrospection
<T> io.micronaut.core.beans.BeanIntrospection<T> getDeserializableIntrospection(io.micronaut.core.type.Argument<T> type) Gets an introspection for the given type for deserialization.- Type Parameters:
T- The generic type- Parameters:
type- The type- Returns:
- The introspection, never
null - Throws:
io.micronaut.core.beans.exceptions.IntrospectionException- if no introspection exists
-
withRuntimeIntrospectionResolver
default SerdeIntrospections withRuntimeIntrospectionResolver(SerdeIntrospections.RuntimeIntrospectionResolver resolver) Creates introspections that first consult the given runtime resolver.- Parameters:
resolver- The runtime introspection resolver- Returns:
- The resolver-backed introspections
- Since:
- 3.1.0
-
findSubtypeDeserializables
default <T> Collection<io.micronaut.core.beans.BeanIntrospection<? extends T>> findSubtypeDeserializables(Class<T> type) Gets an subtype introspection for the given type for deserialization.- Type Parameters:
T- The generic type- Parameters:
type- The type- Returns:
- A collection of introspections, never
null
-