Interface Language
public interface Language
SPI base for every Camel expression and predicate language.
Implementations include
simple, groovy, jexl, mvel, xpath, jsonpath,
spel, and many others. They are resolved by name via
CamelContext.resolveLanguage(String), which first checks the Camel registry and then falls
back to the classpath service loader at
LanguageResolver.resolveLanguage(String, org.apache.camel.CamelContext). The two core factory methods —
createExpression(String) and createPredicate(String) — accept a text expression and return a
thread-safe, reusable instance. The overloaded Object[] variants allow passing pre-parsed language-specific
options (e.g., XPath namespace maps or tokenizer delimiters) to avoid repeated parsing overhead. All implementations
must be thread-safe because expressions and predicates are evaluated concurrently on multiple exchanges.
See Languages in the Camel user manual.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncreateExpression(String expression) Creates an expression based on only the given string inputdefault ExpressioncreateExpression(String expression, Object[] properties) Creates an expression based on the input with propertiescreatePredicate(String expression) Creates a predicate based on only the given string inputdefault PredicatecreatePredicate(String expression, Object[] properties) Creates an expression based on the input with properties
-
Method Details
-
createPredicate
-
createExpression
Creates an expression based on only the given string input- Parameters:
expression- the expression as a string input- Returns:
- the created expression
-
createPredicate
Creates an expression based on the input with propertiesThis is used for languages that have been configured with custom properties most noticeable for xpath/xquery/tokenizer languages that have several options.
- Parameters:
expression- the expressionproperties- configuration properties (optimized as object array with hardcoded positions for properties)- Returns:
- the created predicate
-
createExpression
Creates an expression based on the input with propertiesThis is used for languages that have been configured with custom properties most noticeable for xpath/xquery/tokenizer languages that have several options.
- Parameters:
expression- the expressionproperties- configuration properties (optimized as object array with hardcoded positions for properties)- Returns:
- the created expression
-