I have a the following class;
class X {
private String name = "MyName";
public void setName( String name ) {
this.name = name;
}
public String getName() {
return name;
}
}
and if I have a copy or object of this class in a body of a camel exchange, how can I call the method getName() from within a camel route?
Is it possible?
I am trying to set a property in the exchange with the value that the getName method returns?
Something like the following?
from ( "...." )
.setProperty( "name" ).body(X.class).getName()
;
See the simple language (the OGNL section)
http://camel.apache.org/simple
Or use any of the scripting languages such as Groovy, OGNL, Mvel: