|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object issrg.pba.rbac.xmlpolicy.ifstatement.StringInterpreter
public class StringInterpreter
This is the interpreter for comparisons of strings in the IF-statements. It provides the following semantics:
Field Summary | |
---|---|
static int |
EQ_MODE
|
static int |
GE_MODE
|
static int |
GT_MODE
|
static int |
LE_MODE
|
static int |
LT_MODE
|
protected int |
mode
|
static int |
SUBSTRINGS_MODE
|
Constructor Summary | |
---|---|
protected |
StringInterpreter()
|
protected |
StringInterpreter(int mode)
This is the constructor used to build the interpreter for different types of comparison operation: an interpreter for Substrings, GE, LE, GT, LT and EQ correspondingly. |
Method Summary | |
---|---|
java.lang.String |
canEvaluate(Term[] t)
This method tells whether this interpreter can evaluate the expression, which is only if there are only two Terms, and both are of type Types.STRING_TYPE. |
java.lang.Object |
evaluate(Environment env,
Term[] t)
This method evaluates the comparison expression, depending on the mode it was given at construction time. |
static void |
register()
Call this method to register the IntegerInterpreter with the relevant expression nodes: EqNode, GeNode, GtNode, LeNode, LtNode, SubstringsNode. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int mode
public static final int EQ_MODE
public static final int GE_MODE
public static final int LE_MODE
public static final int GT_MODE
public static final int LT_MODE
public static final int SUBSTRINGS_MODE
Constructor Detail |
---|
protected StringInterpreter()
protected StringInterpreter(int mode)
mode
- stands for the mode of operation; it can be one of
SUBSTRINGS_MODE,
EQ_MODE, GE_MODE, LE_MODE, GT_MODE or LT_MODEMethod Detail |
---|
public static void register()
public java.lang.String canEvaluate(Term[] t)
canEvaluate
in interface Interpreter
t
- - the array of Terms to be evaluated
public java.lang.Object evaluate(Environment env, Term[] t) throws EvaluationException
evaluate
in interface Interpreter
env
- - the Environment in which the evaluation occurst
- - the array of Terms to be evaluated; should contain two and only
two Terms, each of type Types.STRING_TYPE
EvaluationException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |