BeanFactory

Kind of class:public class
Package:com.bourre.ioc.bean
Inherits from:none
Implements:
Classpath:com.bourre.ioc.bean.BeanFactory
File last modified:Monday, 24 November 2008, 11:36:55

Summary


Class methods
Instance methods
Event handlers

Constructor

BeanFactory

public function BeanFactory (

Class methods

getInstance

public static function getInstance (

release

public static function release (
) : void

Instance methods

add

public function add (
d:Dictionary) : void

Adds all ressources contained in the passed-in dictionnary
into this locator instance. If there is keys used both in
the locator and in the dictionnary an exception is thrown.
#
Parameters:
d:
dictionnary instance which contains ressources
to be added
#
Throws:
  • {VISDOC_LINK_0}{VISDOC_CODE_BLOCK_12} — One or more
    keys present in the dictionnary already exist in this
    locator instance.
    #
Specified by:

addEventListener

public function addEventListener (
type:String, listener:Object, rest) : Boolean

addListener

public function addListener (
listener:BeanFactoryListener) : Boolean

clear

public function clear (
) : void

getKey

public function getKey (
bean:Object) : String

getKeys

public function getKeys (
) : Array

Returns an {VISDOC_CODE_BLOCK_13} view of the keys contained in this locator.
#
Returns:
  • an array view of the keys contained in this locator
    #
Specified by:

getValues

public function getValues (
) : Array

Returns an {VISDOC_CODE_BLOCK_14} view of the values contained in this locator.
#
Returns:
  • an array view of the values contained in this locator
    #
Specified by:

isBeanRegistered

public function isBeanRegistered (
bean:Object) : Boolean

isRegistered

public function isRegistered (
key:String) : Boolean

Returns {VISDOC_CODE_BLOCK_3} is there is a ressource associated
with the passed-in {VISDOC_CODE_BLOCK_4}. To avoid errors when
retreiving ressources from a locator you should systematically
use the {VISDOC_CODE_BLOCK_5} function to check if the
ressource you would access is already accessible before any
call to the {VISDOC_CODE_BLOCK_6} function.
#
Returns:
  • {VISDOC_CODE_BLOCK_7} is there is a ressource associated
    with the passed-in {VISDOC_CODE_BLOCK_8}.
    #
Specified by:

locate

public function locate (
key:String) : Object

Returns the ressource associated with the passed-in {VISDOC_CODE_BLOCK_9}.
If there is no ressource identified by the passed-in key, the
function will fail with an error. To avoid the throw of an exception
when attempting to access to a ressource, take care to check the
existence of the ressource before trying to access to it.
#
Parameters:
key:
identifier of the ressource to access
#
Returns:
  • the ressource associated with the passed-in {VISDOC_CODE_BLOCK_10}
    #
Throws:
  • {VISDOC_LINK_0}{VISDOC_CODE_BLOCK_11} — There is no ressource
    associated with the passed-in key
    #
Specified by:

register

public function register (
key:String, bean:Object) : Boolean

removeEventListener

public function removeEventListener (
type:String, listener:Object) : Boolean

removeListener

public function removeListener (
listener:BeanFactoryListener) : Boolean

toString

public function toString (
) : String

unregister

public function unregister (
key:String) : Boolean

unregisterBean

public function unregisterBean (
bean:Object) : Boolean

Event handlers

onRegisterBeanEVENT

public static const onRegisterBeanEVENT:String = "onRegisterBean"
(read)

onUnregisterBeanEVENT

public static const onUnregisterBeanEVENT:String = "onUnregisterBean"
(read)