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

com.google.inject.spi.DefaultBindingScopingVisitor Maven / Gradle / Ivy

package com.google.inject.spi;

import com.google.inject.Scope;

import java.lang.annotation.Annotation;

/**
 * No-op visitor for subclassing. All interface methods simply delegate to
 * {@link #visitOther()}, returning its result.
 *
 * @param  any type to be returned by the visit method. Use {@link Void} with
 *            {@code return null} if no return type is needed.
 */
public class DefaultBindingScopingVisitor implements BindingScopingVisitor {

    /**
     * Default visit implementation. Returns {@code null}.
     */
    protected V visitOther() {
        return null;
    }

    @Override
    public V visitEagerSingleton() {
        return visitOther();
    }

    @Override
    public V visitScope(Scope scope) {
        return visitOther();
    }

    @Override
    public V visitScopeAnnotation(Class scopeAnnotation) {
        return visitOther();
    }

    @Override
    public V visitNoScoping() {
        return visitOther();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy