public class SimpleLanguage extends LanguageSupport implements StaticService
SimpleDateFormat
patternsSimpleDateFormat
timezones and patternsBeanLanguage
PropertiesComponent
.
The locations parameter is optional and you can enter multiple locations separated with comma.
RESOURCE
Constructor and Description |
---|
SimpleLanguage()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
static void |
changeFunctionEndToken(String... endToken)
Change the end tokens used for functions.
|
static void |
changeFunctionStartToken(String... startToken)
Change the start tokens used for functions.
|
Expression |
createExpression(String expression)
Creates an expression based on the given string input
|
Expression |
createExpression(String expression,
Class<?> resultType) |
Predicate |
createPredicate(String expression)
Creates a predicate based on the given string input
|
static Expression |
expression(String expression)
Creates a new
Expression . |
static boolean |
hasSimpleFunction(String expression)
Does the expression include a simple function.
|
static Predicate |
predicate(String predicate)
Creates a new
Predicate . |
void |
setFunctionEndToken(String endToken)
Change the end token used for functions.
|
void |
setFunctionStartToken(String startToken)
Change the start token used for functions.
|
static Expression |
simple(String expression)
Creates a new
Expression . |
static Expression |
simple(String expression,
Class<?> resultType)
Creates a new
Expression (or Predicate
if the resultType is a Boolean, or boolean type). |
void |
start()
Starts the service
|
void |
stop()
Stops the service
|
getCamelContext, isSingleton, loadResource, setCamelContext
public SimpleLanguage()
public void start() throws Exception
Service
public void stop() throws Exception
Service
public Predicate createPredicate(String expression)
Language
createPredicate
in interface Language
expression
- the expressionpublic Expression createExpression(String expression)
Language
createExpression
in interface Language
expression
- the expression as a string inputpublic static Expression simple(String expression)
Expression
.
Important: If you need to use a predicate (function to return true|false) then use
predicate(String)
instead.public static Expression simple(String expression, Class<?> resultType)
Expression
(or Predicate
if the resultType is a Boolean, or boolean type).public Expression createExpression(String expression, Class<?> resultType)
public static Expression expression(String expression)
Expression
.
Important: If you need to use a predicate (function to return true|false) then use
predicate(String)
instead.public static boolean hasSimpleFunction(String expression)
expression
- the expressionpublic static void changeFunctionStartToken(String... startToken)
startToken
- new start token(s) to be used for functionspublic static void changeFunctionEndToken(String... endToken)
endToken
- new end token(s) to be used for functionspublic void setFunctionStartToken(String startToken)
startToken
- new start token to be used for functionspublic void setFunctionEndToken(String endToken)
endToken
- new end token to be used for functionsApache Camel