Packageorg.spicefactory.parsley.core.view.impl
Classpublic class AbstractViewAutowireFilter
InheritanceAbstractViewAutowireFilter Inheritance Object
Implements ViewAutowireFilter
Subclasses DefaultViewAutowireFilter

Abstract base implementation of the ViewAutowireFilter. Subclasses must implement the prefilter and filter methods.



Public Properties
 PropertyDefined By
  eventType : String
The event type to listen to in the view roots.
AbstractViewAutowireFilter
Public Methods
 MethodDefined By
  
filter(object:DisplayObject):ViewAutowireMode
Makes the final decision whether a view object should be wired to the Context.
AbstractViewAutowireFilter
  
prefilter(object:DisplayObject):Boolean
Prefilters the specified view object, deciding whether it should be further processed.
AbstractViewAutowireFilter
Property Detail
eventTypeproperty
eventType:String

The event type to listen to in the view roots. The listener will be registered for the capture phase and then pass all views to the prefilter method. The default is Event.ADDED_TO_STAGE.


Implementation
    public function get eventType():String
    public function set eventType(value:String):void
Method Detail
filter()method
public function filter(object:DisplayObject):ViewAutowireMode

Makes the final decision whether a view object should be wired to the Context.

This method will only be invoked for objects which passed the prefilter method. In a multi-Context scenario in a modular application this method may be invoked in a different filter instance than the prefilter method. The latter will be invoked in the root Context in most cases, this method however will often be invoked in a child Context.

The enumeration value returned by this method indicates how the framework should deal with this view object. See the ViewAutowireMode class for details.

Parameters

object:DisplayObject — the view object to filter

Returns
ViewAutowireMode — an enumeration value that indicates how the framework should deal with this view object
prefilter()method 
public function prefilter(object:DisplayObject):Boolean

Prefilters the specified view object, deciding whether it should be further processed. This is primarily for performance optimizations as the final decision whether a view gets wired or not will be made by the filter method. Only objects for which this method returns true will then dispatch a bubbling autowire event. This is necessary as we have to listen in the capture phase first to get a hold on every view object, but must then reroute the event from bottom to top to allow the Context with the lowest position in the view hierarchy to make the final decision.

Parameters

object:DisplayObject — the view object to be filtered

Returns
Boolean — true if the specified view object should be further processed.