Last active
August 29, 2015 14:03
-
-
Save akiniwa/dcee31e6ed17e95bd309 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// referenced from http://docs.spring.io/spring-batch/trunk/reference/html/readersAndWriters.html | |
public class Foo {} | |
public class Bar { | |
public Bar(Foo foo) {} | |
} | |
public class Foobar{ | |
public Foobar(Bar bar) {} | |
} | |
public class FooProcessor implements ItemProcessor<Foo,Bar>{ | |
public Bar process(Foo foo) throws Exception { | |
//Perform simple transformation, convert a Foo to a Bar | |
return new Bar(foo); | |
} | |
} | |
public class BarProcessor implements ItemProcessor<Bar,FooBar>{ | |
public FooBar process(Bar bar) throws Exception { | |
return new Foobar(bar); | |
} | |
} | |
public class FoobarWriter implements ItemWriter<FooBar>{ | |
// write returns ?, which is returned from process. | |
public void write(List<? extends FooBar> items) throws Exception { | |
//write items | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment