Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.yajre.semantic.java
Class BeanShellFilterCondition  view BeanShellFilterCondition download BeanShellFilterCondition.java

java.lang.Object
  extended byorg.yajre.semantic.java.BeanShellFilterCondition
All Implemented Interfaces:
org.yajre.spi.Condition, org.yajre.spi.FilterCondition

public final class BeanShellFilterCondition
extends java.lang.Object
implements org.yajre.spi.FilterCondition

org.yajre.spi.FilterCondition using BeanShell for evaluation.


Field Summary
private  java.lang.String filterExpr
          The BeanShell expression.
private  org.yajre.spi.Declaration[] requiredTupleMembers
          Variables referenced by the expression.
 
Constructor Summary
BeanShellFilterCondition(java.lang.String expr, java.util.Set members)
          The expression used to construct this must produce a boolean result, else a NonBooleanExpressionException will be thrown at run-time.
 
Method Summary
 java.lang.String getFilterExpr()
          Retrieve the BeanShell filtering expression.
 org.yajre.spi.Declaration[] getRequiredTupleMembers()
          Retrieve the array of org.yajre.spi.Declarations required by this condition to perform its duties.
 boolean isAllowed(org.yajre.spi.Tuple tuple, org.yajre.WorkingMemory session)
          Determine if the supplied org.yajre.spi.Tuple is allowed by this filter.
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

filterExpr

private java.lang.String filterExpr
The BeanShell expression.


requiredTupleMembers

private org.yajre.spi.Declaration[] requiredTupleMembers
Variables referenced by the expression.

Constructor Detail

BeanShellFilterCondition

public BeanShellFilterCondition(java.lang.String expr,
                                java.util.Set members)
The expression used to construct this must produce a boolean result, else a NonBooleanExpressionException will be thrown at run-time.

Method Detail

getFilterExpr

public java.lang.String getFilterExpr()
Retrieve the BeanShell filtering expression.


getRequiredTupleMembers

public org.yajre.spi.Declaration[] getRequiredTupleMembers()
Description copied from interface: org.yajre.spi.Condition
Retrieve the array of org.yajre.spi.Declarations required by this condition to perform its duties.

Specified by:
getRequiredTupleMembers in interface org.yajre.spi.FilterCondition

isAllowed

public boolean isAllowed(org.yajre.spi.Tuple tuple,
                         org.yajre.WorkingMemory session)
                  throws org.yajre.spi.FilterException
Description copied from interface: org.yajre.spi.FilterCondition
Determine if the supplied org.yajre.spi.Tuple is allowed by this filter.

Specified by:
isAllowed in interface org.yajre.spi.FilterCondition

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).