Package org.eclipse.sisu.inject
Class Sources
- java.lang.Object
-
- org.eclipse.sisu.inject.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>
TgetAnnotation(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.
-
-
-
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 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(java.lang.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 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 bindingannotationType
- The annotation type- Returns:
- Annotation instance;
null
if it doesn't exist
-
-