|
ColdBox Platform Version 2.6.4 | ||||
| FRAMES | |||||
WEB-INF.cftags.component
coldbox.system.extras.lightwire.BaseConfigObject
public class BaseConfigObject
A base configuration object for lightwire
| Constructor Summary | |
|---|---|
init()
I initialize default LightWire config properties |
|
| Method Summary | |
|---|---|
void |
addBean(string FullClassPath, [string BeanName=''], boolean Singleton, [string InitMethod=''], [boolean Lazy='[runtime expression]'], [string BeanType=''], [string Aliases=''])
I add the configuration properties for a Singleton or Transient |
void |
addBeanFromFactory(string FactoryBean, string FactoryMethod, string BeanName, any Singleton, [boolean Lazy='[runtime expression]'], [string BeanType=''])
I add the configuration properties for a Singleton or Transient that is created by a factory to the config file |
void |
addConstructorDependency(string BeanName, string InjectedBeanName='', [string PropertyName=''])
I add a constructor object dependency for a bean |
void |
addConstructorProperty(string BeanName, string PropertyName, any PropertyValue, [string CastTo=''])
I add a constructor property of any type to a bean |
void |
addMixinDependency(string BeanName, string InjectedBeanName='', [string PropertyName=''], [string Scope='variables'])
I add a mixin dependency for a bean |
void |
addMixinProperty(string BeanName, string PropertyName, any PropertyValue, [string Scope='variables'])
I add a mixin property of any type to a bean |
void |
addSetterDependency(string BeanName, string InjectedBeanName='', [string PropertyName=''])
I add a setter dependency for a bean |
void |
addSetterProperty(string BeanName, string PropertyName, any PropertyValue, [string CastTo=''])
I add a setter property of any type to a bean |
void |
addSingleton(string FullClassPath, [string BeanName=''], [string InitMethod=''], [boolean Lazy='[runtime expression]'], [string BeanType=''], [string Aliases=''])
I add the configuration properties for a Singleton |
void |
addSingletonFromFactory(string FactoryBean, string FactoryMethod, string BeanName, [boolean Lazy='[runtime expression]'], [string BeanType=''])
Adds the definition for a given Singleton that is created by a factory to the config file |
private void |
addToNonLazyBeans(any beanName)
Add to non lazy beans struct |
void |
addTransient(string FullClassPath, [string BeanName=''], [string InitMethod=''], [string BeanType=''], [string Aliases=''])
I add the configuration properties for a Transient |
void |
addTransientFromFactory(string FactoryBean, string FactoryMethod, string BeanName, [string BeanType=''])
Adds the definition for a given Transient that is created by a factory to the config file |
struct |
getAliasStruct()
Get the AliasStruct |
private struct |
getBeanDefinition()
Get a structure with a bean's definitions by default |
struct |
getConfigStruct()
I provide LightWire with the properly configured configuration struct to operate on |
boolean |
getLazyLoad()
I return whether Singletons should or shouldn't be lazy loaded |
struct |
getNonLazyBeans()
Get the non Lazy Beans |
private any |
getUtil()
Get the LightWire utility object: coldbox |
private any |
nameResolution(any name)
Get a bean name via alias or bean name |
void |
parseXMLConfigFile(string XMLFilePath, [struct properties='[runtime expression]'])
I take the path to a ColdSpring XML config file and use it to set all of the necessary LightWire config properties |
void |
parseXMLObj(xml XMLObj, [struct properties='[runtime expression]'])
Parse an xml object definition, replacement of placeholders are done in the Raw or ConfiFile Methods Only |
void |
parseXMLRaw(string rawXML, [struct properties='[runtime expression]'])
Parse an xml raw string |
void |
setConfigStruct(struct ConfigStruct)
Set or override the configuration struct |
void |
setLazyLoad(boolean LazyLoad)
I set whether Singletons should or shouldn't be laxy loaded |
private void |
translateBean(any bean, struct properties)
I translate ColdSpring XML bean definitiions to LightWire config |
private void |
translateBeanChildren(any bean, string childTagName, struct properties)
|
private string |
validateBeanType(string BeanType)
Validate an incoming bean type |
| Methods inherited from class WEB-INF.cftags.component |
|---|
|
| Constructor Detail |
|---|
public init()
| Method Detail |
|---|
public void addBean(string FullClassPath, [string BeanName=''], boolean Singleton, [string InitMethod=''], [boolean Lazy='[runtime expression]'], [string BeanType=''], [string Aliases=''])
FullClassPath - The full class path to the bean including its name. E.g. for com.UserService.cfc it would be com.UserService.BeanName - An optional name to be able to use to refer to this bean. If you don't provide this, the name of the bean will be used as a default. E.g. for com.UserService, it'll be named UserService unless you put something else here. If you put UserS, it'd be available as UserS, but NOT as UserService.Singleton - Whether the bean is a Singleton (1) or Transient(0).InitMethod - A default custom initialization method for LightWire to call on the bean after constructing it fully (including setter and mixin injection) but before returning it.Lazy - Whether to construct at startup or not.BeanType - The bean type: cfc, java, webserviceAliases - A comma-delimmitted list of aliases for this beanpublic void addBeanFromFactory(string FactoryBean, string FactoryMethod, string BeanName, any Singleton, [boolean Lazy='[runtime expression]'], [string BeanType=''])
FactoryBean - The name of the factory to use to create this bean (the factory must also have been defined as a Singleton in the LightWire config file).FactoryMethod - The name of the method to call on the factory bean to create this bean.BeanName - The required name to use to refer to this bean.Singleton - Whether the bean is a Singleton (1) or Transient(0).Lazy - Whether to construct at startup or not.BeanType - The bean type: cfc, java, webservicepublic void addConstructorDependency(string BeanName, string InjectedBeanName='', [string PropertyName=''])
BeanName - The name of the bean to set the constructor dependencies for.InjectedBeanName - The name of the bean to inject.PropertyName - The optional property name to pass the bean into. Defaults to the bean name if not provided.public void addConstructorProperty(string BeanName, string PropertyName, any PropertyValue, [string CastTo=''])
BeanName - The name of the bean to add the property to.PropertyName - The name of the property to set.PropertyValue - The value of the property to set.CastTo - Used for java objects. Cast this property using javacast(): boolean,int,long,float,double,string,nullpublic void addMixinDependency(string BeanName, string InjectedBeanName='', [string PropertyName=''], [string Scope='variables'])
BeanName - The name of the bean to set the mixin dependencies for.InjectedBeanName - The name of the bean to inject.PropertyName - The optional property name to pass the bean into. Defaults to the bean name if not provided.Scope - The scope this dependency will be injected into. The default is variables scopepublic void addMixinProperty(string BeanName, string PropertyName, any PropertyValue, [string Scope='variables'])
BeanName - The name of the bean to add the property to.PropertyName - The name of the property to set.PropertyValue - The value of the property to set.Scope - The scope this property will be injected into. The default is variables scopepublic void addSetterDependency(string BeanName, string InjectedBeanName='', [string PropertyName=''])
BeanName - The name of the bean to set the setter dependencies for.InjectedBeanName - The name of the bean to inject.PropertyName - The optional property name to pass the bean into. Defaults to the bean name if not provided.public void addSetterProperty(string BeanName, string PropertyName, any PropertyValue, [string CastTo=''])
BeanName - The name of the bean to add the property to.PropertyName - The name of the property to set.PropertyValue - The value of the property to set.CastTo - Used for java objects. Cast this property using javacast(): boolean,int,long,float,double,string,nullpublic void addSingleton(string FullClassPath, [string BeanName=''], [string InitMethod=''], [boolean Lazy='[runtime expression]'], [string BeanType=''], [string Aliases=''])
FullClassPath - The full class path to the bean including its name. E.g. for com.UserService.cfc it would be com.UserService.BeanName - An optional name to be able to use to refer to this bean. If you don't provide this, the name of the bean will be used as a default. E.g. for com.UserService, it'll be named UserService unless you put something else here. If you put UserS, it'd be available as UserS, but NOT as UserService.InitMethod - A default custom initialization method for LightWire to call on the bean after constructing it fully (including setter and mixin injection) but before returning it.Lazy - Whether to construct at startup or not.BeanType - The bean type: cfc, java, webserviceAliases - A comma-delimmitted list of aliases for this beanpublic void addSingletonFromFactory(string FactoryBean, string FactoryMethod, string BeanName, [boolean Lazy='[runtime expression]'], [string BeanType=''])
FactoryBean - The name of the factory to use to create this bean (the factory must also have been defined as a Singleton in the LightWire config file).FactoryMethod - The name of the method to call on the factory bean to create this bean.BeanName - The required name to use to refer to this bean.Lazy - Whether to construct at startup or not.BeanType - The bean type: cfc, java, webserviceprivate void addToNonLazyBeans(any beanName)
beanName - The bean name to add to the non lazy beanspublic void addTransient(string FullClassPath, [string BeanName=''], [string InitMethod=''], [string BeanType=''], [string Aliases=''])
FullClassPath - The full class path to the bean including its name. E.g. for com.User.cfc it would be com.User.BeanName - An optional name to be able to use to refer to this bean. If you don't provide this, the name of the bean will be used as a default. E.g. for com.User, it'll be named User unless you put something else here. If you put UserBean, it'd be available as UserBean, but NOT as User.InitMethod - A default custom initialization method for LightWire to call on the bean after constructing it fully (including setter and mixin injection) but before returning it.BeanType - The bean type: cfc, java, webserviceAliases - A comma-delimmitted list of aliases for this beanpublic void addTransientFromFactory(string FactoryBean, string FactoryMethod, string BeanName, [string BeanType=''])
FactoryBean - The name of the factory to use to create this bean (the factory must also have been defined as a Singleton in the LightWire config file).FactoryMethod - The name of the method to call on the factory bean to create this bean.BeanName - The required name to use to refer to this bean.BeanType - The bean type: cfc, java, webservicepublic struct getAliasStruct()
private struct getBeanDefinition()
public struct getConfigStruct()
public boolean getLazyLoad()
public struct getNonLazyBeans()
private any getUtil()
private any nameResolution(any name)
name - Bean name or alias to resolve.public void parseXMLConfigFile(string XMLFilePath, [struct properties='[runtime expression]'])
XMLFilePath - The path to the XML config file.properties - A struct of default properties to be used in place of ${key} in XML config file.public void parseXMLObj(xml XMLObj, [struct properties='[runtime expression]'])
XMLObj - The XML Object to parse.properties - A struct of default properties to be used in place of ${key} in XML config file.public void parseXMLRaw(string rawXML, [struct properties='[runtime expression]'])
rawXML - A raw string of xml bean definitionsproperties - A struct of default properties to be used in place of ${key} in XML config file.public void setConfigStruct(struct ConfigStruct)
ConfigStructpublic void setLazyLoad(boolean LazyLoad)
LazyLoad - Whether or not to use lazy loading of Singletons.private void translateBean(any bean, struct properties)
bean - The xml bean definition. This is an XML objectproperties - The properties structureprivate void translateBeanChildren(any bean, string childTagName, struct properties)
bean - The xml bean definition objectchildTagName - The child tag name to parseproperties - The properties structureprivate string validateBeanType(string BeanType)
BeanType - The bean type: cfc, java, webservice
|
ColdBox Platform Version 2.6.4 | ||||
| FRAMES | |||||