aermicioi.aedi.configurer.annotation.component_scan

Provides annotation based configuration and registration for components.

Members

Aliases

AliasingPolicyImpl
alias AliasingPolicyImpl = ChainedAliasingPolicy!(QualifiedAnnotationAliasingPolicy, IdentifierAliasingPolicy, TypeAliasingPolicy)

Default configuration of aliasing policy

ComponentStoringPolicyImpl
alias ComponentStoringPolicyImpl = ComponentStoringPolicy!(IdentityResolverPolicyImpl, StorageLocatorPolicyImpl, AliasingPolicyImpl)

Default implementation of storage policy used by adders.

ConfiguratorPolicyImpl
alias ConfiguratorPolicyImpl = ChainedConfiguratorPolicy!(FieldScanningConfiguratorPolicyImpl, MethodScanningConfiguratorPolicyImpl, AllocatorConfiguratorPolicy, CallbackFactoryConfiguratorPolicy, ValueFactoryConfiguratorPolicy, GenericConfigurerConfiguratorPolicy)

Implementation of configurator policy, with built in configurators

ContainerAdderImpl
alias ContainerAdderImpl(TransformerPolicy = ObjectFactoryTransformerImpl) = ChainedContainerAdder!(IgnoringContainerAdder!("std", TypeContainerAdder!TransformerPolicy), IgnoringContainerAdder!("std", InnerTypeContainerAdder!(TypeContainerAdder!TransformerPolicy)), IgnoringContainerAdder!("std", FactoryMethodContainerAdder!()), ModuleContainerAdderImpl!TransformerPolicy)

Customizable implementation of container adder, with built in functionality

FactoryPolicyImpl
alias FactoryPolicyImpl = FallbackFactoryPolicy!(GenericFactoryPolicy, GenericFactoryAnnotationPolicy)

Implementation of factory policy, with built in factory creators

FieldScanningConfiguratorPolicyImpl
alias FieldScanningConfiguratorPolicyImpl = FieldScanningConfiguratorPolicy!(SetterFieldConfiguratorPolicy, CallbackFieldConfiguratorPolicy, AutowiredFieldConfiguratorPolicy)

Implementation of field scanning configurator policy, with built in field configurators.

IdentityResolverPolicyImpl
alias IdentityResolverPolicyImpl = ChainedIdentityResolverPolicy!(QualifiedAnnotationIdentityResolverPolicy, TypeIdentityResolverPolicy)

Default implementation of identity resolving policy

MethodScanningConfiguratorPolicyImpl
alias MethodScanningConfiguratorPolicyImpl = MethodScanningConfiguratorPolicy!(ConstructorMethodConfiguratorPolicy, AutowiredConstructorMethodConfiguratorPolicy, SetterMethodConfiguratorPolicy, CallbackMethodConfiguratorPolicy, AutowiredMethodConfiguratorPolicy)

Implementation of method scanning configurator policy, with built in method configurators.

ModuleContainerAdderImpl
alias ModuleContainerAdderImpl(TransformerPolicy = ObjectFactoryTransformerImpl) = ModuleContainerAdder!(IgnoringContainerAdder!("std", ChainedContainerAdder!(IgnoringContainerAdder!("std", TypeContainerAdder!TransformerPolicy), IgnoringContainerAdder!("std", InnerTypeContainerAdder!(TypeContainerAdder!TransformerPolicy)), IgnoringContainerAdder!("std", FactoryMethodContainerAdder!()))))

Implementation of module container adder, featuring built in scanners

ObjectFactoryTransformerImpl
alias ObjectFactoryTransformerImpl = ObjectFactoryTransformer!(TypeTransformerImpl)

Implementation of object wrapping factory wrapping TypeTransformerImpl

StorageLocatorPolicyImpl
alias StorageLocatorPolicyImpl = ChainedStorageLocatorPolicy!(ContainedAnnotationStorageLocatorPolicy, DefaultStorageLocatorPolicy)

Default policy implementation for searching of storage for component

TypeTransformerImpl
alias TypeTransformerImpl = TypeTransformer!(FactoryPolicyImpl, ConfiguratorPolicyImpl)

Implementation of type to type factory transformer, with built in funcionality

Functions

prepare
auto prepare(Locator!() locator, Parameters!overload parameters, Args args)

A small utility function that will resolve method arguments using a locator and look also for annotations on arguments.

transformToReference
auto transformToReference(string reference, string symbol)
Undocumented in source. Be warned that the author may not have intended to support it.

Mixins

__anonymous
mixin Scanner!(ContainerAdderImpl!())

Default implementation of scan family of functions featuring all scanning features provided by library.

Mixin templates

