Class StringExpression
Expression that evaluates a string expression template via .
Supports ${...} template interpolation and raw expression strings.
Unifies the two expression worlds: typed objects and string-based
${...} templates. Inherits all predicate methods from
(isEqualTo, contains, isGreaterThan, etc.), so string expressions can be used anywhere
an is expected.
// In RouteBuilder:
.SetBody(Expr("${header.source}"))
.Filter(Expr("${header.amount}").isGreaterThan(1000))
.SetHeader("full", Expr("${header.first} ${header.last}"))
public sealed class StringExpression : Expression, IExpression
Inheritance
Implements
Inherited Members
Properties
Methods
Evaluate<T>(IExchange)
Evaluates the expression and returns the result cast to T.
public override T Evaluate<T>(IExchange exchange)
SetValue(IExchange, object)
String expressions are read-only — they compute a value but have no target to write to.
public override void SetValue(IExchange exchange, object value)
ToTemplateString()
Serializes this expression to a ${...} template string suitable for URI parameters.
public override string ToTemplateString()
Constructors
StringExpression(string)
Initializes a new instance with the specified expression template.