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

ch.jalu.injector.context.InstantiationContext Maven / Gradle / Ivy

There is a newer version: 1.0
Show newest version
package ch.jalu.injector.context;

import ch.jalu.injector.Injector;

/**
 * Context of instantiation.
 */
public abstract class InstantiationContext {

    protected final Injector injector;
    protected final ResolutionType resolutionType;
    protected final Class originalClass;
    protected Class mappedClass;

    public InstantiationContext(Injector injector, ResolutionType resolutionType, Class originalClass) {
        this(injector, resolutionType, originalClass, originalClass);
    }

    public InstantiationContext(Injector injector, ResolutionType resolutionType, Class originalClass,
                                Class mappedClass) {
        this.injector = injector;
        this.originalClass = originalClass;
        this.resolutionType = resolutionType;
        this.mappedClass = mappedClass;
    }

    /**
     * @return the injector
     */
    public Injector getInjector() {
        return injector;
    }

    /**
     * @return the context in which the object should be instantiated
     */
    public ResolutionType getResolutionType() {
        return resolutionType;
    }

    /**
     * @return the class that was originally requested (may differ from the mapped class)
     */
    public Class getOriginalClass() {
        return originalClass;
    }

    /**
     * @return the class that should be instantiated
     */
    public Class getMappedClass() {
        return mappedClass;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy