Interface Deserializer.DecoderContext
- All Superinterfaces:
AutoCloseable, Closeable, DeserializerLocator, NamingStrategyLocator, PropertyReferenceManager
- Enclosing interface:
Deserializer<T>
public static interface Deserializer.DecoderContext
extends PropertyReferenceManager, DeserializerLocator, NamingStrategyLocator, Closeable
Context object passed to the
Deserializer.deserialize(Decoder, io.micronaut.serde.Deserializer.DecoderContext, io.micronaut.core.type.Argument) method along with the decoder.- Author:
- Jonas Konrad, graemerocher
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidclose()Completes the document read with this context.default io.micronaut.core.convert.ConversionServicedefault Optional<DeserializationConfiguration> Get theDeserializationConfigurationfor this context.default Set<DeserializationConfiguration.Feature> Get the active deserialization format features for this context.default Optional<SerdeConfiguration> Get theSerdeConfigurationfor this context.default boolean<B,P> @Nullable PropertyReference <B, P> resolveReference(PropertyReference<B, P> reference) Resolve a reference for the given type and value.default Deserializer.DecoderContextwithFeatures(Set<DeserializationConfiguration.Feature> includedFeatures, Set<DeserializationConfiguration.Feature> excludedFeatures) Create a context with deserialization format features overridden by annotation metadata.Methods inherited from interface DeserializerLocator
findCustomDeserializer, findDeserializer, findDeserializer, getDeserializableSubtypesMethods inherited from interface NamingStrategyLocator
findNamingStrategyMethods inherited from interface PropertyReferenceManager
popManagedRef, pushManagedRef
-
Method Details
-
close
Completes the document read with this context. Mappers create a context per document and close it after the root value has been read; closing fails if references to identifiers that were never read remain.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- If the document could not be completed- Since:
- 3.2
-
getConversionService
default io.micronaut.core.convert.ConversionService getConversionService()- Returns:
- Conversion service
-
hasView
- Parameters:
views- Views to check.- Returns:
trueiff any of the given views is enabled.
-
resolveReference
Resolve a reference for the given type and value.- Type Parameters:
B- The bean typeP- The generic type of the value- Parameters:
reference- The reference- Returns:
- The existing reference, a new one or
nullif serialization should be skipped
-
getSerdeConfiguration
Get theSerdeConfigurationfor this context.- Returns:
- The
SerdeConfiguration, or an empty optional if the default should be used - Since:
- 2.7.0
-
getDeserializationConfiguration
Get theDeserializationConfigurationfor this context.- Returns:
- The
DeserializationConfiguration, or an empty optional if the default should be used - Since:
- 2.7.0
-
getFeatures
Get the active deserialization format features for this context.- Returns:
- The active deserialization format features
- Since:
- 3.0
-
withFeatures
default Deserializer.DecoderContext withFeatures(Set<DeserializationConfiguration.Feature> includedFeatures, Set<DeserializationConfiguration.Feature> excludedFeatures) Create a context with deserialization format features overridden by annotation metadata.- Parameters:
includedFeatures- Features to enableexcludedFeatures- Features to disable- Returns:
- The derived context
- Since:
- 3.0
-