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:*, useHierarchicalValues:Boolean = true):*
[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
  
toString(value:Object, namespaceURIs:Array = null, exclude:Array = null, indent:int = 0, printTypes:Boolean = false, refs:Dictionary = null):String
[static]
Managed
 Inherited
Returns the primitive value of the specified object.
Object
Method Detail
compare()method
mx_internal static function compare(a:Object, b:Object, depth:int = -1, excludes:Array = null):int

ObjectUtil.compare currently has a problem when you are comparing objects which have been serialized. We commonly use "uid" as an instance identifier so it is unique for each instance. But by definition, compare should compare two groups with the same property sets as equal. When we get a copy of the same object from fill parameters which are sent to the server and received back, the instances have different UIDs and do not compare as the same. We are then unable to update those collections from the server. We probably should move this code to the SDK and just update that version of ObjectUtil.compare but until we get one method which works for everyone we can keep an internal copy here.

Parameters

a:Object
 
b:Object
 
depth:int (default = -1)
 
excludes:Array (default = null)

Returns
int
createUpdateEvent()method 
public static function createUpdateEvent(obj:IManaged, property:Object, event:PropertyChangeEvent):PropertyChangeEvent

Parameters

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:*, useHierarchicalValues:Boolean = true):*

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

Parameters

obj:IManaged — IManaged reference to the object on which the desired property should be retrieved from.
 
property:String — String containing the name of the desired property.
 
value:* — any reference to the current value of the property.
 
useHierarchicalValues:Boolean (default = true)

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);
      }
   }
   
toString()method 
public static function toString(value:Object, namespaceURIs:Array = null, exclude:Array = null, indent:int = 0, printTypes:Boolean = false, refs:Dictionary = null):String

Parameters

value:Object
 
namespaceURIs:Array (default = null)
 
exclude:Array (default = null)
 
indent:int (default = 0)
 
printTypes:Boolean (default = false)
 
refs:Dictionary (default = null)

Returns
String




 

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

Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/common/langref/mx/data/utils/Managed.html