issrg.pba.rbac.xmlpolicy.ifstatement
Class OperatorNode
java.lang.Object
issrg.pba.rbac.xmlpolicy.PolicyXMLNode
issrg.pba.rbac.xmlpolicy.ifstatement.TermNode
issrg.pba.rbac.xmlpolicy.ifstatement.OperationNode
issrg.pba.rbac.xmlpolicy.ifstatement.OperatorNode
- All Implemented Interfaces:
- Term
public class OperatorNode
- extends OperationNode
This is the class for Operator node of the IF-statement. Its functionality is
very much determined by OperationNode, which is
configured to deliver the following semantics:
This operation expects no or any number of Terms of any type, and
returns a
value of type determined by the matching Interpreter.
There must be an interpreter for
the required set of Terms, and it implements the semantics of the evaluation.
It is possible to register the interpreters for specific
combinations of Terms. Use registerOperatorInterpreter method to do that.
There is no default Interpreter.
- Author:
- A.Otenko
- See Also:
registerOperatorInterpreter(java.lang.String, issrg.pba.rbac.xmlpolicy.ifstatement.Interpreter)
Constructor Summary |
protected |
OperatorNode()
|
|
OperatorNode(XMLPolicyParser p,
org.xml.sax.Attributes attrs)
This constructor builds a OperatorNode given the XMLPolicyParser and the
set of
attributes of this XML element. |
Method Summary |
static void |
register()
This method should be called to register the node with the XML Parser |
static void |
registerOperatorInterpreter(java.lang.String name,
Interpreter i)
This method maintains a register of interpreters for specific combinations
of Terms for the specified operator. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
OPERATOR_NODE
public static final java.lang.String OPERATOR_NODE
- See Also:
- Constant Field Values
OperatorNode
protected OperatorNode()
OperatorNode
public OperatorNode(XMLPolicyParser p,
org.xml.sax.Attributes attrs)
throws PolicyParsingException
- This constructor builds a OperatorNode given the XMLPolicyParser and the
set of
attributes of this XML element. It expects that there are no or many
child nodes. It expects there is a
issrg.pba.rbac.xmlpolicy.XMLTags.NAME_ATTRIBUTE ("Name") attribute in this
XML element.
- Parameters:
p
- - the XMLPolicyParser that builds this LtNodeattrs
- - the attributes of this XML element
- Throws:
PolicyParsingException
- if there is no
issrg.pba.rbac.xmlpolicy.XMLTags.NAME_ATTRIBUTE in this XML element
register
public static void register()
- This method should be called to register the node with the XML Parser
registerOperatorInterpreter
public static void registerOperatorInterpreter(java.lang.String name,
Interpreter i)
- This method maintains a register of interpreters for specific combinations
of Terms for the specified operator. If no special interpreters are
registered, the evaluation error
occurs. The semantics of the interpreters ensure the semantics of
evaluation of the operator.
- Parameters:
name
- - the operator namei
- - the Interpreter instance that can evaluate the expression
for some combination of Terms- See Also:
Interpreter.evaluate(issrg.pba.rbac.xmlpolicy.ifstatement.Environment, issrg.pba.rbac.xmlpolicy.ifstatement.Term[])