issrg.pba.rbac.xmlpolicy.ifstatement
Class EqNode

java.lang.Object
  extended by issrg.pba.rbac.xmlpolicy.PolicyXMLNode
      extended by issrg.pba.rbac.xmlpolicy.ifstatement.TermNode
          extended by issrg.pba.rbac.xmlpolicy.ifstatement.OperationNode
              extended by issrg.pba.rbac.xmlpolicy.ifstatement.EqNode
All Implemented Interfaces:
Term

public class EqNode
extends OperationNode

This is the class for EQ node of the IF-statement. Its functionality is very much determined by OperationNode and EqInterpreter, which are configured to deliver the following semantics:

This operation expects two and only two Terms of the same type, and returns a value of type Types.BOOLEAN_TYPE. The evaluation result is "true", if and only if calling equals() method on the first term returns boolean "true".

It is possible to register equality interpreters for specific combinations of Terms, which will be used in preference to the default EqInterpreter. Use registerInterpreter method to do that.

Author:
A.Otenko
See Also:
registerInterpreter(issrg.pba.rbac.xmlpolicy.ifstatement.Interpreter)

Field Summary
static java.lang.String EQ_NODE
           
 
Fields inherited from class issrg.pba.rbac.xmlpolicy.ifstatement.OperationNode
interpreter, type
 
Fields inherited from class issrg.pba.rbac.xmlpolicy.ifstatement.TermNode
maxOperand, minOperand, terms
 
Fields inherited from class issrg.pba.rbac.xmlpolicy.PolicyXMLNode
attributes, children, name, nodeStr
 
Constructor Summary
protected EqNode()
           
  EqNode(XMLPolicyParser p, org.xml.sax.Attributes attrs)
          This constructor builds an EqNode given the XMLPolicyParser and the set of attributes of this XML element.
 
Method Summary
static void register()
          Call this method to register the EqNode with the XMLPolicyParser.
static void registerInterpreter(Interpreter i)
          This method maintains a register of interpreters for specific combinations of Terms.
 
Methods inherited from class issrg.pba.rbac.xmlpolicy.ifstatement.OperationNode
construct, evaluate, getType
 
Methods inherited from class issrg.pba.rbac.xmlpolicy.ifstatement.TermNode
getInterpretersForNode, registerInterpreterForNode
 
Methods inherited from class issrg.pba.rbac.xmlpolicy.PolicyXMLNode
addChild, addString, getAttributes, getChildren, getName, getString, toString, toXML, toXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EQ_NODE

public static final java.lang.String EQ_NODE
See Also:
Constant Field Values
Constructor Detail

EqNode

protected EqNode()

EqNode

public EqNode(XMLPolicyParser p,
              org.xml.sax.Attributes attrs)
This constructor builds an EqNode given the XMLPolicyParser and the set of attributes of this XML element. It expects that there are two and only two child nodes.

Parameters:
p - - the XMLPolicyParser that builds this EqNode
attr - - the attributes of this XML element
Method Detail

register

public static void register()
Call this method to register the EqNode with the XMLPolicyParser. It also registers the default EqInterpreter.


registerInterpreter

public static void registerInterpreter(Interpreter i)
This method maintains a register of interpreters for specific combinations of Terms. If no special interpreters are registered, the default one is used, as described above.

Parameters:
i - - the Interpreter instance that can evaluate equality expression for some combination of Terms