Package org.eclipse.sisu.inject
Class Sources
- java.lang.Object
-
- org.eclipse.sisu.inject.Sources
-
public final class Sources extends Object
Utility methods for dealing with annotated sources.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Descriptiondescribe(Object source, String value)Describes the given binding source with the given description.static Descriptiondescribe(String value)Describes a new binding source with the given description.static <T extends Annotation>
TgetAnnotation(com.google.inject.Binding<?> binding, Class<T> annotationType)Searches the binding's source and implementation for an annotation of the given type.static Hiddenhide()Hides a new binding source from the bean locator.static Hiddenhide(Object source)Hides the given binding source from the bean locator.static Priorityprioritize(int value)Prioritizes a new binding source with the given priority.static Priorityprioritize(Object source, int value)Prioritizes the given binding source with the given priority.
-
-
-
Method Detail
-
hide
public static Hidden hide()
Hides a new binding source from the bean locator.- Returns:
- Hidden source
-
hide
public static Hidden hide(Object source)
Hides the given binding source from the bean locator.- Parameters:
source- The source- Returns:
- Hidden source
-
describe
public static Description describe(String value)
Describes a new binding source with the given description.- Parameters:
value- The description- Returns:
- Described source
-
describe
public static Description describe(Object source, String value)
Describes the given binding source with the given description.- Parameters:
source- The sourcevalue- 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(Object source, int value)
Prioritizes the given binding source with the given priority.- Parameters:
source- The sourcevalue- The priority- Returns:
- Prioritized source
-
getAnnotation
public static <T extends Annotation> T getAnnotation(com.google.inject.Binding<?> binding, Class<T> annotationType)
Searches the binding's source and implementation for an annotation of the given type.- Parameters:
binding- The bindingannotationType- The annotation type- Returns:
- Annotation instance;
nullif it doesn't exist
-
-