org.cruxframework.crux.core.ioc
Interface IocConfig<T>

All Known Implementing Classes:
IocConfigImpl

public interface IocConfig<T>

A Type binding configuration for Crux IoC container.

Author:
Thiago da Rosa de Bustamante

Method Summary
 IocConfig<T> runtimeAccessible(boolean accessible)
          By default, types assigned to container can not be requested directly by user programmatically.
 IocConfig<T> scope(IoCResource.Scope scope)
          Defines the scope where the created object will be saved
 IocConfig<T> toClass(Class<? extends T> toClass)
          Bound a new concrete class that will be returned when given class is requested to IOC container.
 IocConfig<T> toProvider(Class<? extends IocProvider<? extends T>> providerClass)
          Bound a provider class that will be used to instantiate new objects by IOC container.
 

Method Detail

toProvider

IocConfig<T> toProvider(Class<? extends IocProvider<? extends T>> providerClass)
Bound a provider class that will be used to instantiate new objects by IOC container.

Parameters:
providerClass -
Returns:

toClass

IocConfig<T> toClass(Class<? extends T> toClass)
Bound a new concrete class that will be returned when given class is requested to IOC container. The given class must be assignable to

Parameters:
toClass -
Returns:

runtimeAccessible

IocConfig<T> runtimeAccessible(boolean accessible)
By default, types assigned to container can not be requested directly by user programmatically. It can be changed by enabling this property. Then, you can request the bound type directly to container doing: view.getIoCContainer().get(MyType.class, scope, subscope);

Parameters:
accessible -
Returns:

scope

IocConfig<T> scope(IoCResource.Scope scope)
Defines the scope where the created object will be saved



Copyright © 2014. All rights reserved.