Class IdReferenceDeserializer
java.lang.Object
io.micronaut.serde.support.deserializers.IdReferenceDeserializer
- All Implemented Interfaces:
Deserializer<Object>
@Internal
@Singleton
public final class IdReferenceDeserializer
extends Object
implements Deserializer<Object>
Deserializes a property that always references beans by their document-scoped identifier
(JAXB
@XmlIDREF, Jackson @JsonIdentityReference(alwaysAsId = true)): each identifier is resolved
against the beans already read in the current document.- Since:
- 3.2
-
Nested Class Summary
Nested classes/interfaces inherited from interface Deserializer
Deserializer.DecoderContext -
Constructor Summary
ConstructorsConstructorDescriptionIdReferenceDeserializer(SerdeIntrospections introspections) Creates the unspecialized identifier-reference deserializer. -
Method Summary
Modifier and TypeMethodDescriptioncreateSpecific(Deserializer.DecoderContext context, io.micronaut.core.type.Argument<? super Object> type) Create a new child deserializer or return this if non is necessary for the given context.deserialize(Decoder decoder, Deserializer.DecoderContext context, io.micronaut.core.type.Argument<? super Object> type) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Deserializer
deserializeNullable, getDefaultValue
-
Constructor Details
-
IdReferenceDeserializer
Creates the unspecialized identifier-reference deserializer.- Parameters:
introspections- The serde introspections
-
-
Method Details
-
createSpecific
public Deserializer<Object> createSpecific(Deserializer.DecoderContext context, io.micronaut.core.type.Argument<? super Object> type) throws SerdeException Description copied from interface:DeserializerCreate a new child deserializer or return this if non is necessary for the given context.- Specified by:
createSpecificin interfaceDeserializer<Object>- Parameters:
context- The decoder contexttype- The context, including any annotation metadata and type information to narrow the deserializer type- Returns:
- An instance of the same type of deserializer
- Throws:
SerdeException
-
deserialize
public Object deserialize(Decoder decoder, Deserializer.DecoderContext context, io.micronaut.core.type.Argument<? super Object> type) throws IOException Description copied from interface:Deserializer- Specified by:
deserializein interfaceDeserializer<Object>- Parameters:
decoder- The decoder, nevernullcontext- The decoder context, nevernulltype- The generic type to be deserialized- Returns:
- The deserialized object, never
null. UseDeserializer.deserializeNullable(Decoder, DecoderContext, Argument)when the decoder value can benull. - Throws:
IOException- If an error occurs during deserialization of the object
-