Scanner
mixintemplate Scanner(ContainerAdderPolicy)

Template for defining scanning functions instantiated with particular container adder policy.

Structs

AllocatorConfiguratorPolicy
struct AllocatorConfiguratorPolicy

Set allocator used by factory to instantiate component T.

AutowiredConstructorMethodConfiguratorPolicy
struct AutowiredConstructorMethodConfiguratorPolicy

Method policy that scans constructors for @autowired annotation to use them to construct component with dependencies identified by qualifier, name or their type.

AutowiredFieldConfiguratorPolicy
struct AutowiredFieldConfiguratorPolicy

Field configurator policy that will try to inject a dependency that matches fields type for fields that are annotated with @autowired annotation

AutowiredMethodConfiguratorPolicy
struct AutowiredMethodConfiguratorPolicy

Method configurator policy that will call method annotated with @autowire with arguments extracted from locator identified by qualifier, name or their type.

CallbackDestructorConfigurerPolicy
struct CallbackDestructorConfigurerPolicy

A policy that configures factory to use callback to destroy created components.

CallbackFactoryConfiguratorPolicy
struct CallbackFactoryConfiguratorPolicy

Set callback instance factory from @callbac annotation into GenericFactory!Z

CallbackFieldConfiguratorPolicy
struct CallbackFieldConfiguratorPolicy

Field configurator policy that will set a field to value returned by a callback in @callback annotation

CallbackMethodConfiguratorPolicy
struct CallbackMethodConfiguratorPolicy

Method configurator policy that will call callback from @callback annotated methods.

ChainedAliasingPolicy
struct ChainedAliasingPolicy(Policies...)

Chaining implementation of aliasing policy, calling other passed policies.

ChainedComponentStoringPolicy
struct ChainedComponentStoringPolicy(ComponentStoringPolicies...)

A implementation that will chain several storing policies, triggerring multiple registrations of same component.

ChainedConfiguratorPolicy
struct ChainedConfiguratorPolicy(ConfiguratorPolicies...)

Chain a set of configurator policies.

ChainedContainerAdder
struct ChainedContainerAdder(ContainerAdderPolicies...)

ContainerAdder that chains a set of ContainerAdders on a symbol.

ChainedIdentityResolverPolicy
struct ChainedIdentityResolverPolicy(IdentityResolverPolicies...)

A policy for resolving identity of component by applying other components in chain.

ChainedStorageLocatorPolicy
struct ChainedStorageLocatorPolicy(StorageLocatorPolicies...)

A implementation storage locator policy that will apply other policies in chain until one provides a storage for storing data.

ComponentStoringPolicy
struct ComponentStoringPolicy(IdentityResolverPolicy, StorageResolvingPolicy, AliasingPolicyImpl)

A default implementation of component storing policy that looks for @qualifier and @contained annotations to store component factory.

ComponentStoringResult
struct ComponentStoringResult

Result of storing a component into a storage.

ConfiguredFieldTester
struct ConfiguredFieldTester

A dummy structure that is providing a simple field for isFieldConfiguratorPolicy interface for testing purposes of configurator templates.

ConfiguredMethodTester
struct ConfiguredMethodTester

A dummy structure that is providing a simple method for isMethodConfiguratorPolicy interface for testing purposes of configurator templates.

ConstructorMethodConfiguratorPolicy
struct ConstructorMethodConfiguratorPolicy

Method configurator policy that scans only constructors for @constructor annotation, for using them to instantiate component Z

ContainedAnnotationStorageLocatorPolicy
struct ContainedAnnotationStorageLocatorPolicy

A implementation storage locator policy that searches for storage of component based on @contained annotation

DefaultStorageLocatorPolicy
struct DefaultStorageLocatorPolicy

A implementation storage locator policy that will return default storage for component which is passed as argument to search.

FactoryMethodContainerAdder
struct FactoryMethodContainerAdder(ByTypeComponentStoringPolicy = ComponentStoringPolicyImpl, ByMethodComponentStoringPolicy = ComponentStoringPolicy!(ChainedIdentityResolverPolicy!(QualifiedAnnotationIdentityResolverPolicy, IdentifierBasedIdentityResolverPolicy), StorageLocatorPolicyImpl, AliasingPolicyImpl), ByTypeAliasingPolicy = TypeAliasingPolicy)

ContainerAdder that will scan a type for it's methods, and use them to create component factories out of their return type

FallbackFactoryPolicy
struct FallbackFactoryPolicy(FactoryPolicies...)

A factory policy that applies in order a set of factory policies to create component factory.

FieldScanningConfiguratorPolicy
struct FieldScanningConfiguratorPolicy(FieldConfiguratorPolicies...)

