Codota Logo
org.springframework.batch.item.support
Code IndexAdd Codota to your IDE (free)

How to use org.springframework.batch.item.support

Best Java code snippets using org.springframework.batch.item.support (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-batch

/**
 * Register a single {@link ItemStream} for callbacks to the stream
 * interface.
 *
 * @param stream instance of {@link ItemStream}
 */
public void registerStream(ItemStream stream) {
  this.stream.register(stream);
}
origin: spring-projects/spring-batch

@Override
@SuppressWarnings("unchecked")
public O process(I item) throws Exception {
  Object result = item;
  for (ItemProcessor<?, ?> delegate : delegates) {
    if (result == null) {
      return null;
    }
    result = processItem(delegate, result);
  }
  return (O) result;
}

origin: spring-projects/spring-batch

@Override
protected void close(ExecutionContext ctx) throws Exception {
  stream.close();
}
origin: spring-projects/spring-batch

public void testRegisterAndOpen() {
  ItemStreamSupport stream = new ItemStreamSupport() {
        @Override
    public void open(ExecutionContext executionContext) {
              super.open(executionContext);
      list.add("bar");
    }
  };
  manager.register(stream);
  manager.open(null);
  assertEquals(1, list.size());
}
origin: spring-projects/spring-batch

public void testCloseDoesNotUnregister() {
  manager.setStreams(new ItemStream[] { new ItemStreamSupport() {
        @Override 
    public void open(ExecutionContext executionContext) {
              super.open(executionContext);
      list.add("bar");
    }
  } });
  manager.open(null);
  manager.close();
  manager.open(null);
  assertEquals(2, list.size());
}
origin: spring-projects/spring-batch

public void testMark() {
  manager.register(new ItemStreamSupport() {
        @Override 
    public void update(ExecutionContext executionContext) {
              super.update(executionContext);
      list.add("bar");
    }
  });
  manager.update(null);
  assertEquals(1, list.size());
}
origin: spring-projects/spring-batch

public void testClose() {
  manager.register(new ItemStreamSupport() {
        @Override
    public void close() {
              super.close();
      list.add("bar");
    }
  });
  manager.close();
  assertEquals(1, list.size());
}
origin: spring-projects/spring-batch

/**
 * Initialize the reader. This method may be called multiple times before
 * close is called.
 * 
 * @see ItemStream#open(ExecutionContext)
 */
@Override
public void open(ExecutionContext executionContext) throws ItemStreamException {
  super.open(executionContext);
  Assert.notNull(resource, "The resource must be set");
  if (!getOutputState().isInitialized()) {
    doOpen(executionContext);
  }
}
origin: spring-projects/spring-batch

@Override
protected void open(ExecutionContext ctx) throws Exception {
  stream.open(ctx);
}
origin: spring-projects/spring-batch

@Override
public void close() throws ItemStreamException {
  super.close();
  currentItemCount = 0;
  try {
    doClose();
  }
  catch (Exception e) {
    throw new ItemStreamException("Error while closing item reader", e);
  }
}
origin: spring-projects/spring-batch

public void testIterable() throws Exception {
  IteratorItemReader<String> reader = new IteratorItemReader<>(Arrays.asList(new String[]{"a", "b", "c"}));
  assertEquals("a", reader.read());
  assertEquals("b", reader.read());
  assertEquals("c", reader.read());
  assertEquals(null, reader.read());
}
origin: spring-projects/spring-batch

@Override
public void open(ExecutionContext executionContext) {
  super.open(executionContext);
  opened = true;
}
origin: spring-projects/spring-batch

/**
 * Move to the given item index. Subclasses should override this method if
 * there is a more efficient way of moving to given index than re-reading
 * the input using {@link #doRead()}.
 *
 * @param itemIndex index of item (0 based) to jump to.
 * @throws Exception Allows subclasses to throw checked exceptions for interpretation by the framework
 */
protected void jumpToItem(int itemIndex) throws Exception {
  for (int i = 0; i < itemIndex; i++) {
    read();
  }
}
origin: spring-projects/spring-batch

public void testNext() throws Exception {
  assertEquals("a", reader.read());
  assertEquals("b", reader.read());
  assertEquals("c", reader.read());
  assertEquals(null, reader.read());
}
origin: spring-projects/spring-batch

public void testNext() throws Exception {
  assertEquals("a", reader.read());
  assertEquals("b", reader.read());
  assertEquals("c", reader.read());
  assertEquals(null, reader.read());
}
origin: spring-projects/spring-batch

@Override
public void close() {
  super.close();
  closed = true;
}
origin: spring-projects/spring-batch

/**
 * Creates a {@link PassThroughItemProcessor} and uses it to create an
 * instance of {@link Tasklet}.
 */
public TestingChunkOrientedTasklet(ItemReader<T> itemReader, ItemWriter<T> itemWriter,
    RepeatOperations repeatOperations) {
  this(itemReader, new PassThroughItemProcessor<>(), itemWriter, repeatOperations);
}
origin: spring-projects/spring-batch

public CountingListItemReader(List<T> list) {
  this.list = list;
  setName("foo");
}
origin: spring-projects/spring-batch

public void testRegisterTwice() {
  ItemStreamSupport stream = new ItemStreamSupport() {
    @Override
    public void open(ExecutionContext executionContext) {
              super.open(executionContext);
      list.add("bar");
    }
  };
  manager.register(stream);
  manager.register(stream);
  manager.open(null);
  assertEquals(1, list.size());
}
origin: spring-projects/spring-batch

/**
 * @param stream the stream to set
 */
public void registerItemStream(ItemStream stream) {
  streamsRegistered = true;
  this.stream.register(stream);
}
org.springframework.batch.item.support

Most used classes

  • ListItemReader
    An ItemReader that pulls data from a list. Useful for testing.
  • CompositeItemStream
    Simple ItemStream that delegates to a list of other streams.
  • AbstractItemCountingItemStreamItemReader
    Abstract superclass for ItemReaders that supports restart by storing item count in the ExecutionCont
  • AbstractItemStreamItemReader
    Base class for ItemReader implementations.
  • ClassifierCompositeItemWriter
    Calls one of a collection of ItemWriters for each item, based on a router pattern implemented throug
  • AbstractItemStreamItemWriter,
  • ClassifierCompositeItemProcessor,
  • CompositeItemWriter,
  • ListItemWriter,
  • PassThroughItemProcessor,
  • ScriptItemProcessor,
  • SingleItemPeekableItemReader,
  • SynchronizedItemStreamReader,
  • AbstractFileItemWriter$OutputState,
  • AbstractFileItemWriter,
  • IteratorItemReader,
  • CompositeItemProcessorBuilder,
  • CompositeItemWriterBuilder,
  • AbstractItemCountingItemStreamItemWriter
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now