Adobe® Flex® 4 Language Reference
Hide Packages and Classes List |  Packages  |  Classes  |  Index  |  Appendixes
mx.data.utils 
Managed 
Packagemx.data.utils
Classpublic class Managed
InheritanceManaged Inheritance Object

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

The Managed class 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] Creates a new PropertyChangeEvent object from an existing PropertyChangeEvent object.
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 retrieve 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
  
[static] Returns false if the property on the item specified has not yet been fetched from the server.
Managed
 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 this object, formatted according to locale-specific conventions.
Object
  
toString(value:Object, namespaceURIs:Array = null, exclude:Array = null, indent:int = 0, printTypes:Boolean = false, refs:Dictionary = null):String
[static] Returns a String representation of this managed object.
Managed
 Inherited
Returns the primitive value of the specified object.
Object
Public Constants
 ConstantDefined By
  UNSET_PROPERTY : String = "__UNSET__"
[static] Metadata constant representing properties that have been un-set.
Managed
Method Detail

createUpdateEvent

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

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

Creates a new PropertyChangeEvent object from an existing PropertyChangeEvent object. The value of the property property of the new object is the value of the property argument prepended to event.property.

Parameters

obj:IManaged — IManaged reference to the object on which the desired property should be retrieved from.
 
property:Object — String containing the name of the desired property.
 
event:PropertyChangeEvent — A PropertyChangeEvent to copy.

Returns
PropertyChangeEvent — A new PropertyChangeEvent object with the value of the property argument prepended to event.property.

getDestination

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

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

Returns the destination the specified object is associated with.

Parameters

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

Returns
String — String containing the name of the associated destination.

getProperty

()method 
public static function getProperty(obj:IManaged, property:String, value:*, useHierarchicalValues:Boolean = true):*

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This method is used to retrieve 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  ( How to use this 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);
         }
      }
      

propertyFetched

()method 
public static function propertyFetched(obj:Object, property:String):Boolean

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

Returns false if the property on the item specified has not yet been fetched from the server.

Parameters

obj:Object — Object reference to the item to check.
 
property:String — The property.

Returns
Booleanfalse if the property on the item specified has not yet been fetched from the server.

setProperty

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

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

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  ( How to use this 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

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

Returns a String representation of this managed object.

Parameters

value:Object — managed object instance.
 
namespaceURIs:Array (default = null) — array of strings representing all namespaces that should be included in the output.
 
exclude:Array (default = null) — array of strings representing the property names that should be excluded from the output.
 
indent:int (default = 0) — number of spaces used to indent each line of the output.
 
printTypes:Boolean (default = false) — type names are included in the output when true.
 
refs:Dictionary (default = null) — dictionary used to avoid infinite looping when circular references are present.

Returns
String — a String representation of this managed object.
Constant Detail

UNSET_PROPERTY

Constant
public static const UNSET_PROPERTY:String = "__UNSET__"

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

Metadata constant representing properties that have been un-set.