if (showBody) {
final Function1 function = new Function1() {
@Override
public Object apply(Object element) {
if (element instanceof IExchange) {
IExchange exchange = (IExchange) element;
String answer = MessageUIHelper.getBody(exchange);
if (answer != null) {
// lets replace newlines
return answer.replace('\n', ' ');
}
}
return null;
}
};
column = addColumnFunction(bounds, column, function, "Message Body");
}
SortedSet<String> headers = new TreeSet<String>();
for (IExchange exchange : exchanges) {
IMessage in = exchange.getIn();
if (in != null) {
headers.addAll(in.getHeaders().keySet());
}
}
for (final String header : headers) {
final Function1 function = new Function1() {
@Override
public Object apply(Object element) {
if (element instanceof IExchange) {
IExchange exchange = (IExchange) element;
IMessage in = exchange.getIn();
if (in != null) {
return in.getHeaders().get(header);
}
}
return null;