Class ExtendedScopeResolver

  • All Implemented Interfaces:
    ScopeResolver

    public class ExtendedScopeResolver
    extends java.lang.Object
    implements ScopeResolver
    Wrapper for ScopeResolver with additional information useful for the internal workings of the injector framework.
    • Constructor Summary

      Constructors 
      Constructor Description
      ExtendedScopeResolver​(ScopeResolver delegate, boolean isPseudoScope, boolean isDependentScope)
      Constructs a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      CreationalContext<?> find​(java.lang.Object key)
      Find an existing CreationalContext by key in the current active scope, or return null if no context was found in the given scope with the given key.
      java.lang.annotation.Annotation getAnnotation()
      Returns the annotation this resolver handles.
      boolean isActive()
      Returns true when this scope is currently active, otherwise false.
      boolean isDependentScope()
      Returns whether this ScopeResolver represents the dependent pseudo-scope.
      boolean isPseudoScope()
      Returns whether this ScopeResolver represents a pseudo-scope.
      void put​(java.lang.Object key, CreationalContext<?> creationalContext)
      Adds a CreationalContext to this scope resolver under the given key.
      void remove​(java.lang.Object key)
      Removes the given key from this scope resolver.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExtendedScopeResolver

        public ExtendedScopeResolver​(ScopeResolver delegate,
                                     boolean isPseudoScope,
                                     boolean isDependentScope)
        Constructs a new instance.
        Parameters:
        delegate - a delegate ScopeResolver, cannot be null
        isPseudoScope - whether the delegate represents a pseudo-scope
        isDependentScope - whether the delegate represents the dependent scope
    • Method Detail

      • isPseudoScope

        public boolean isPseudoScope()
        Returns whether this ScopeResolver represents a pseudo-scope.
        Returns:
        true if it represents a pseudo-scope, otherwise false
      • isDependentScope

        public boolean isDependentScope()
        Returns whether this ScopeResolver represents the dependent pseudo-scope.
        Returns:
        true if it represents the dependent pseudo-scope, otherwise false
      • getAnnotation

        public java.lang.annotation.Annotation getAnnotation()
        Description copied from interface: ScopeResolver
        Returns the annotation this resolver handles. Returns null when the handler handles unscoped injectables.
        Specified by:
        getAnnotation in interface ScopeResolver
        Returns:
        the annotation this resolver handles, never null
      • isActive

        public boolean isActive()
        Description copied from interface: ScopeResolver
        Returns true when this scope is currently active, otherwise false.
        Specified by:
        isActive in interface ScopeResolver
        Returns:
        true when this scope is currently active, otherwise false
      • remove

        public void remove​(java.lang.Object key)
        Description copied from interface: ScopeResolver
        Removes the given key from this scope resolver.
        Specified by:
        remove in interface ScopeResolver
        Parameters:
        key - an object suitable as a key for use in a map, cannot be null