コード例 #1
0
 public void setItemWriter(Object itemWriter) {
   if (itemWriter instanceof org.springframework.batch.item.ItemWriter) {
     super.setItemWriter((org.springframework.batch.item.ItemWriter) itemWriter);
   } else if (itemWriter instanceof ItemWriter) {
     super.setItemWriter(new ItemWriterAdapter((ItemWriter) itemWriter));
   } else {
     throw new IllegalArgumentException(
         "The definition of an item writer must implement either "
             + "org.springframework.batch.item.ItemWriter or javax.batch.api.chunk.ItemWriter");
   }
 }
コード例 #2
0
 public void setTasklet(Object tasklet) {
   if (tasklet instanceof Tasklet) {
     super.setTasklet((Tasklet) tasklet);
   } else if (tasklet instanceof Batchlet) {
     super.setTasklet(new BatchletAdapter((Batchlet) tasklet));
   } else {
     throw new IllegalArgumentException(
         "The field tasklet must reference an implementation of "
             + "either org.springframework.batch.core.step.tasklet.Tasklet or javax.batch.api.Batchlet");
   }
 }