Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/NDG_XACML/ndg/xacml/core/attribute.py@6747
Line | |
---|
1 | """NDG XACML attribute type definition |
---|
2 | |
---|
3 | NERC DataGrid Project |
---|
4 | """ |
---|
5 | __author__ = "P J Kershaw" |
---|
6 | __date__ = "25/02/10" |
---|
7 | __copyright__ = "(C) 2010 Science and Technology Facilities Council" |
---|
8 | __contact__ = "Philip.Kershaw@stfc.ac.uk" |
---|
9 | __license__ = "BSD - see LICENSE file in top-level directory" |
---|
10 | __contact__ = "Philip.Kershaw@stfc.ac.uk" |
---|
11 | __revision__ = "$Id: $" |
---|
12 | from ndg.xacml.core.expression import Expression |
---|
13 | |
---|
14 | |
---|
15 | class AttributeValue(Expression): |
---|
16 | """XACML Attribute Value type""" |
---|
17 | ELEMENT_LOCAL_NAME = 'AttributeValue' |
---|
18 | __slots__ = ('__value',) |
---|
19 | |
---|
20 | def __init__(self): |
---|
21 | super(AttributeValue, self).__init__() |
---|
22 | self.__value = None |
---|
23 | |
---|
24 | def _get_value(self): |
---|
25 | return self.__value |
---|
26 | |
---|
27 | def _set_value(self, value): |
---|
28 | if not isinstance(value, basestring): |
---|
29 | raise TypeError('Expecting %r type for "value" ' |
---|
30 | 'attribute; got %r' % (basestring, type(value))) |
---|
31 | |
---|
32 | self.__value = value |
---|
33 | |
---|
34 | value = property(_get_value, _set_value, None, "expression value") |
---|
Note: See
TracBrowser
for help on using the repository browser.