(Adobe® Flex™ Data Services 2 only)
Packagemx.data.utils
Classpublic class Managed
InheritanceManaged Inheritance Object

Provides utility methods for DataService managed objects. These methods make developing compliant managed objects simpler. This class is also used by the code generated by the MXML compiler when using the [Managed] class metadata tag.



Public Properties
 PropertyDefined by
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
Public Methods
 MethodDefined by
  
[static]
Managed
  
[static] Returns the destination the specified object is associated with.
Managed
  
getProperty(obj:IManaged, property:String, value:*):*
[static] This method is used to retreive the a property from a managed object.
Managed
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
  
setProperty(obj:IManaged, property:Object, oldValue:*, newValue:*):void
[static] This method is used to set the property of a managed object.
Managed
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Method detail
createUpdateEvent()method
public static function createUpdateEvent(obj:IManaged, property:Object, event:PropertyChangeEvent):PropertyChangeEventParameters
obj:IManaged
 
property:Object
 
event:PropertyChangeEvent

Returns
PropertyChangeEvent
getDestination()method 
public static function getDestination(obj:Object):String

Returns the destination the specified object is associated with.

Parameters
obj:Object — Object reference to the item to get the destination from.

Returns
String
getProperty()method 
public static function getProperty(obj:IManaged, property:String, value:*):*

This method is used to retreive the a property from a managed object. In addition to returning the vlaue of the property specified this method will handle keeping related artifacts in sync to support both deeply nested event dispatching and lazy loaded properties.

Parameters
obj:IManaged — IManaged reference to the object on which the desired property should be retreived from.
 
property:String — String containing the name of the desired property.
 
value:* — any reference to the current value of the property.

Returns
* — the new normalized value of the property. This value should be assigned to the original reference.

See also


Example
   public class Customer implements IManaged
   {
      private var _addresses:ArrayCollection;
      public function get addresses():ArrayCollection
      {
          _addresses = Managed.getProperty(this, "addresses", _addresses);
      }
  
      public function set addresses(value:ArrayCollection):void
      {
          Managed.setProperty(this, "addresses", _addresses, _addresses = value);
      }
   }
   

setProperty()method 
public static function setProperty(obj:IManaged, property:Object, oldValue:*, newValue:*):void

This method is used to set the property of a managed object. In addition to setting the vlaue of the property specified, this method will handle keeping related artifacts in sync and clean up any deeply nested event dispatching and lazy loaded properties.

Parameters
obj:IManaged — IManaged reference to the managed object that the property will be set on
 
property:Object — Object containing the name of the property that will be set. Typically this is a String value but can be a QName.
 
oldValue:* — reference to the previous value of the property.
 
newValue:* — reference to the new value of the property

See also


Example
   public class Customer implements IManaged
   {
      private var _addresses:ArrayCollection;
      public function get addresses():ArrayCollection
      {
          _addresses = Managed.getProperty(this, "addresses", _addresses);
      }
  
      public function set addresses(value:ArrayCollection):void
      {
          Managed.setProperty(this, "addresses", _addresses, _addresses = value);
      }
   }
   





 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flex/2/langref/mx/data/utils/Managed.html