@Override public T read() throws Exception, UnexpectedInputException, ParseException { if (currentItemCount >= maxItemCount) { return null; } currentItemCount++; T item = doRead(); if(item instanceof ItemCountAware) { ((ItemCountAware) item).setItemCount(currentItemCount); } return item; }
@Override public T read() throws Exception, UnexpectedInputException, ParseException { if (currentItemCount >= maxItemCount) { return null; } currentItemCount++; T item = doRead(); if(item instanceof ItemCountAware) { ((ItemCountAware) item).setItemCount(currentItemCount); } return item; }