Class ConditionExpression
- java.lang.Object
-
- com.adaptris.core.services.conditional.conditions.ConditionImpl
-
- com.adaptris.core.services.conditional.conditions.ConditionExpression
-
- All Implemented Interfaces:
ComponentLifecycle
,Condition
@ComponentProfile(summary="Tests a static algorithm for a boolean result.", tag="condition") public class ConditionExpression extends ConditionImpl
This
Condition
allows you to specify a boolean evaluated expression, with static values and resolved metadata values.If your expression evaluates to "true", then this condition passes.
Static values mixed with metadata values allow you to create boolean expressions, such as;
Example description Example Expression Is the metadata value identified by key "myKey" equal to the value 1 %message{myKey} == 1 Is the metadata value identified by key "myKey" equal to the metadata item "myOtherKey" %message{myKey} == %message{myOtherKey} Is the metadata value identified by key "myKey" greater than "myOtherKey" plus 100 %message{myKey} > (%message{myOtherKey} + 100) In the adapter configuration file this class is aliased as expression which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.services.conditional.conditions.ConditionImpl
log
-
-
Constructor Summary
Constructors Constructor Description ConditionExpression()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
evaluate(AdaptrisMessage msg)
java.lang.String
getAlgorithm()
void
setAlgorithm(java.lang.String algorithm)
ConditionExpression
withAlgorithm(java.lang.String s)
-
Methods inherited from class com.adaptris.core.services.conditional.conditions.ConditionImpl
getAdditionalLogging, logCondition, setAdditionalLogging
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init, start, stop
-
-
-
-
Method Detail
-
evaluate
public boolean evaluate(AdaptrisMessage msg) throws CoreException
- Throws:
CoreException
-
getAlgorithm
public java.lang.String getAlgorithm()
-
setAlgorithm
public void setAlgorithm(java.lang.String algorithm)
-
withAlgorithm
public ConditionExpression withAlgorithm(java.lang.String s)
-
-