Class JsonFileItemWriter<T>

    • Constructor Detail

      • JsonFileItemWriter

        public JsonFileItemWriter​(org.springframework.core.io.Resource resource,
                                  JsonObjectMarshaller<T> jsonObjectMarshaller)
        Create a new JsonFileItemWriter instance.
        Parameters:
        resource - to write json data to
        jsonObjectMarshaller - used to marshal object into json representation
    • Method Detail

      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        Assert that mandatory properties (jsonObjectMarshaller) are set.
        Throws:
        java.lang.Exception
        See Also:
        InitializingBean.afterPropertiesSet()
      • setJsonObjectMarshaller

        public void setJsonObjectMarshaller​(JsonObjectMarshaller<T> jsonObjectMarshaller)
        Set the JsonObjectMarshaller to use to marshal object to json.
        Parameters:
        jsonObjectMarshaller - the marshaller to use
      • doWrite

        public java.lang.String doWrite​(java.util.List<? extends T> items)
        Description copied from class: AbstractFileItemWriter
        Write out a string of items followed by a "new line", where the format of the new line separator is determined by the underlying operating system.
        Specified by:
        doWrite in class AbstractFileItemWriter<T>
        Parameters:
        items - to be written
        Returns:
        written lines