Packagecom.lafabrick.reflex.ioc
Classpublic class XMLObjectConverter

Object / Xml / Object converter


Example

Conversion of an object in XML

  
  var dataXml:String = XMLObjectConverter.objectToXml( monObject );
  

Conversion of a XML in object

  
  var xml:String = 
      '<object id="remoting" className="mx.rpc.remoting.mxml.RemoteObject">' + 
          '<property name="destination" className="String">javaFacade</property>' + 
          '<property name="showBusyCursor" className="Boolean">true</property>' + 
      '</object>'; 
  
  var object:RemoteObject = XMLObjectConverter.XmlToObject( xml ) as RemoteObject;
  



Public Methods
 MethodDefined by
  
objectToXml(object:IocObject):String
[static] Convert an Object of type BaseContentObject in XML
XMLObjectConverter
  
XmlToObject(data:String):Object
[static] Converte a XML in typified Object.
XMLObjectConverter
Method detail
objectToXml()method
public static function objectToXml(object:IocObject):String

Convert an Object of type BaseContentObject in XML

Parameters
object:IocObject — object has to convert in XML.

Returns
String — the XML conversion

See also


Example

Conversion of an object " myObject" in xml.

   
   
   var dataXml:String = XMLObjectConverter.objectToXml( myObject );
   

XmlToObject()method 
public static function XmlToObject(data:String):Object

Converte a XML in typified Object.

Parameters
data:String — XML String xml to convert

Returns
Object — A strongly typified object

Example

Conversion of an XML RemoteObject in Object (type RemoteObjects)

   
   
   var xml:String = 
       '<object id="remoting" className="mx.rpc.remoting.mxml.RemoteObject">' + 
           '<property name="destination" className="String">javaFacade</property>' + 
           '<property name="showBusyCursor" className="Boolean">true</property>' + 
       '</object>'; 
   
   var object:RemoteObject = XMLObjectConverter.XmlToObject( xml ) as RemoteObject;