org.cruxframework.crux.core.ioc
Class IocContainerConfigurations

java.lang.Object
  extended by org.cruxframework.crux.core.ioc.IocContainerConfigurations
All Implemented Interfaces:
IocConfiguration

public abstract class IocContainerConfigurations
extends Object
implements IocConfiguration

Base class for an IoC configuration class. Crux engine search for all subclasses of IocContainerConfigurations and invoke their configure method.

Author:
Thiago da Rosa de Bustamante

Constructor Summary
IocContainerConfigurations()
           
 
Method Summary
protected
<T> IocConfig<T>
bindType(Class<T> clazz)
          Call this method on your configure method to create a configuration for some Type.
protected  boolean isEnabled()
          Override this method if you need to specify some conditions that enables your configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.cruxframework.crux.core.ioc.IocConfiguration
configure
 

Constructor Detail

IocContainerConfigurations

public IocContainerConfigurations()
Method Detail

bindType

protected <T> IocConfig<T> bindType(Class<T> clazz)
Call this method on your configure method to create a configuration for some Type. Eg:

You can write something like:

 bindType(List.class).toClass(ArrayList.class);
 

That would cause Crux to inject a new instance of ArrayList whenever you declare a field of type List annotated with Inject

Type Parameters:
T -
Parameters:
clazz -
Returns:

isEnabled

protected boolean isEnabled()
Override this method if you need to specify some conditions that enables your configuration. Eg: You can enable a configuration for all client classes only when running on development environment.

Returns:


Copyright © 2014. All rights reserved.