public ProductWrapper<E> generate(ProductWrapper<E> wrapper) { try { assertInitialized(); if (iterator == null) iterator = source.iterator(); // iterator initialized lazily to reflect context state at invocation DataContainer<E> tmp = iterator.next(container.get()); if (tmp == null) { IOUtil.close(iterator); return null; } return wrapper.wrap(tmp.getData()); } catch (Exception e) { throw new IllegalGeneratorStateException("Generation failed: ", e); } }
public Class<E> getGeneratedType() { return source.getType(); }