Ignore:
Timestamp:
31/03/10 16:41:23 (10 years ago)
Author:
pjkersha
Message:

Made ndg.xacml.core.expression.Expression abstract: derived classes must implement the evaluate method used to evaluate a result in a rule condition.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/NDG_XACML/ndg/xacml/core/expression.py

    r6770 r6792  
    1010__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    1111__revision__ = "$Id: $" 
     12from abc import ABCMeta, abstractmethod 
     13 
    1214from ndg.xacml.core import XacmlCoreBase 
    1315 
     
    1517class Expression(XacmlCoreBase): 
    1618    """XACML Expression type""" 
     19    __metaclass__ = ABCMeta 
    1720    ELEMENT_LOCAL_NAME = None 
    1821    DATA_TYPE_ATTRIB_NAME = 'DataType' 
     
    2124     
    2225    def __init__(self): 
     26        super(Expression, self).__init__() 
    2327        self.__dataType = None 
    2428         
     
    3539    dataType = property(_get_dataType, _set_dataType, None,  
    3640                        "expression value data type")   
    37            
     41     
     42    @abstractmethod 
     43    def evaluate(self, context): 
     44        """Evaluate the result of the expression in a condition.  Derived  
     45        classes must implement 
     46         
     47        @param context: the request context 
     48        @type context: ndg.xacml.core.context.request.Request 
     49        @return: attribute value(s) resulting from execution of this expression 
     50        in a condition 
     51        @rtype: AttributeValue/NoneType 
     52        """ 
     53        raise NotImplementedError() 
Note: See TracChangeset for help on using the changeset viewer.