[[Dashboard | << Back to Dashboard ]] {| align="right" | __TOC__ |} = Exploring the BeanFactoryCompat Plugin = == Overview == I am the ColdBox BeanFactory plugin that takes care of autowiring and dependency injection == getExternalLocations == Get all the registered external locations === Returns === * This function returns ''string'' === Examples === == autowire == Autowire an object using the ColdBox DSL === Returns === * This function returns ''void'' === Arguments === {| cellpadding="5", class="tablelisting" ! '''Key''' !! '''Type''' !! '''Required''' !! '''Default''' !! '''Description''' |- | target || any || Yes || --- || The object to autowire |- | useSetterInjection || any || No || true || Whether to use setter injection alongside the annotations property injection. cfproperty injection takes precedence. Boolean Value |- | annotationCheck || any || No || false || This value determines if we check if the target contains an autowire annotation in the cfcomponent tag: autowire=true|false, it will only autowire if that metadata attribute is set to true. The default is false, which will autowire automatically. Boolean Value |- | onDICompleteUDF || any || No || onDIComplete || After Dependencies are injected, this method will look for this UDF and call it if it exists. The default value is onDIComplete |- | stopRecursion || any || No || || The stop recursion class. Ex: transfer.com.TransferDecorator. By default all ColdBox base classes are included. |- | targetID || any || No || || A unique resource target identifier used for wiring the sent in target. If not sent, then this will become getMetadata(target).name and use resources. |} === Examples === == removeExternalLocations == Try to remove all the external locations passed in === Returns === * This function returns ''void'' === Arguments === {| cellpadding="5", class="tablelisting" ! '''Key''' !! '''Type''' !! '''Required''' !! '''Default''' !! '''Description''' |- | locations || string || Yes || --- || Locations to remove from the lookup. Comma delimited allowed. |} === Examples === == getModel == Create or retrieve model objects by convention === Returns === * This function returns ''any'' === Arguments === {| cellpadding="5", class="tablelisting" ! '''Key''' !! '''Type''' !! '''Required''' !! '''Default''' !! '''Description''' |- | name || any || No || || The name of the model to retrieve |- | useSetterInjection || any || No || --- || Whether to use setter injection alongside the annotations property injection. cfproperty injection takes precedence. Boolean |- | onDICompleteUDF || any || No || --- || After Dependencies are injected, this method will look for this UDF and call it if it exists. The default value is onDIComplete |- | stopRecursion || any || No || --- || A comma-delimmited list of stoprecursion classpaths. |- | dsl || any || No || --- || The dsl string to use to retrieve the domain object |- | executeInit || any || No || true || Whether to execute the init() constructor or not. Defaults to execute, Boolean |} === Examples === == locateModel == Get the location instantiation path for a model object. If the model location is not found, this method returns an empty string. === Returns === * This function returns ''string'' === Arguments === {| cellpadding="5", class="tablelisting" ! '''Key''' !! '''Type''' !! '''Required''' !! '''Default''' !! '''Description''' |- | name || any || Yes || --- || The model to locate |- | resolveAlias || any || No || false || Resolve model aliases |} === Examples === == resolveModelAlias == Resolve the real name of any incoming argument model name or alias === Returns === * This function returns ''string'' === Arguments === {| cellpadding="5", class="tablelisting" ! '''Key''' !! '''Type''' !! '''Required''' !! '''Default''' !! '''Description''' |- | name || any || Yes || --- || The model alias or name to resolve |} === Examples === == getAutowireCache == Get a structure of all the metadata available for all autowired model objects === Returns === * This function returns ''any'' === Examples === == configure == Configure the bean factory for operation from the configuration file. === Returns === * This function returns ''BeanFactoryCompat'' === Examples === == containsModel == Checks if the factory has a model object definition found === Returns === * This function returns ''boolean'' === Arguments === {| cellpadding="5", class="tablelisting" ! '''Key''' !! '''Type''' !! '''Required''' !! '''Default''' !! '''Description''' |- | name || string || Yes || --- || The name of the model to check |- | resolveAlias || boolean || No || false || Resolve model aliases |} === Examples === == addModelMapping == Add a new model mapping. Ex: addModelMapping('myBean','security.test.FormBean'). The alias can be a single item or a comma delimmitted list === Returns === * This function returns ''void'' === Arguments === {| cellpadding="5", class="tablelisting" ! '''Key''' !! '''Type''' !! '''Required''' !! '''Default''' !! '''Description''' |- | alias || any || No || --- || The model alias to use, this can also be a list of aliases. Ex: SecurityService,Security |- | path || any || Yes || --- || The model path (From the model conventions downward). Do not add full path, this is a convenience |} === Examples === == appendExternalLocations == Try to append a new model external location === Returns === * This function returns ''void'' === Arguments === {| cellpadding="5", class="tablelisting" ! '''Key''' !! '''Type''' !! '''Required''' !! '''Default''' !! '''Description''' |- | locations || string || Yes || --- || Locations to add to the lookup, will be added in passed order. Comma delimited allowed. |} === Examples ===