All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nikedlab.android.inject.interfaces.ApplicationContext Maven / Gradle / Ivy

The newest version!
package com.nikedlab.android.inject.interfaces;


import com.nikedlab.android.inject.Bean;

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 interfaceClass, Class implementationClass);
	
	/**
	 * Bind implementation with annotations.
	 * @param implementationClass Implementation class.
	 */
	void bind(Class implementationClass);

	/**
	 * Bind singleton to interfaceClass.
	 * @param interfaceClass Interface class.
	 * @param singleton Singleton.
	 */
	void bindInstance(Class interfaceClass, Object singleton);
	
	/**
	 * Add factory binding.
	 * @param interfaceClass Interface class.
	 * @param factory Factory to create singleton instance.
	 */
	void bindFactory(Class interfaceClass, BindingFactory factory);

    /**
     * Setter for config from context.xml
     * @param beans {@link com.nikedlab.android.inject.Bean}
     */
    void setConfig(List beans);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy