Class ScalarSerializer.Annotated<V>

    • Constructor Detail

      • Annotated

        protected Annotated​(java.lang.Class<V> type)
        Create a new annotated scalar serializer that handles the provided type.

        type must not be a raw parameterized type.

        Parameters:
        type - type to handle
        Since:
        4.2.0
      • Annotated

        protected Annotated​(io.leangen.geantyref.TypeToken<V> type)
        Create a new annotated scalar serializer that handles the provided type.
        Parameters:
        type - type to handle
        Since:
        4.2.0
    • Method Detail

      • deserialize

        public abstract V deserialize​(java.lang.reflect.AnnotatedType type,
                                      java.lang.Object obj)
                               throws SerializationException
        Description copied from class: ScalarSerializer
        Given an object of unknown type, attempt to convert it into the given type.
        Overrides:
        deserialize in class ScalarSerializer<V>
        Parameters:
        type - the specific type of the type's usage
        obj - the object to convert
        Returns:
        a converted object
        Throws:
        SerializationException - if the object could not be converted for any reason
      • deserialize

        public V deserialize​(java.lang.reflect.Type type,
                             java.lang.Object obj)
                      throws SerializationException
        Description copied from class: ScalarSerializer
        Given an object of unknown type, attempt to convert it into the given type.
        Specified by:
        deserialize in class ScalarSerializer<V>
        Parameters:
        type - the specific type of the type's usage
        obj - the object to convert
        Returns:
        a converted object
        Throws:
        SerializationException - if the object could not be converted for any reason