Package ndg :: Package xacml :: Package core :: Module attributevalue :: Class AttributeValueClassFactory
[hide private]

Class AttributeValueClassFactory

source code

object --+
         |
        AttributeValueClassFactory

Create AttributeValue types based on the XML namespace identifier

Convenience wrapper for IDENTIFIER2CLASS_MAP instance of AttributeValueClassMap

Instance Methods [hide private]
 
__init__(self, classMap=None)
Set a mapping object to map attribute value URIs to their implementations as classes
source code
NoneType / ndg.xacml.core.attributevalue.AttributeValue derived type
__call__(self, identifier)
Return <type>AttributeValue class for given identifier URI or None if no match is found
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
addClass(cls, identifier, attributeValueClass, overwrite=False)
Extend Default AttributeValue Class Map with custom types.
source code
Class Variables [hide private]
  IDENTIFIER2CLASS_MAP = {'urn:oasis:names:tc:xacml:1.0:data-typ...
Instance Variables [hide private]
ndg.xacml.core.attributevalue.AttributeValueClassMap __classMap
mapping object to map attribute value URIs to their implementations as classes
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, classMap=None)
(Constructor)

source code 

Set a mapping object to map attribute value URIs to their implementations as classes

Parameters:
  • classMap (ndg.xacml.core.attributevalue.AttributeValueClassMap) - input an alternative to the default class mapping object IDENTIFIER2CLASS_MAP, if None, it will default to this setting
Overrides: object.__init__

__call__(self, identifier)
(Call operator)

source code 

Return <type>AttributeValue class for given identifier URI or None if no match is found

Returns: NoneType / ndg.xacml.core.attributevalue.AttributeValue derived type
attribute value class

addClass(cls, identifier, attributeValueClass, overwrite=False)
Class Method

source code 

Extend Default AttributeValue Class Map with custom types. This enables the policy to support additional attribute types

Parameters:
  • identifier (ndg.xacml.core.attributevalue.AttributeValueClassMap) - ID for candidate Attribute Value class
  • attributeValueClass (ndg.xacml.core.attributevalue.AttributeValue) - new Attribute Value class to be added
  • overwrite (bool) - set to True to allow overwriting of existing map entries, defaults to disable overwrite

Class Variable Details [hide private]

IDENTIFIER2CLASS_MAP

Value:
{'urn:oasis:names:tc:xacml:1.0:data-type:x500Name': <class 'abc.X500Na\
meAttributeValue'>, 'urn:oasis:names:tc:xacml:2.0:data-type:dnsName': \
<class 'abc.DnsNameAttributeValue'>, 'http://www.w3.org/2001/XMLSchema\
#string': <class 'abc.StringAttributeValue'>, 'http://www.w3.org/TR/20\
02/WD-xquery-operators-20020816#yearMonthDuration': <class 'abc.YearMo\
nthDurationAttributeValue'>, 'urn:oasis:names:tc:xacml:1.0:data-type:r\
fc822Name': <class 'abc.Rfc822NameAttributeValue'>, 'http://www.w3.org\
/2001/XMLSchema#integer': <class 'abc.IntegerAttributeValue'>, 'http:/\
...