Class Scoping


public abstract class Scoping
extends java.lang.Object
References a scope, either directly (as a scope instance), or indirectly (as a scope annotation). The scope's eager or laziness is also exposed.
  • Field Details

  • Method Details

    • forAnnotation

      public static Scoping forAnnotation​(java.lang.Class<? extends java.lang.annotation.Annotation> scopingAnnotation)
    • forInstance

      public static Scoping forInstance​(Scope scope)
    • isExplicitlyScoped

      public boolean isExplicitlyScoped()
      Returns true if this scope was explicitly applied. If no scope was explicitly applied then the scoping annotation will be used.
    • isNoScope

      public boolean isNoScope()
      Returns true if this is the default scope. In this case a new instance will be provided for each injection.
    • isEagerSingleton

      public boolean isEagerSingleton​(Stage stage)
      Returns true if this scope is a singleton that should be loaded eagerly in stage.
    • getScopeInstance

      public Scope getScopeInstance()
      Returns the scope instance, or null if that isn't known for this instance.
    • getScopeAnnotation

      public java.lang.Class<? extends java.lang.annotation.Annotation> getScopeAnnotation()
      Returns the scope annotation, or null if that isn't known for this instance.
    • acceptVisitor

      public abstract <V> V acceptVisitor​(BindingScopingVisitor<V> visitor)
    • applyTo

      public abstract void applyTo​(ScopedBindingBuilder scopedBindingBuilder)