| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
package org.apache.camel.model; |
| 18 |
|
|
| 19 |
|
import javax.xml.bind.annotation.XmlAccessType; |
| 20 |
|
import javax.xml.bind.annotation.XmlAccessorType; |
| 21 |
|
import javax.xml.bind.annotation.XmlRootElement; |
| 22 |
|
|
| 23 |
|
import org.apache.camel.Expression; |
| 24 |
|
import org.apache.camel.Processor; |
| 25 |
|
import org.apache.camel.impl.RouteContext; |
| 26 |
|
import org.apache.camel.model.language.ExpressionType; |
| 27 |
|
import org.apache.camel.processor.Splitter; |
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
@XmlRootElement(name = "splitter") |
| 33 |
|
@XmlAccessorType(XmlAccessType.FIELD) |
| 34 |
|
public class SplitterType extends ExpressionNode { |
| 35 |
3 |
public SplitterType() { |
| 36 |
3 |
} |
| 37 |
|
|
| 38 |
|
public SplitterType(Expression expression) { |
| 39 |
6 |
super(expression); |
| 40 |
6 |
} |
| 41 |
|
|
| 42 |
|
public SplitterType(ExpressionType expression) { |
| 43 |
0 |
super(expression); |
| 44 |
0 |
} |
| 45 |
|
|
| 46 |
|
@Override |
| 47 |
|
public String toString() { |
| 48 |
15 |
return "Splitter[ " + getExpression() + " -> " + getOutputs() + "]"; |
| 49 |
|
} |
| 50 |
|
|
| 51 |
|
@Override |
| 52 |
|
public Processor createProcessor(RouteContext routeContext) throws Exception { |
| 53 |
6 |
Processor childProcessor = routeContext.createProcessor(this); |
| 54 |
6 |
return new Splitter(getExpression().createExpression(routeContext), childProcessor); |
| 55 |
|
} |
| 56 |
|
} |