Configurator policy that applies field configurator policies on all public methods of a component

GenericConfigurerConfiguratorPolicy
struct GenericConfigurerConfiguratorPolicy

A policy that uses annotations that implement isConfigurerPolicy interface to configure the component factory

GenericFactoryAnnotationPolicy
struct GenericFactoryAnnotationPolicy

A factory policy that uses annotations implementing factory policy interface on component to instantiate the component.

GenericFactoryPolicy
struct GenericFactoryPolicy

Create a GenericFactory!T if T is annotated with @component annotation.

IdentifierAliasingPolicy
struct IdentifierAliasingPolicy

By identifier implementation of aliasing policy.

IdentifierBasedIdentityResolverPolicy
struct IdentifierBasedIdentityResolverPolicy

A policy for resolving identity of component by it's identifier.

IgnoringContainerAdder
struct IgnoringContainerAdder(string pack, ContainerAdderPolicy)

ContainerAdder that will ignore specific packages.

InnerTypeContainerAdder
struct InnerTypeContainerAdder(ContainerAdderPolicy)

ContainerAdder that scans a type for inner static types, to transform and store into a storage.

MethodScanningConfiguratorPolicy
struct MethodScanningConfiguratorPolicy(MethodConfiguratorPolicies...)

Configurator policy that applies method configurator policies on all public methods of a component

ModuleContainerAdder
struct ModuleContainerAdder(ContainerAdderPolicy)

ContainerAdder that will scan a module for it's members, to transform into component factories and add them into a storage

ObjectFactoryTransformer
struct ObjectFactoryTransformer(TransformerPolicy)

Transformer that wraps results of another transformer in WrappingFactory

QualifiedAnnotationAliasingPolicy
struct QualifiedAnnotationAliasingPolicy

Qualifier implementation of aliasing policy.

QualifiedAnnotationIdentityResolverPolicy
struct QualifiedAnnotationIdentityResolverPolicy

A policy for resolving identity of component by annotation.

SetterFieldConfiguratorPolicy
struct SetterFieldConfiguratorPolicy

Field configurator policy that will set a field annotated @setter annotation to value contained in it.

SetterMethodConfiguratorPolicy
struct SetterMethodConfiguratorPolicy

Method configurator policy that will call a method with resolved arguments from @setter annotation.

TypeAliasingPolicy
struct TypeAliasingPolicy

By type implementation of aliasing policy.

TypeContainerAdder
struct TypeContainerAdder(TypeTransformerPolicy, ComponentStoringPolicy = ComponentStoringPolicyImpl)

Applies a transformer on passed symbol if it is a type.

TypeIdentityResolverPolicy
struct TypeIdentityResolverPolicy

A policy for resolving identity of component by it's type.

TypeTransformer
struct TypeTransformer(FactoryPolicy, ConfigurerPolicy)

A transformer that creates out of a type a GenericFactory for passed type

ValueFactoryConfiguratorPolicy
struct ValueFactoryConfiguratorPolicy

Set value factory that takes component from @value annotation and provides it as a new component.

Variables

isAliasingPolicy
enum bool isAliasingPolicy(T, X = Object);

Check if T implements identity aliasing interface.

isComponentStoringPolicy
enum bool isComponentStoringPolicy(T, X = Object);

Check if T implements component storing interface.

isConfiguratorPolicy
enum bool isConfiguratorPolicy(T, X : GenericFactory!Z = GenericFactory!Object, Z);

Check if a type T is a configurator policy.

isContainerAdder
enum bool isContainerAdder(T, alias X = Object);

Check if T implements ContainerAdder interface.

isFactoryPolicy
enum bool isFactoryPolicy(T, X = Object);

Check if a type T is a factory policy.

isFieldConfiguratorPolicy
enum bool isFieldConfiguratorPolicy(T, string member = "field", X : GenericFactory!Z = GenericFactory!ConfiguredFieldTester, Z);

Check if T is a field configurator policy that operates upon fields of a component.

isIdentityResolverPolicy
enum bool isIdentityResolverPolicy(T, X = Object);

Check if T implements identity resolver interface.

isMethodConfiguratorPolicy
enum bool isMethodConfiguratorPolicy(T, string member = "method", X : GenericFactory!Z = GenericFactory!ConfiguredMethodTester, Z);

Check if T is a field configurator policy that operates upon methods of a component.

isStorageLocatorPolicy
enum bool isStorageLocatorPolicy(T, X = Object);

Check if T implements storage resolver interface.

isTransformer
enum bool isTransformer(T, X = Object);

Check if a policy implements transformer interface.

Meta

License

Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following:

The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Authors

aermicioi