Class Annotations
- java.lang.Object
-
- org.elasticsearch.common.inject.internal.Annotations
-
public class Annotations extends Object
Annotation utilities.- Author:
- crazybob@google.com (Bob Lee)
-
-
Constructor Summary
Constructors Constructor Description Annotations()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcheckForMisplacedScopeAnnotations(Class<?> type, Object source, Errors errors)Adds an error if there is a misplaced annotations ontype.static AnnotationfindBindingAnnotation(Errors errors, Member member, Annotation[] annotations)Returns the binding annotation onmember, or null if there isn't one.static Class<? extends Annotation>findScopeAnnotation(Errors errors, Annotation[] annotations)Returns the scoping annotation, or null if there isn't one.static Class<? extends Annotation>findScopeAnnotation(Errors errors, Class<?> implementation)Returns the scope annotation ontype, or null if none is specified.static Key<?>getKey(TypeLiteral<?> type, Member member, Annotation[] annotations, Errors errors)Gets a key for the given type, member and annotations.static booleanisRetainedAtRuntime(Class<? extends Annotation> annotationType)Returns true if the given annotation is retained at runtime.static booleanisScopeAnnotation(Class<? extends Annotation> annotationType)
-
-
-
Method Detail
-
isRetainedAtRuntime
public static boolean isRetainedAtRuntime(Class<? extends Annotation> annotationType)
Returns true if the given annotation is retained at runtime.
-
findScopeAnnotation
public static Class<? extends Annotation> findScopeAnnotation(Errors errors, Class<?> implementation)
Returns the scope annotation ontype, or null if none is specified.
-
findScopeAnnotation
public static Class<? extends Annotation> findScopeAnnotation(Errors errors, Annotation[] annotations)
Returns the scoping annotation, or null if there isn't one.
-
isScopeAnnotation
public static boolean isScopeAnnotation(Class<? extends Annotation> annotationType)
-
checkForMisplacedScopeAnnotations
public static void checkForMisplacedScopeAnnotations(Class<?> type, Object source, Errors errors)
Adds an error if there is a misplaced annotations ontype. Scoping annotations are not allowed on abstract classes or interfaces.
-
getKey
public static Key<?> getKey(TypeLiteral<?> type, Member member, Annotation[] annotations, Errors errors) throws ErrorsException
Gets a key for the given type, member and annotations.- Throws:
ErrorsException
-
findBindingAnnotation
public static Annotation findBindingAnnotation(Errors errors, Member member, Annotation[] annotations)
Returns the binding annotation onmember, or null if there isn't one.
-
-