Packagecom.asfusion.mate.core
Classpublic class EventMap
InheritanceEventMap Inheritance flash.events.EventDispatcher
ImplementsIEventMap, mx.core.IMXMLObject
SubclassesLocalEventMap

A fundamental part of Mate is the EventMap tag which allows you define mappings for the events that your application creates. It is basically a list of IActionList blocks, where each block matches an event type (if the block is an EventHandlers).


Example
     <EventMap
           xmlns:mx="http://www.adobe.com/2006/mxml"
           xmlns:mate="http://mate.asfusion.com/">
  
           <EventHandlers type="myEventType">
                ... here what you want to happen when this event is dispatched...
           </EventHandlers>
  
  </EventMap>
     



Public Properties
 PropertyDefined by
  cache : String
String that indicates whether the event maps will use a global or a local cache.
EventMap
  currentEvent : *
[read-only] It refers to the currentEvent that made the action-list (or inner-action-list) execute.
EventMap
  data : *
[read-only] Every IActionList contains a placeholder object called data.
EventMap
  event : *
[read-only] It refers to the event that made the EventHandlers execute.
EventMap
  fault : *
[read-only] It refers to the fault returned by a service that made the inner-action-list (faultHandlers) execute.
EventMap
  globalDispatcher : IEventDispatcher
[read-only]
EventMap
  lastReturn : *
[read-only] lastReturn is always available, although its value might be null.
EventMap
  message : *
[read-only] It refers to the message received that made the MessageHandlers execute.
EventMap
  resultObject : *
[read-only] It refers to the result returned by a service that made the inner-action-list (resultHandlers) execute.
EventMap
  scope : *
[read-only] It refers to the scope of the IActionList.
EventMap
Protected Properties
 PropertyDefined by
  _cache : String = "global"
EventMap
  cacheCollection : Dictionary
EventMap
  document : Object
A reference to the document object associated with this EventMap.
EventMap
Public Methods
 MethodDefined by
  
getCacheCollection():Dictionary
Method that returns of the local cache dictionary that will be used to store objects created by the mate framework.
EventMap
  
getCached(template:Class, cacheType:String, autoCreate:Boolean = true, registerTarget:Boolean = false, constructorArguments:Array = null):*
Function to get cached instances from the framework.
EventMap
  
getDispatcher():IEventDispatcher
Returns an event dispatcher.
EventMap
  
initialized(document:Object, id:String):void
Called automatically by the MXML compiler if the EventMap is set up using a tag.
EventMap
Property detail
_cacheproperty
protected var _cache:String = "global"
cacheproperty 
cache:String  [read-write]

String that indicates whether the event maps will use a global or a local cache. Each individual tag (ex: ObjectBuilder) is using this setting by default. Their default is inherit, which means that it will use the value that is defined in the event map. But each tag can override that to local, global or none.

Implementation
    public function get cache():String
    public function set cache(value:String):void
cacheCollectionproperty 
protected var cacheCollection:Dictionary
currentEventproperty 
currentEvent:*  [read-only]

It refers to the currentEvent that made the action-list (or inner-action-list) execute. Inside the inner-action-list this property has the value of the current event while event has the value of the original event of the main action-list. The currentEvent itself or properties of the event can be used as arguments of MethodInvoker methods, service methods, properties of all the IAction, etc.

This property can be used as the source for data binding.

Implementation
    public function get currentEvent():*

See also

dataproperty 
data:*  [read-only]

Every IActionList contains a placeholder object called data. This object can be used to store temporary data that many tags in the IActionList can share.

This property can be used as the source for data binding.

Implementation
    public function get data():*

See also

documentproperty 
protected var document:Object

A reference to the document object associated with this EventMap. A document object is an Object at the top of the hierarchy of a Flex application, MXML component, or AS component.

eventproperty 
event:*  [read-only]

It refers to the event that made the EventHandlers execute. The event itself or properties of the event can be used as arguments of MethodInvoker methods, service methods, properties of all the IAction, etc.

This property can be used as the source for data binding.

Implementation
    public function get event():*

See also

faultproperty 
fault:*  [read-only]

It refers to the fault returned by a service that made the inner-action-list (faultHandlers) execute. The fault itself or properties of the fault can be used as arguments of MethodInvoker methods, service methods, properties of all the IAction, etc.

Available only inside a faultHandlers inner tag.

This property can be used as the source for data binding.

Implementation
    public function get fault():*

See also

com.asfusion.mate.actionList.ServiceInvoker
com.asfusion.mate.core.SmartObject
globalDispatcherproperty 
globalDispatcher:IEventDispatcher  [read-only]Implementation
    public function get globalDispatcher():IEventDispatcher
lastReturnproperty 
lastReturn:*  [read-only]

lastReturn is always available, although its value might be null. It typically represents the value returned by a method call made on a MethodInvoker, but other IActions might also return a value, such as:

This property can be used as the source for data binding.

Implementation
    public function get lastReturn():*

See also

messageproperty 
message:*  [read-only]

It refers to the message received that made the MessageHandlers execute. The message itself or properties of the message can be used as arguments of MethodInvoker methods, service methods, properties of all the IActions, etc.

Available only inside a MessageHandlers tag.

This property can be used as the source for data binding.

Implementation
    public function get message():*

See also

resultObjectproperty 
resultObject:*  [read-only]

It refers to the result returned by a service that made the inner-action-list (resultHandlers) execute. The result itself or properties of the result can be used as arguments of MethodInvoker methods, service methods, properties of all the IAction, etc.

Available only inside a resultHandlers inner tag.

This property can be used as the source for data binding.

Implementation
    public function get resultObject():*

See also

com.asfusion.mate.actionList.ServiceInvoker
com.asfusion.mate.core.SmartObject
scopeproperty 
scope:*  [read-only]

It refers to the scope of the IActionList. The type of the scope is depending the type of IActionList.

Available types are:

This property can be used as the source for data binding.

Implementation
    public function get scope():*

See also

Method detail
getCacheCollection()method
public function getCacheCollection():Dictionary

Method that returns of the local cache dictionary that will be used to store objects created by the mate framework.

Returns
Dictionary
getCached()method 
public function getCached(template:Class, cacheType:String, autoCreate:Boolean = true, registerTarget:Boolean = false, constructorArguments:Array = null):*

Function to get cached instances from the framework. A Cache is returned instead of actual instance.

Parameters
template:Class
 
cacheType:String
 
autoCreate:Boolean (default = true)
 
registerTarget:Boolean (default = false)
 
constructorArguments:Array (default = null)

Returns
*

See also

getDispatcher()method 
public function getDispatcher():IEventDispatcher

Returns an event dispatcher.

Returns
IEventDispatcher
initialized()method 
public function initialized(document:Object, id:String):void

Called automatically by the MXML compiler if the EventMap is set up using a tag.

Parameters
document:Object
 
id:String