From 278bfc319cc905bdf150af814bb3461896b68444 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 25 Oct 2015 13:35:25 -0400 Subject: Add version 1.3.1 site. --- .../contextual/ContextSensitiveProvider.html | 278 +++++++++++++++++++++ 1 file changed, 278 insertions(+) create mode 100644 1.3.1/apidocs/com/tavianator/sangria/contextual/ContextSensitiveProvider.html (limited to '1.3.1/apidocs/com/tavianator/sangria/contextual/ContextSensitiveProvider.html') diff --git a/1.3.1/apidocs/com/tavianator/sangria/contextual/ContextSensitiveProvider.html b/1.3.1/apidocs/com/tavianator/sangria/contextual/ContextSensitiveProvider.html new file mode 100644 index 0000000..52ca947 --- /dev/null +++ b/1.3.1/apidocs/com/tavianator/sangria/contextual/ContextSensitiveProvider.html @@ -0,0 +1,278 @@ + + + + + + +ContextSensitiveProvider (Sangria 1.3.1 API) + + + + + + + + +
+ + + + + + + +
+ + + +
+
com.tavianator.sangria.contextual
+

Interface ContextSensitiveProvider<T>

+
+
+
+
    +
  • +
    +
    +
    public interface ContextSensitiveProvider<T>
    +
    Like a Provider, but with knowledge of the target InjectionPoint. + +

    + This interface, along with ContextSensitiveBinder, is useful for injecting custom logger types, among other + things. However, context-sensitive injections can make maintenance and debugging more difficult. +

    +
    +
    Since:
    +
    1.0
    +
    Version:
    +
    1.0
    +
    Author:
    +
    Tavian Barnes (tavianator@tavianator.com)
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getInContext

        +
        T getInContext(InjectionPoint injectionPoint)
        +
        Provide an instance of T for the given context.
        +
        +
        Parameters:
        +
        injectionPoint - The InjectionPoint for this provision.
        +
        Returns:
        +
        An instance of T.
        +
        +
      • +
      + + + +
        +
      • +

        getInUnknownContext

        +
        T getInUnknownContext()
        +
        Provide an instance of T for an unknown context. +

        + The InjectionPoint may not be known in all cases, for example if a Provider<T> is used instead + of + a bare T. This method will be called in those cases. +

        +

        + One reasonable implementation is to return a generically applicable instance, such as an anonymous logger. + Another valid implementation is to throw an unchecked exception; in that case, Provider<T> injections + will fail. +

        +
        +
        Returns:
        +
        An instance of T
        +
        Throws:
        +
        RuntimeException - If injection without a context is not supported.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + +

Copyright © 2014–2015. All rights reserved.

+ + -- cgit v1.2.3