From 17b69d672f8e4f5e99f54256a4141320b0a846e0 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 4 Oct 2014 13:09:39 -0400 Subject: Add version 1.2 site. --- .../contextual/ContextSensitiveProvider.html | 276 +++++++++++++++++++++ 1 file changed, 276 insertions(+) create mode 100644 1.2/sangria-contextual/apidocs/com/tavianator/sangria/contextual/ContextSensitiveProvider.html (limited to '1.2/sangria-contextual/apidocs/com/tavianator/sangria/contextual/ContextSensitiveProvider.html') diff --git a/1.2/sangria-contextual/apidocs/com/tavianator/sangria/contextual/ContextSensitiveProvider.html b/1.2/sangria-contextual/apidocs/com/tavianator/sangria/contextual/ContextSensitiveProvider.html new file mode 100644 index 0000000..5bffd1d --- /dev/null +++ b/1.2/sangria-contextual/apidocs/com/tavianator/sangria/contextual/ContextSensitiveProvider.html @@ -0,0 +1,276 @@ + + + + + + +ContextSensitiveProvider (Sangria Contextual 1.2 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. All rights reserved.

+ + -- cgit v1.2.3