Package org.apache.camel.support.builder
Class ValueBuilder
java.lang.Object
org.apache.camel.support.builder.ValueBuilder
- All Implemented Interfaces:
org.apache.camel.Expression
,org.apache.camel.Predicate
public class ValueBuilder
extends Object
implements org.apache.camel.Expression, org.apache.camel.Predicate
A builder of expressions or predicates based on values.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAppends the string evaluation of this expression with the given valueprotected org.apache.camel.Expression
asExpression
(Object value) org.apache.camel.Predicate
Create a predicate that the left hand expression contains the value of the right hand expressionConverts the current value to the given type using the registered type convertersConverts the current value to a String using the registered type convertersorg.apache.camel.Predicate
<T> T
org.apache.camel.Expression
org.apache.camel.Predicate
org.apache.camel.Predicate
in
(org.apache.camel.Predicate... predicates) void
init
(org.apache.camel.CamelContext context) void
initPredicate
(org.apache.camel.CamelContext context) org.apache.camel.Predicate
org.apache.camel.Predicate
isEqualToIgnoreCase
(Object value) org.apache.camel.Predicate
isGreaterThan
(Object value) org.apache.camel.Predicate
isGreaterThanOrEqualTo
(Object value) org.apache.camel.Predicate
isInstanceOf
(Class<?> type) org.apache.camel.Predicate
isLessThan
(Object value) org.apache.camel.Predicate
isLessThanOrEqualTo
(Object value) org.apache.camel.Predicate
isNotEqualTo
(Object value) org.apache.camel.Predicate
org.apache.camel.Predicate
isNull()
boolean
matches
(org.apache.camel.Exchange exchange) Invokes the method with the given name (supports OGNL syntax).not()
Negates the built expression.org.apache.camel.Predicate
not
(org.apache.camel.Predicate predicate) protected org.apache.camel.Predicate
onNewPredicate
(org.apache.camel.Predicate predicate) A strategy method to allow derived classes to deal with the newly created predicate in different waysprotected ValueBuilder
onNewValueBuilder
(org.apache.camel.Expression exp) Prepends the string evaluation of this expression with the given valueorg.apache.camel.Predicate
Creates a predicate which is true if this expression matches the given regular expressionregexReplaceAll
(String regex, String replacement) Replaces all occurrences of the regular expression with the given replacementregexReplaceAll
(String regex, org.apache.camel.Expression replacement) Replaces all occurrences of the regular expression with the given replacementregexTokenize
(String regex) Tokenizes the string conversion of this expression using the given regular expressionsort
(Comparator<?> comparator) Sorts the current value using the given comparator.org.apache.camel.Predicate
startsWith
(Object value) tokenize()
toString()
-
Constructor Details
-
ValueBuilder
public ValueBuilder(org.apache.camel.Expression expression)
-
-
Method Details
-
init
public void init(org.apache.camel.CamelContext context) - Specified by:
init
in interfaceorg.apache.camel.Expression
- Specified by:
init
in interfaceorg.apache.camel.Predicate
-
initPredicate
public void initPredicate(org.apache.camel.CamelContext context) - Specified by:
initPredicate
in interfaceorg.apache.camel.Predicate
-
evaluate
- Specified by:
evaluate
in interfaceorg.apache.camel.Expression
-
matches
public boolean matches(org.apache.camel.Exchange exchange) - Specified by:
matches
in interfaceorg.apache.camel.Predicate
-
getExpression
public org.apache.camel.Expression getExpression() -
toString
-
isNotEqualTo
-
isEqualTo
-
isEqualToIgnoreCase
-
isLessThan
-
isLessThanOrEqualTo
-
isGreaterThan
-
isGreaterThanOrEqualTo
-
isInstanceOf
-
isNull
public org.apache.camel.Predicate isNull() -
isNotNull
public org.apache.camel.Predicate isNotNull() -
not
public org.apache.camel.Predicate not(org.apache.camel.Predicate predicate) -
in
-
in
public org.apache.camel.Predicate in(org.apache.camel.Predicate... predicates) -
startsWith
-
endsWith
-
contains
Create a predicate that the left hand expression contains the value of the right hand expression- Parameters:
value
- the element which is compared to be contained within this expression- Returns:
- a predicate which evaluates to true if the given value expression is contained within this expression value
-
regex
Creates a predicate which is true if this expression matches the given regular expression- Parameters:
regex
- the regular expression to match- Returns:
- a predicate which evaluates to true if the expression matches the regex
-
tokenize
-
tokenize
-
tokenize
-
tokenize
-
regexTokenize
Tokenizes the string conversion of this expression using the given regular expression -
regexReplaceAll
Replaces all occurrences of the regular expression with the given replacement -
regexReplaceAll
Replaces all occurrences of the regular expression with the given replacement -
convertTo
Converts the current value to the given type using the registered type converters- Parameters:
type
- the type to convert the value to- Returns:
- the current builder
-
convertToString
Converts the current value to a String using the registered type converters- Returns:
- the current builder
-
append
Appends the string evaluation of this expression with the given value- Parameters:
value
- the value or expression to append- Returns:
- the current builder
-
prepend
Prepends the string evaluation of this expression with the given value- Parameters:
value
- the value or expression to prepend- Returns:
- the current builder
-
sort
Sorts the current value using the given comparator. The current value must be convertable to aList
to allow sorting using the comparator.- Parameters:
comparator
- the comparator used by sorting- Returns:
- the current builder
-
method
Invokes the method with the given name (supports OGNL syntax).- Parameters:
methodName
- name of method to invoke.- Returns:
- the current builder
-
not
Negates the built expression.- Returns:
- the current builder
-
onNewPredicate
protected org.apache.camel.Predicate onNewPredicate(org.apache.camel.Predicate predicate) A strategy method to allow derived classes to deal with the newly created predicate in different ways -
asExpression
-
onNewValueBuilder
-