com.gridsystems.beanfilter
Class Filter

java.lang.Object
  extended by com.gridsystems.beanfilter.Filter

public class Filter
extends java.lang.Object

Agent filter.

Version:
1.0
Author:
Rodrigo Ruiz

Constructor Summary
Filter(java.lang.String expr, java.lang.Class<?> c)
          Creates a new instance.
 
Method Summary
 boolean eval(java.lang.Object src)
          Evaluates the filter.
 java.lang.String getExpr()
          Gets the filter expression.
 java.lang.String getFormattedExpr()
          For DEBUG purposes.
 void setExpr(java.lang.String expr)
          Modifies this filter expression.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Filter

public Filter(java.lang.String expr,
              java.lang.Class<?> c)
       throws EvalException
Creates a new instance.

Parameters:
expr - The filter expression
c - The class to filter
Throws:
EvalException - If a syntax error is found in expr
Method Detail

eval

public boolean eval(java.lang.Object src)
             throws EvalException
Evaluates the filter.

Parameters:
src - The data source to filter
Returns:
true if the filter allows access to the agent
Throws:
EvalException - If a syntax error is detected

getExpr

public java.lang.String getExpr()
Gets the filter expression.

Returns:
The filter expression

setExpr

public void setExpr(java.lang.String expr)
             throws EvalException
Modifies this filter expression.

Parameters:
expr - The new expression
Throws:
EvalException - If a syntax error is detected

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

getFormattedExpr

public java.lang.String getFormattedExpr()
For DEBUG purposes.

Returns:
Formatted Expression


Copyright © 2007-2008 Grid Systems, S.A.. All Rights Reserved.