Package io.micronaut.serde
Interface Serializer.EncoderContext
- All Superinterfaces:
- NamingStrategyLocator,- PropertyReferenceManager,- SerializerLocator
- Enclosing interface:
- Serializer<T>
public static interface Serializer.EncoderContext
extends SerializerLocator, PropertyReferenceManager, NamingStrategyLocator
Context object passes to the
 
Serializer.serialize(Encoder, EncoderContext, Argument, Object)  method.- 
Method SummaryModifier and TypeMethodDescriptiondefault @NonNull io.micronaut.core.convert.ConversionServicedefault @NonNull Optional<SerdeConfiguration>Get theSerdeConfigurationfor this context.default @NonNull Optional<SerializationConfiguration>Get theSerializationConfigurationfor this context.default boolean<B,P> @Nullable SerializationReference<B, P> resolveReference(@NonNull SerializationReference<B, P> reference) Resolve a reference for the given type and value.Methods inherited from interface io.micronaut.serde.NamingStrategyLocatorfindNamingStrategyMethods inherited from interface io.micronaut.serde.reference.PropertyReferenceManagerpopManagedRef, pushManagedRefMethods inherited from interface io.micronaut.serde.SerializerLocatorfindCustomSerializer, findSerializer, findSerializer
- 
Method Details- 
getConversionService@NonNull default @NonNull 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@Internal @Nullable <B,P> @Nullable SerializationReference<B,P> resolveReference(@NonNull @NonNull SerializationReference<B, P> reference) Resolve a reference for the given type and value.- Type Parameters:
- B- The bean type
- P- The generic type of the value
- Parameters:
- reference- The reference
- Returns:
- The existing reference, a new one or nullif serialization should be skipped
 
- 
getSerdeConfigurationGet theSerdeConfigurationfor this context.- Returns:
- The SerdeConfiguration, or an empty optional if the default should be used
- Since:
- 2.7.0
 
- 
getSerializationConfigurationGet theSerializationConfigurationfor this context.- Returns:
- The SerializationConfiguration, or an empty optional if the default should be used
- Since:
- 2.7.0
 
 
-