Class Sources


  • public final class Sources
    extends java.lang.Object
    Utility methods for dealing with annotated sources.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Sources()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Description describe​(java.lang.Object source, java.lang.String value)
      Describes the given binding source with the given description.
      static Description describe​(java.lang.String value)
      Describes a new binding source with the given description.
      static <T extends java.lang.annotation.Annotation>
      T
      getAnnotation​(com.google.inject.Binding<?> binding, java.lang.Class<T> annotationType)
      Searches the binding's source and implementation for an annotation of the given type.
      static Hidden hide()
      Hides a new binding source from the bean locator.
      static Hidden hide​(java.lang.Object source)
      Hides the given binding source from the bean locator.
      static Priority prioritize​(int value)
      Prioritizes a new binding source with the given priority.
      static Priority prioritize​(java.lang.Object source, int value)
      Prioritizes the given binding source with the given priority.
      • Methods inherited from class java.lang.Object

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

      • Sources

        private Sources()
    • Method Detail

      • hide

        public static Hidden hide()
        Hides a new binding source from the bean locator.
        Returns:
        Hidden source
      • hide

        public static Hidden hide​(java.lang.Object source)
        Hides the given binding source from the bean locator.
        Parameters:
        source - The source
        Returns:
        Hidden source
      • describe

        public static Description describe​(java.lang.String value)
        Describes a new binding source with the given description.
        Parameters:
        value - The description
        Returns:
        Described source
      • describe

        public static Description describe​(java.lang.Object source,
                                           java.lang.String value)
        Describes the given binding source with the given description.
        Parameters:
        source - The source
        value - The description
        Returns:
        Described source
      • prioritize

        public static Priority prioritize​(int value)
        Prioritizes a new binding source with the given priority.
        Parameters:
        value - The priority
        Returns:
        Prioritized source
      • prioritize

        public static Priority prioritize​(java.lang.Object source,
                                          int value)
        Prioritizes the given binding source with the given priority.
        Parameters:
        source - The source
        value - The priority
        Returns:
        Prioritized source
      • getAnnotation

        public static <T extends java.lang.annotation.Annotation> T getAnnotation​(com.google.inject.Binding<?> binding,
                                                                                  java.lang.Class<T> annotationType)
        Searches the binding's source and implementation for an annotation of the given type.
        Parameters:
        binding - The binding
        annotationType - The annotation type
        Returns:
        Annotation instance; null if it doesn't exist