org.cruxframework.crux.core.ioc
Class IocConfigImpl<T>

java.lang.Object
  extended by org.cruxframework.crux.core.ioc.IocConfigImpl<T>
All Implemented Interfaces:
IocConfig<T>

public class IocConfigImpl<T>
extends Object
implements IocConfig<T>

Author:
Thiago da Rosa de Bustamante

Constructor Summary
IocConfigImpl(Class<T> clazz)
           
 
Method Summary
 Class<T> getBoundClass()
           
 Class<? extends IocProvider<? extends T>> getProviderClass()
           
 IoCResource.Scope getScope()
           
 Class<? extends T> getToClass()
           
 boolean isRuntimeAccessible()
           
 IocConfig<T> runtimeAccessible(boolean accessible)
          By default, types assigned to container can not be requested directly by user programmatically.
 IocConfigImpl<T> scope(IoCResource.Scope scope)
          Defines the scope where the created object will be saved
 IocConfigImpl<T> toClass(Class<? extends T> toClass)
          Bound a new concrete class that will be returned when given class is requested to IOC container.
 IocConfigImpl<T> toProvider(Class<? extends IocProvider<? extends T>> providerClass)
          Bound a provider class that will be used to instantiate new objects by IOC container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IocConfigImpl

public IocConfigImpl(Class<T> clazz)
Method Detail

runtimeAccessible

public IocConfig<T> runtimeAccessible(boolean accessible)
Description copied from interface: IocConfig
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);

Specified by:
runtimeAccessible in interface IocConfig<T>
Returns:

toProvider

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

Specified by:
toProvider in interface IocConfig<T>
Returns:

toClass

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

Specified by:
toClass in interface IocConfig<T>
Returns:

scope

public IocConfigImpl<T> scope(IoCResource.Scope scope)
Description copied from interface: IocConfig
Defines the scope where the created object will be saved

Specified by:
scope in interface IocConfig<T>

isRuntimeAccessible

public boolean isRuntimeAccessible()

getBoundClass

public Class<T> getBoundClass()

getProviderClass

public Class<? extends IocProvider<? extends T>> getProviderClass()

getToClass

public Class<? extends T> getToClass()

getScope

public IoCResource.Scope getScope()


Copyright © 2014. All rights reserved.