com.bigbross.bossa.resource
Class Expression

java.lang.Object
  extended bycom.bigbross.bossa.resource.Expression
All Implemented Interfaces:
Container, Serializable

public abstract class Expression
extends Object
implements Container, Serializable

A node of one binary tree representing a compiled resource expression.

The set arithmetic operations are:

The operands are resource names.
Whitespace characters are ignored.
The expression is evaluated from left to right.
Parenthesis may be used to group subexpressions.

The resource is linked from the ResourceRegistry at the compilation time, and is created if needed. A $ may be used to delay the resource resolution to evaluation time, using a new ResourceRegistry.

A resource expression example is: sales - $request than means that only the users of the "sales" group minus the users that are in the "request" group provided in the evaluation moment are in this role.

Author:
BigBross Team
See Also:
ResourceRegistry, Serialized Form

Constructor Summary
Expression()
           
 
Method Summary
static Expression compile(ResourceRegistry registry, String expression)
          Compiles a resource expression.
 boolean contains(Resource resource)
          Determines if a resource is contained in this.
abstract  boolean contains(ResourceRegistry registry, Resource resource)
          Determines if a resource is contained in this.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Expression

public Expression()
Method Detail

compile

public static Expression compile(ResourceRegistry registry,
                                 String expression)
Compiles a resource expression.

Parameters:
registry - a ResourceRegistry to link the resources in the expression.
expression - the resource expression to be compiled.
Returns:
a Expression representing the compiled resource expression.

contains

public boolean contains(Resource resource)
Determines if a resource is contained in this.

Specified by:
contains in interface Container
Parameters:
resource - the resource to be looked for.
Returns:
true if the resource is found, false otherwise.

contains

public abstract boolean contains(ResourceRegistry registry,
                                 Resource resource)
Determines if a resource is contained in this.

Parameters:
registry - a ResourceRegistry to resolve lazy referenced resource.
resource - the resource to be looked for.
Returns:
true if the resource is found, false otherwise.


Copyright © 2003,2004 OpenBR Sistemas S/C Ltda.