|
ColdBox Platform Version 3.7.0 | ||||
FRAMES |
WEB-INF.cftags.componentcoldbox.system.ioc.config.Binder
public class Binder
This is a WireBox configuration binder object. You can use it to configure a WireBox injector instance using our WireBox Mapping DSL
Constructor Summary | |
---|---|
init(any<Injector> injector, [any config], [any<struct> properties='[runtime expression]'])
Constructor: You can pass a data CFC instance, data CFC path or nothing at all for purely programmatic configuration |
Method Summary | |
---|---|
any |
asEagerInit()
If this method is called, the mapped object will be created once the injector starts up |
any |
asSingleton()
Map as a singleton, shortcut to using 'in( this |
any |
bindAspect(Matcher<Matcher> classes, Matcher<Matcher> methods, any aspects)
Bind a aspects to classes and methods |
any |
cacheBox([any configFile=''], [any cacheFactory=''], [any<Boolean> enabled='true'], [any classNamespace='[runtime expression]'])
Integrate with CacheBox |
any |
configure()
The main configuration method that must be overriden by a specific WireBox Binder configuration object |
any |
constructor(any constructor)
You can choose what method will be treated as the constructor |
any |
extraAttributes(struct data)
Adds a structure of metadata to be stored with the mapping for later retrieval by the developer in events, manually or builders |
any |
getAppMapping()
Get the ColdBox app mapping variable if context linked |
any<array> |
getAspectBindings()
Get the collection of aspect bindings for this binder |
any<Struct> |
getCacheBoxConfig()
Get the CacheBox Configuration Integration structure |
any<Controller> |
getColdBox()
Get the bounded ColdBox context for this binder, if any |
any |
getCurrentMapping()
Get the current set mapping (UTILITY method) |
any<struct> |
getCustomDSL()
Get the custom dsl namespace registration structure |
struct |
getCustomScopes()
Get the registered custom scopes |
any<Struct> |
getDefaults()
Get the default WireBox settings structure |
any<Injector> |
getInjector()
Get the bounded injector for this binder |
any<Array> |
getListeners()
Get the configured listeners array |
any |
getLogBoxConfig()
Get the logBox Configuration file to use |
any<Mapping> |
getMapping(any name)
Get a specific object mapping: coldbox |
any<struct> |
getMappings()
Get all the registered object mappings structure |
any<Struct> |
getMemento()
Get the instance data structure |
any |
getParentInjector()
Get the parent injector reference this binder is linked to |
any<struct> |
getProperties()
Get the binded properties structure |
any |
getProperty(any name, [any default])
Get a binded property |
any<java.util.LinkedHashMap> |
getScanLocations()
Get the linked map of package scan locations for CFCs |
any<Struct> |
getScopeRegistration()
Get the scope registration details structure |
any<Array> |
getStopRecursions()
Get all the stop recursion classes array |
any |
inCacheBox([any key=''], [any timeout=''], [any lastAccessTimeout=''], [any provider='default'])
Map an object into CacheBox |
any |
initArg([any name], [any ref], [any dsl], [any value], [any javaCast])
Map a constructor argument to a mapping |
any |
initWith()
Positional or named value arguments to use when initializing the mapping |
any |
into(any scope)
Map an object into a specific persistence scope |
any |
listener(any class, [any<Struct> properties='[runtime expression]'], [any name=''])
Add a new listener configuration |
void |
loadDataDSL([any<struct> rawDSL])
Load a data configuration CFC data DSL |
any |
logBoxConfig(any config)
Set the logBox Configuration to use |
any |
map(any alias)
Create a mapping to an object |
any |
mapAspect(any aspect, boolean autoBinding='true')
Map a new aspect |
any |
mapDSL(any namespace, any path)
Register a new custom dsl namespace |
any |
mapDirectory(any packagePath, any include='', any exclude='', [any influence], [any filter])
Maps an entire instantiation path directory, please note that the unique name of each file will be used and also processed for alias inspection |
any |
mapPath(any path)
Directly map to a path by using the last part of the path as the alias |
any |
mapScope(any annotation, any path)
Register a new WireBox custom scope |
any<Boolean> |
mappingExists(any name)
Check if an object mapping exists |
any |
match()
Create a new matcher class for usage in class or method matching |
any |
methodArg([any name], [any ref], [any dsl], [any value], [any javaCast])
Map a method argument to a factory method |
any |
mixins(any mixins='')
Adds one, a list or an array of UDF templates to mixin to a CFC |
any |
noAutowire()
If you call this method on an object mapping, the object will NOT be inspected for injection/wiring metadata, it will use ONLY whatever you define in the mapping |
any |
noInit()
If you call this method on an object mapping, the object's constructor will not be called |
any |
notThreadSafe()
This is the default wiring of objects that allow circular dependencies |
any |
onDIComplete(any methods)
The methods to execute once DI completes on the mapping |
any |
parent(any alias)
this method lets you use an abstract or parent mapping as a template for other like objects |
any |
parentInjector(any injector)
Link a parent injector to this configuration binder |
any |
processMappings()
Process all registered mappings, called by injector when ready to start serving requests |
any |
property(any name, [any ref], [any dsl], [any value], [any javaCast], [any scope='variables'])
Map a cfproperty to a mapping |
boolean |
propertyExists(any name)
Checks if a property exists |
any |
providerMethod(any method, any mapping)
Add a new provider method mapping |
void |
removeScanLocations(any locations)
Try to remove all the scan locations passed in |
void |
reset()
Reset the configuration back to the original binder defaults |
any |
scanLocations(any locations)
Register one or more package scan locations for CFC lookups |
any |
scopeRegistration([any<Boolean> enabled='[runtime expression]'], [any scope='[runtime expression]'], [any key='[runtime expression]'])
Use to define injector scope registration |
any |
setMapping(any name, any mapping)
Set a mapping object into the mappings map |
any |
setProperties(any<struct> properties)
Set the binded properties structure |
void |
setProperty(any name, any value)
Create a new binding property |
any |
setter(any name, [any ref], [any dsl], [any value], [any javaCast], [any argName])
Map a setter function to a mapping |
any |
stopRecursions(any classes)
Configure the stop recursion classes |
any |
threadSafe()
Tells persistence scopes to build, wire, and do onDIComplete() on objects in an isolated lock |
any |
to(any path)
Map to a destination CFC class path |
any |
toDSL(any dsl)
Map to a dsl that will be used to create the mapped object |
any |
toFactoryMethod(any factory, any method)
Map to a factory and its executing method |
any |
toJava(any path)
Map to a java destination class path |
any |
toProvider(any provider)
Map to a provider object that must implement coldbox |
any |
toRSS(any path)
Map to a rss destination class path |
any |
toValue(any value)
Map to a constant value |
any |
toWebservice(any path)
Map to a webservice destination class path |
any |
unMap(any name)
Destroys a mapping by name |
any |
virtualInheritance(any mapping)
Tells WireBox to do a virtual inheritance mixin of the target and this passed mapping |
any |
with(any alias)
Used to set the current working mapping name in place for the maping DSL |
Methods inherited from class WEB-INF.cftags.component |
---|
|
Constructor Detail |
---|
public init(any<Injector> injector, [any config], [any<struct> properties='[runtime expression]'])
injector
- The Injector this binder is bound toconfig
- The WireBox Injector Data Configuration CFC instance or instantiation path to it. Leave blank if using this configuration object programaticallyproperties
- A structure of binding properties to passthrough to the Binder Configuration CFCMethod Detail |
---|
public any asEagerInit()
public any asSingleton()
public any bindAspect(Matcher<Matcher> classes, Matcher<Matcher> methods, any aspects)
classes
- The class matcher that will be affected with this aspect bindingmethods
- The method matcher that will be affected with this aspect bindingaspects
- The name or list of names or array of names of aspects to apply to the classes and method matcherspublic any cacheBox([any configFile=''], [any cacheFactory=''], [any<Boolean> enabled='true'], [any classNamespace='[runtime expression]'])
configFile
- The configuration file to use for loading CacheBox if creating it.cacheFactory
- The CacheBox cache factory instance to link WireBox toenabled
- Enable or Disable CacheBox Integration, if you call this method then enabled is set to true as most likely you are trying to enable itclassNamespace
- The package namespace to use for creating or connecting to CacheBox. Defaults to: coldbox.system.cachepublic any configure()
public any constructor(any constructor)
constructor
- The constructor method to use for the mapped objectpublic any extraAttributes(struct data)
data
- The data structure to store with the mapingpublic any getAppMapping()
public any<array> getAspectBindings()
public any<Struct> getCacheBoxConfig()
public any<Controller> getColdBox()
public any getCurrentMapping()
public any<struct> getCustomDSL()
public struct getCustomScopes()
public any<Struct> getDefaults()
public any<Injector> getInjector()
public any<Array> getListeners()
public any getLogBoxConfig()
public any<Mapping> getMapping(any name)
name
- The name of the mapping to retrievepublic any<struct> getMappings()
public any<Struct> getMemento()
public any getParentInjector()
public any<struct> getProperties()
public any getProperty(any name, [any default])
name
- The name of the propertydefault
- A default value if property does not existpublic any<java.util.LinkedHashMap> getScanLocations()
public any<Struct> getScopeRegistration()
public any<Array> getStopRecursions()
public any inCacheBox([any key=''], [any timeout=''], [any lastAccessTimeout=''], [any provider='default'])
key
- You can override the key it will use for storing in cache. By default it uses the name of the mapping.timeout
- Object Timeout, else defaults to whatever the default is in the choosen cachelastAccessTimeout
- Object Timeout, else defaults to whatever the default is in the choosen cacheprovider
- Uses the 'default' cache provider by defaultpublic any initArg([any name], [any ref], [any dsl], [any value], [any javaCast])
name
- The name of the constructor argument. NA: JAVA-WEBSERVICEref
- The reference mapping id this constructor argument maps todsl
- The construction dsl this argument references. If used, the name value must be used.value
- The value of the constructor argument, if passed.javaCast
- The type of javaCast() to use on the value of the argument. Only used if using dsl or ref argumentspublic any initWith()
public any into(any scope)
scope
- The scope to map to, use a valid WireBox Scope by using binder.SCOPES.* or a custom scopepublic any listener(any class, [any<Struct> properties='[runtime expression]'], [any name=''])
class
- The class of the listenerproperties
- The structure of properties for the listnername
- The name of the listenerpublic void loadDataDSL([any<struct> rawDSL])
rawDSL
- The data configuration DSL structure to load, else look internallypublic any logBoxConfig(any config)
config
- The configuration file to usepublic any map(any alias)
alias
- A single alias or a list or an array of aliases for this mapping. Remember an object can be refered by many namespublic any mapAspect(any aspect, boolean autoBinding='true')
aspect
- The name or aliases of the aspectautoBinding
- Allow autobinding of this aspect or not? Defaults to truepublic any mapDSL(any namespace, any path)
namespace
- The namespace you would like to registerpath
- The instantiation path to the CFC that implements this scope, it must have an init() method and implement: coldbox.system.ioc.dsl.IDSLBuilderpublic any mapDirectory(any packagePath, any include='', any exclude='', [any influence], [any filter])
packagePath
- The instantiation packagePath to mapinclude
- An include regex that if matches will only include CFCs that match this case insensitive regexexclude
- An exclude regex that if matches will exclude CFCs that match this case insensitive regexinfluence
- The influence closure or UDF that will receive the currently working mapping so you can influence it during the iterationsfilter
- The filter closure or UDF that will receive the path of the CFC to process and returns TRUE to continue processing or FALSE to skip processingpublic any mapPath(any path)
path
- The class path to the object to mappublic any mapScope(any annotation, any path)
annotation
- The unique scope name to register. This translates to an annotation value on CFCspath
- The path to the CFC that implements this scope, it must have an init() method and implement: coldbox.system.ioc.scopes.IScopepublic any<Boolean> mappingExists(any name)
name
- The name of the mapping to verifypublic any match()
public any methodArg([any name], [any ref], [any dsl], [any value], [any javaCast])
name
- The name of the argumentref
- The reference mapping id this method argument maps todsl
- The construction dsl this argument references. If used, the name value must be used.value
- The value of the constructor argument, if passed.javaCast
- The type of javaCast() to use on the value of the argument. Only used if using dsl or ref argumentspublic any mixins(any mixins='')
mixins
- The udf include location(s) to mixin at runtimepublic any noAutowire()
public any noInit()
public any notThreadSafe()
public any onDIComplete(any methods)
methods
- A list or an array of methods to execute once the mapping is created, inited and DI has happened.public any parent(any alias)
alias
- The parent class to copy dependencies and definitions frompublic any parentInjector(any injector)
injector
- A parent injector to configure linkpublic any processMappings()
public any property(any name, [any ref], [any dsl], [any value], [any javaCast], [any scope='variables'])
name
- The name of the cfproperty to inject intoref
- The reference mapping id this property maps todsl
- The construction dsl this property references. If used, the name value must be used.value
- The value of the property, if passed.javaCast
- The type of javaCast() to use on the value of the property. Only used if using dsl or ref argumentsscope
- The scope in the CFC to inject the property to. By default it will inject it to the variables scopepublic boolean propertyExists(any name)
name
- The name of the propertypublic any providerMethod(any method, any mapping)
method
- The provided method to override or inject as a providermapping
- The mapping to provide via the selected methodpublic void removeScanLocations(any locations)
locations
- Locations to remove from the lookup. A list or array of locationspublic void reset()
public any scanLocations(any locations)
locations
- A list or array of locations to add to package scanning.e.g.: ['coldbox','com.myapp','transfer']public any scopeRegistration([any<Boolean> enabled='[runtime expression]'], [any scope='[runtime expression]'], [any key='[runtime expression]'])
enabled
- Enable registration or not (defaults=false) Booleanscope
- The scope to register on, defaults to application scopekey
- The key to use in the scope, defaults to wireBoxpublic any setMapping(any name, any mapping)
name
- The name of the mapping to registermapping
- The mapping object to registerpublic any setProperties(any<struct> properties)
properties
public void setProperty(any name, any value)
name
- The name of the propertyvalue
- The value of the propertypublic any setter(any name, [any ref], [any dsl], [any value], [any javaCast], [any argName])
name
- The name of the setter method (without 'set').ref
- The reference mapping object this setter method will receivedsl
- The construction dsl this setter method will receivevalue
- The value to pass into the setter method.javaCast
- The type of javaCast() to use on the value. Only used if using dsl or ref argumentsargName
- The name of the argument to use, if not passed, we default it to the setter namepublic any stopRecursions(any classes)
classes
- A list or array of classes to use so the injector can stop when looking for dependencies in inheritance chainspublic any threadSafe()
public any to(any path)
path
- The class path to the object to mappublic any toDSL(any dsl)
dsl
- The DSL string to usepublic any toFactoryMethod(any factory, any method)
factory
- The mapping factory reference namemethod
- The method to executepublic any toJava(any path)
path
- The class path to the object to mappublic any toProvider(any provider)
provider
- The provider to map topublic any toRSS(any path)
path
- The class path to the object to mappublic any toValue(any value)
value
- The value to bind topublic any toWebservice(any path)
path
- The class path to the object to mappublic any unMap(any name)
name
- The name of the mapping to registerpublic any virtualInheritance(any mapping)
mapping
- The mapping name of CFC to create the virtual inheritance from.public any with(any alias)
alias
- The name of the maping to set as current for working with it via the mapping DSL
|
ColdBox Platform Version 3.7.0 | ||||
FRAMES |