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

org.osgl.inject.Injector Maven / Gradle / Ivy

There is a newer version: 1.13.2
Show newest version
package org.osgl.inject;

import javax.inject.Provider;
import java.lang.annotation.Annotation;

/**
 * A generic Injector interface defines the contract
 * a dependency injector like {@link Genie} should provide
 */
public interface Injector {
    /**
     * Returns a bean of given type
     *
     * @param type the class of the bean
     * @param   generic type of the bean
     * @return the bean
     */
     T get(Class type);

    /**
     * Returns a provider of given type
     * @param type the class of the bean that provider provides
     * @param  the generic type of the bean
     * @return the provider that provides the bean
     */
     Provider getProvider(Class type);

    /**
     * Check if a supplied annotation class is a {@link javax.inject.Qualifier}
     * @param annoClass
     * @return `true` if the annotation type is a qualifier or `false` otherwise
     */
    boolean isQualifier(Class annoClass);

    /**
     * Check if a supplied annotation class specifies a {@link PostConstructProcessor}
     * @param annoClass the annotation type
     * @return `true` if the annotation type specifies post construct processor
     */
    boolean isPostConstructProcessor(Class annoClass);

    /**
     * Check if a supplied annotation class is a {@link javax.inject.Scope} annotation
     * @param annoClass the annotation type
     * @return `true` if the annotation type indicate a scope
     */
    boolean isScope(Class annoClass);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy