Package muntjac :: Package data :: Package util :: Module object_property :: Class ObjectProperty
[hide private]
[frames] | no frames]

Class ObjectProperty

source code

                            object --+        
                                     |        
                    property.IProperty --+    
                                         |    
                            object --+   |    
                                     |   |    
         property.IValueChangeNotifier --+    
                                         |    
                            object --+   |    
                                     |   |    
property.IReadOnlyStatusChangeNotifier --+    
                                         |    
        abstract_property.AbstractProperty --+
                                             |
                                            ObjectProperty

A simple data object containing one typed value. This class is a straightforward implementation of the the IProperty interface.


Authors:
Vaadin Ltd., Richard Lincoln

Version: 1.1.2

Instance Methods [hide private]
 
__init__(self, value, typ=None, readOnly=None)
Creates a new instance of ObjectProperty with the given value, type and read-only mode status.
source code
 
getType(self)
Returns the type of the ObjectProperty.
source code
 
getValue(self)
Gets the value stored in the Property.
source code
 
setValue(self, newValue)
Sets the value of the property.
source code

Inherited from abstract_property.AbstractProperty: __str__, addCallback, addListener, fireReadOnlyStatusChange, fireValueChange, getCallbacks, getListeners, isReadOnly, removeCallback, removeListener, setReadOnly

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

Instance Variables [hide private]
  _value
The value contained by the Property.
  _type
Data type of the Property's value.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, value, typ=None, readOnly=None)
(Constructor)

source code 

Creates a new instance of ObjectProperty with the given value, type and read-only mode status.

Any value of type Object is accepted, see ObjectProperty.

Parameters:
  • value - the Initial value of the property.
  • typ - the type of the value. value must be assignable to this type.
  • readOnly - Sets the read-only mode.
Overrides: object.__init__

getType(self)

source code 

Returns the type of the ObjectProperty. The methods getValue and setValue must be compatible with this type: one must be able to safely cast the value returned from getValue to the given type and pass any variable assignable to this type as an argument to setValue.

Returns:
type of the Property
Overrides: property.IProperty.getType

getValue(self)

source code 

Gets the value stored in the Property.

Returns:
the value stored in the Property
Overrides: property.IProperty.getValue

setValue(self, newValue)

source code 

Sets the value of the property. This method supports setting from str if either str is directly assignable to property type, or the type class contains a string constructor.

Parameters:
  • newValue - the New value of the property.
Raises:
Overrides: property.IProperty.setValue