Class DefaultJsonDeserializer<CLASS>

    • Constructor Detail

      • DefaultJsonDeserializer

        public DefaultJsonDeserializer​(@NonNull
                                       IAssemblyClassBinding classBinding)
        Construct a new JSON deserializer that will parse the bound class identified by the classBinding.
        Parameters:
        classBinding - the bound class information for the Java type this deserializer is operating on
    • Method Detail

      • newJsonFactoryInstance

        @NonNull
        protected com.fasterxml.jackson.core.JsonFactory newJsonFactoryInstance()
        Get a JSON factory instance.

        This method can be used by sub-classes to create a customized factory instance.

        Returns:
        the factory
      • getJsonFactory

        @NonNull
        protected com.fasterxml.jackson.core.JsonFactory getJsonFactory()
        Get the parser factory associated with this deserializer.
        Returns:
        the factory instance
      • newJsonParser

        @NonNull
        protected final com.fasterxml.jackson.core.JsonParser newJsonParser​(@NonNull
                                                                            Reader reader)
                                                                     throws IOException
        Using the managed JSON factory, create a new JSON parser instance using the provided reader.
        Parameters:
        reader - the reader for the parser to read data from
        Returns:
        the new parser
        Throws:
        IOException - if an error occurred while creating the parser
      • deserializeToValue

        public CLASS deserializeToValue​(@NonNull
                                        Reader reader,
                                        @NonNull
                                        URI documentUri)
                                 throws IOException
        Description copied from interface: IDeserializer
        Read data from the Reader into a node item instance.
        Parameters:
        reader - the reader to read from
        documentUri - the URI of the document to read from
        Returns:
        a new node item
        Throws:
        IOException - if an error occurred while reading data from the stream
      • getBindingContext

        @NonNull
        protected IBindingContext getBindingContext()
        Retrieve the binding context associated with the serializer.
        Returns:
        the binding context
      • getClassBinding

        @NonNull
        protected IAssemblyClassBinding getClassBinding()
        Retrieve the bound class information associated with the assembly that the serializer/deserializer will write/read data from.
        Returns:
        the class binding for the Module assembly
      • configurationChanged

        protected void configurationChanged​(@NonNull
                                            IMutableConfiguration<T> config)
      • getConfiguration

        @NonNull
        protected IMutableConfiguration<T> getConfiguration()
        Get the current configuration of the serializer/deserializer.
        Returns:
        the configuration