com.nikedlab.android.inject.ApplicationContext Maven / Gradle / Ivy
package com.nikedlab.android.inject;
import java.util.List;
public interface ApplicationContext {
/**
* Get application context bean.
* @param interfaceClass Class of bean.
* @return Configured bean.
*/
public T getBean(Class interfaceClass);
/**
* Get application context bean.
* @param name Name of bean.
* @return Configured bean.
*/
public T getBean(String name);
/**
* Check if application context contains bean.
* @param interfaceClass Class of bean.
* @return True if application context contains bean with type interfaceClass.
*/
public boolean containsType(Class interfaceClass);
/**
* Bind interface with implementation.
* @param interfaceClass Interface class.
* @param implementationClass Implementation class.
*/
void bind(Class extends Object> interfaceClass, Class extends Object> implementationClass);
/**
* Bind implementation with annotations.
* @param implementationClass Implementation class.
*/
void bind(Class extends Object> implementationClass);
/**
* Bind singleton to interfaceClass.
* @param interfaceClass Interface class.
* @param singleton Singleton.
*/
void bindInstance(Class extends Object> interfaceClass, Object singleton);
/**
* Add factory binding.
* @param interfaceClass Interface class.
* @param factory Factory to create singleton instance.
*/
void bindFactory(Class extends Object> interfaceClass, BindingFactory factory);
/**
* Setter for config from context.xml
* @param beans {@link Bean}
*/
void setConfig(List beans);
}