public class Annotations extends Object
| Constructor and Description |
|---|
Annotations()
|
| Modifier and Type | Method and Description |
|---|---|
static Annotation |
canonicalizeIfNamed(Annotation
If the annotation is an instance of
javax.inject.Named, canonicalizes to com.google.guice.name.Named.
|
static Class |
canonicalizeIfNamed(Class
If the annotation is the class
javax.inject.Named, canonicalizes to com.google.guice.name.Named.
|
static void |
checkForMisplacedScopeAnnotations(Class
Adds an error if there is a misplaced annotations on
type.
|
static Annotation |
findBindingAnnotation(Errors
Returns the binding annotation on
member, or null if there isn't one.
|
static Class |
findScopeAnnotation(Errors
Returns the scoping annotation, or null if there isn't one.
|
static Class |
findScopeAnnotation(Errors
Returns the scope annotation on
type, or null if none is specified.
|
static <T extends Annotation |
generateAnnotation(Class
Generates an Annotation for the annotation class.
|
static Key |
getKey(TypeLiteral
Gets a key for the given type, member and annotations.
|
static boolean |
isAllDefaultMethods(Class
|
static boolean |
isBindingAnnotation(Class
Returns true if annotations of the specified type are binding annotations.
|
static boolean |
isMarker(Class
Returns
true if the given annotation type has no attributes.
|
static boolean |
isRetainedAtRuntime(Class
Returns true if the given annotation is retained at runtime.
|
static boolean |
isScopeAnnotation(Class
|
public static boolean isMarker(Class<? extends Annotation > annotationType)
true if the given annotation type has no attributes.
public static boolean isAllDefaultMethods(Class<? extends Annotation > annotationType)
public static <T extends Annotation> T generateAnnotation(Class <T> annotationType)
public static boolean isRetainedAtRuntime(Class<? extends Annotation > annotationType)
public static Class<? extends Annotation > findScopeAnnotation(Errors errors, Class <?> implementation)
type, or null if none is specified.
public static Class<? extends Annotation > findScopeAnnotation(Errors errors, Annotation [] annotations)
public static boolean isScopeAnnotation(Class<? extends Annotation > annotationType)
public static void checkForMisplacedScopeAnnotations(Class<?> type, Object source, Errors errors)
type. Scoping annotations are not allowed on abstract classes or interfaces.
public static Key<?> getKey(TypeLiteral <?> type, Member member, Annotation [] annotations, Errors errors) throws ErrorsException
ErrorsException
public static AnnotationfindBindingAnnotation(Errors errors, Member member, Annotation [] annotations)
member, or null if there isn't one.
public static boolean isBindingAnnotation(Class<? extends Annotation > annotationType)
public static AnnotationcanonicalizeIfNamed(Annotation annotation)
javax.inject.Named, canonicalizes to com.google.guice.name.Named. Returns the given annotation otherwise.
public static Class<? extends Annotation > canonicalizeIfNamed(Class <? extends Annotation > annotationType)
javax.inject.Named, canonicalizes to com.google.guice.name.Named. Returns the given annotation class otherwise.