Package org.eclipse.sisu.inject
Enum QualifyingStrategy
- java.lang.Object
-
- java.lang.Enum<QualifyingStrategy>
-
- org.eclipse.sisu.inject.QualifyingStrategy
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<QualifyingStrategy>
enum QualifyingStrategy extends java.lang.Enum<QualifyingStrategy>
Enumerates the different strategies for qualifyingBindings against requirementKeys.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description MARKEDMARKED_WITH_ATTRIBUTESNAMEDNAMED_WITH_ATTRIBUTESUNRESTRICTED
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.annotation.AnnotationBLANK_QUALIFIER(package private) static java.lang.annotation.AnnotationDEFAULT_QUALIFIER
-
Constructor Summary
Constructors Modifier Constructor Description privateQualifyingStrategy()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) abstract java.lang.annotation.Annotationqualifies(com.google.inject.Key<?> requirement, com.google.inject.Binding<?> binding)Attempts to qualify the givenBindingagainst the requirementKey.(package private) static java.lang.annotation.Annotationqualify(com.google.inject.Key<?> key)Computes a canonicalQualifierannotation for the given bindingKey.(package private) static QualifyingStrategyselectFor(com.google.inject.Key<?> key)Selects the appropriate qualifying strategy for the given requirementKey.static QualifyingStrategyvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static QualifyingStrategy[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
UNRESTRICTED
public static final QualifyingStrategy UNRESTRICTED
-
NAMED
public static final QualifyingStrategy NAMED
-
NAMED_WITH_ATTRIBUTES
public static final QualifyingStrategy NAMED_WITH_ATTRIBUTES
-
MARKED
public static final QualifyingStrategy MARKED
-
MARKED_WITH_ATTRIBUTES
public static final QualifyingStrategy MARKED_WITH_ATTRIBUTES
-
-
Method Detail
-
values
public static QualifyingStrategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (QualifyingStrategy c : QualifyingStrategy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static QualifyingStrategy valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
qualifies
abstract java.lang.annotation.Annotation qualifies(com.google.inject.Key<?> requirement, com.google.inject.Binding<?> binding)Attempts to qualify the givenBindingagainst the requirementKey.- Parameters:
requirement- The requirement keybinding- The binding to qualify- Returns:
- Qualifier annotation when the binding qualifies; otherwise
null
-
selectFor
static final QualifyingStrategy selectFor(com.google.inject.Key<?> key)
Selects the appropriate qualifying strategy for the given requirementKey.- Parameters:
key- The requirement key- Returns:
- Qualifying strategy
-
qualify
static final java.lang.annotation.Annotation qualify(com.google.inject.Key<?> key)
Computes a canonicalQualifierannotation for the given bindingKey.- Parameters:
key- The key to qualify- Returns:
- Qualifier for the key
-
-