class JsonItemReader<T> extends AbstractItemCountingItemStreamItemReader<T>
		implements ResourceAwareItemReaderItemStream<T> {

	private static final Log LOGGER = LogFactory.getLog(JsonItemReader.class);

	private Resource resource;

	private JsonObjectReader<T> jsonObjectReader;

	private boolean strict = true;

	/**
	 * Create a new {@link JsonItemReader} instance.
	 * @param resource the input json resource
	 * @param jsonObjectReader the json object reader to use
	 */
	public JsonItemReader(Resource resource, JsonObjectReader<T> jsonObjectReader) {
		Assert.notNull(resource, "The resource must not be null.");
		Assert.notNull(jsonObjectReader, "The json object reader must not be null.");
		this.resource = resource;
		this.jsonObjectReader = jsonObjectReader;
		setExecutionContextName(ClassUtils.getShortName(JsonItemReader.class));
	}

	/**
	 * Create a new {@link JsonItemReader} instance.
	 */
	public JsonItemReader() {
		setExecutionContextName(ClassUtils.getShortName(JsonItemReader.class));
	}

	/**
	 * Set the {@link JsonObjectReader} to use to read and map Json fragments to domain
	 * objects.
	 * @param jsonObjectReader the json object reader to use
	 */
	public void setJsonObjectReader(JsonObjectReader<T> jsonObjectReader) {
		this.jsonObjectReader = jsonObjectReader;
	}

	/**
	 * In strict mode the reader will throw an exception on
	 * {@link #open(org.springframework.batch.item.ExecutionContext)} if the input
	 * resource does not exist.
	 * @param strict true by default
	 */
	public void setStrict(boolean strict) {
		this.strict = strict;
	}

	@Override
	public void setResource(Resource resource) {
		this.resource = resource;
	}

	@Nullable
	@Override
	protected T doRead() throws Exception {
		return jsonObjectReader.read();
	}

	@Override
	protected void doOpen() throws Exception {<FILL_FUNCTION_BODY>}

	@Override
	protected void doClose() throws Exception {
		this.jsonObjectReader.close();
	}

	@Override
	protected void jumpToItem(int itemIndex) throws Exception {
		this.jsonObjectReader.jumpToItem(itemIndex);
	}

}

		Assert.notNull(this.resource, "The resource must not be null.");
		Assert.notNull(this.jsonObjectReader, "The json object reader must not be null.");
		if (!this.resource.exists()) {
			if (this.strict) {
				throw new IllegalStateException("Input resource must exist (reader is in 'strict' mode)");
			}
			LOGGER.warn("Input resource does not exist " + this.resource.getDescription());
			return;
		}
		if (!this.resource.isReadable()) {
			if (this.strict) {
				throw new IllegalStateException("Input resource must be readable (reader is in 'strict' mode)");
			}
			LOGGER.warn("Input resource is not readable " + this.resource.getDescription());
			return;
		}
		this.jsonObjectReader.open(this.resource);
	
<methods>public non-sealed void <init>() ,public void close() throws org.springframework.batch.item.ItemStreamException,public int getCurrentItemCount() ,public boolean isSaveState() ,public void open(org.springframework.batch.item.ExecutionContext) throws org.springframework.batch.item.ItemStreamException,public T read() throws java.lang.Exception,public void setCurrentItemCount(int) ,public void setMaxItemCount(int) ,public void setSaveState(boolean) ,public void update(org.springframework.batch.item.ExecutionContext) throws org.springframework.batch.item.ItemStreamException<variables>private static final java.lang.String READ_COUNT,private static final java.lang.String READ_COUNT_MAX,private int currentItemCount,private int maxItemCount,private boolean saveState