org.drools.semantics.java
Class JavaCondition

java.lang.Object
  extended by org.drools.semantics.java.JavaCondition
All Implemented Interfaces:
java.io.Serializable, SemanticComponent, SemanticCondition, SemanticInvokeable, SemanticRule, Condition, RuleComponent
Direct Known Subclasses:
GroovyCondition

public class JavaCondition
extends java.lang.Object
implements java.io.Serializable, Condition, SemanticCondition

Java expression semantics Condition.

See Also:
Serialized Form

Field Summary
protected  ConditionInvoker conditionInvoker
           
protected  java.lang.String expression
           
protected  java.lang.String name
           
protected  Declaration[] requiredDeclarations
           
protected  Rule rule
           
protected  java.lang.String semanticType
           
protected  java.lang.String thrownException
           
 
Constructor Summary
protected JavaCondition(java.lang.String name, java.lang.String expression, Declaration[] requiredDeclarations, Rule rule)
          Construct.
 
Method Summary
 boolean equals(java.lang.Object object)
           
 java.lang.String getName()
          Returns the name of the component
 Declaration[] getRequiredTupleMembers()
          Retrieve the Declaration s required for evaluating the expression.
 SemanticRuleCompiler getSemanticRuleCompiler()
           
 java.lang.String getSemanticType()
           
 java.lang.String getText()
           
 java.lang.String getThrownException()
           
 int hashCode()
           
 boolean isAllowed(Tuple tuple)
          Determine if the supplied Tuple is allowed by this condition.
 boolean isExceptionThrown()
           
 void setInvoker(Invoker invoker)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

semanticType

protected final java.lang.String semanticType
See Also:
Constant Field Values

name

protected final java.lang.String name

expression

protected final java.lang.String expression

rule

protected final Rule rule

requiredDeclarations

protected final Declaration[] requiredDeclarations

conditionInvoker

protected ConditionInvoker conditionInvoker

thrownException

protected final java.lang.String thrownException
See Also:
Constant Field Values
Constructor Detail

JavaCondition

protected JavaCondition(java.lang.String name,
                        java.lang.String expression,
                        Declaration[] requiredDeclarations,
                        Rule rule)
                 throws java.lang.Exception
Construct.

Parameters:
expression - The expression.
rule - The rule.
Throws:
javax.naming.ConfigurationException - If an error occurs while attempting to perform configuration.
java.lang.Exception
Method Detail

getSemanticType

public java.lang.String getSemanticType()
Specified by:
getSemanticType in interface SemanticComponent

isExceptionThrown

public boolean isExceptionThrown()
Specified by:
isExceptionThrown in interface SemanticInvokeable

getThrownException

public java.lang.String getThrownException()
Specified by:
getThrownException in interface SemanticInvokeable

getName

public java.lang.String getName()
Description copied from interface: SemanticComponent
Returns the name of the component

Specified by:
getName in interface SemanticComponent

getText

public java.lang.String getText()
Specified by:
getText in interface SemanticCondition

getRequiredTupleMembers

public Declaration[] getRequiredTupleMembers()
Retrieve the Declaration s required for evaluating the expression.

Specified by:
getRequiredTupleMembers in interface Condition
Returns:
The required declarations.

getSemanticRuleCompiler

public SemanticRuleCompiler getSemanticRuleCompiler()
Specified by:
getSemanticRuleCompiler in interface SemanticRule

setInvoker

public void setInvoker(Invoker invoker)
Specified by:
setInvoker in interface SemanticInvokeable

isAllowed

public boolean isAllowed(Tuple tuple)
                  throws ConditionException
Determine if the supplied Tuple is allowed by this condition.

Specified by:
isAllowed in interface Condition
Parameters:
tuple - The Tuple to test.
Returns:
true if the Tuple passes this condition, else false.
Throws:
ConditionException - if an error occurs during filtering.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object