The question is rather simple, perhaps because I'm a little confused in the process. What I'm trying to do is shown in the code example:
cc.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("file://files?noop=true")
.split()
.tokenize("\n")
.split()
.method(SplitToken.class, "hashTokens")
and:
class SplitToken {
@SuppressWarnings("unchecked")
public static List<HashMap<String, Integer>> hashTokens(final Exchange exchange) {
List<String> oldstr = exchange.getIn().getBody(List<String>);
//Create a key value hashmap from accumulated string list
}
}
but returns error:
expression required.
Any ideas about how we can achieve getbody with desired class in general? (Since the first split method returns a string list but I can't retrieve it in second split, or can I?)