private static void ensureRetainedAtRuntime(Class<? extends Annotation> annotationType) { checkArgument( Annotations.isRetainedAtRuntime(annotationType), "%s is not retained at runtime. Please annotate it with @Retention(RUNTIME).", annotationType.getName()); }
@Override public Boolean visit(ScopeBinding command) { Scope scope = checkNotNull(command.getScope(), "scope"); Class<? extends Annotation> annotationType = checkNotNull(command.getAnnotationType(), "annotation type"); if (!Annotations.isScopeAnnotation(annotationType)) { errors.missingScopeAnnotation(annotationType); // Go ahead and bind anyway so we don't get collateral errors. } if (!Annotations.isRetainedAtRuntime(annotationType)) { errors.missingRuntimeRetention(annotationType); // Go ahead and bind anyway so we don't get collateral errors. } ScopeBinding existing = injector.state.getScopeBinding(annotationType); if (existing != null) { if (!scope.equals(existing.getScope())) { errors.duplicateScopes(existing, annotationType, scope); } } else { injector.state.putScopeBinding(annotationType, command); } return true; } }
private static void ensureRetainedAtRuntime(Class<? extends Annotation> annotationType) { checkArgument( Annotations.isRetainedAtRuntime(annotationType), "%s is not retained at runtime. Please annotate it with @Retention(RUNTIME).", annotationType.getName()); }
private static void ensureRetainedAtRuntime(Class<? extends Annotation> annotationType) { checkArgument( Annotations.isRetainedAtRuntime(annotationType), "%s is not retained at runtime. Please annotate it with @Retention(RUNTIME).", annotationType.getName()); }
private static void ensureRetainedAtRuntime( Class<? extends Annotation> annotationType) { checkArgument(Annotations.isRetainedAtRuntime(annotationType), "%s is not retained at runtime. Please annotate it with @Retention(RUNTIME).", annotationType.getName()); }
private static void ensureRetainedAtRuntime( Class<? extends Annotation> annotationType) { checkArgument(Annotations.isRetainedAtRuntime(annotationType), "%s is not retained at runtime. Please annotate it with @Retention(RUNTIME).", annotationType.getName()); }
private static void ensureRetainedAtRuntime( Class<? extends Annotation> annotationType) { checkArgument(Annotations.isRetainedAtRuntime(annotationType), "%s is not retained at runtime. Please annotate it with @Retention(RUNTIME).", annotationType.getName()); }
private static void ensureRetainedAtRuntime( Class<? extends Annotation> annotationType) { checkArgument(Annotations.isRetainedAtRuntime(annotationType), "%s is not retained at runtime. Please annotate it with @Retention(RUNTIME).", annotationType.getName()); }
@Override public Boolean visit(ScopeBinding command) { Scope scope = checkNotNull(command.getScope(), "scope"); Class<? extends Annotation> annotationType = checkNotNull(command.getAnnotationType(), "annotation type"); if (!Annotations.isScopeAnnotation(annotationType)) { errors.missingScopeAnnotation(annotationType); // Go ahead and bind anyway so we don't get collateral errors. } if (!Annotations.isRetainedAtRuntime(annotationType)) { errors.missingRuntimeRetention(annotationType); // Go ahead and bind anyway so we don't get collateral errors. } ScopeBinding existing = injector.state.getScopeBinding(annotationType); if (existing != null) { if (!scope.equals(existing.getScope())) { errors.duplicateScopes(existing, annotationType, scope); } } else { injector.state.putScopeBinding(annotationType, command); } return true; } }
@Override public Boolean visit(ScopeBinding command) { Scope scope = checkNotNull(command.getScope(), "scope"); Class<? extends Annotation> annotationType = checkNotNull(command.getAnnotationType(), "annotation type"); if (!Annotations.isScopeAnnotation(annotationType)) { errors.missingScopeAnnotation(annotationType); // Go ahead and bind anyway so we don't get collateral errors. } if (!Annotations.isRetainedAtRuntime(annotationType)) { errors.missingRuntimeRetention(annotationType); // Go ahead and bind anyway so we don't get collateral errors. } ScopeBinding existing = injector.state.getScopeBinding(annotationType); if (existing != null) { if (!scope.equals(existing.getScope())) { errors.duplicateScopes(existing, annotationType, scope); } } else { injector.state.putScopeBinding(annotationType, command); } return true; } }
@Override public Boolean visit(ScopeBinding command) { Scope scope = checkNotNull(command.getScope(), "scope"); Class<? extends Annotation> annotationType = checkNotNull(command.getAnnotationType(), "annotation type"); if (!Annotations.isScopeAnnotation(annotationType)) { errors.missingScopeAnnotation(annotationType); // Go ahead and bind anyway so we don't get collateral errors. } if (!Annotations.isRetainedAtRuntime(annotationType)) { errors.missingRuntimeRetention(annotationType); // Go ahead and bind anyway so we don't get collateral errors. } ScopeBinding existing = injector.state.getScopeBinding(annotationType); if (existing != null) { if (!scope.equals(existing.getScope())) { errors.duplicateScopes(existing, annotationType, scope); } } else { injector.state.putScopeBinding(annotationType, command); } return true; } }
@Override public Boolean visit(ScopeBinding command) { Scope scope = command.getScope(); Class<? extends Annotation> annotationType = command.getAnnotationType(); if (!Annotations.isScopeAnnotation(annotationType)) { errors.withSource(annotationType).missingScopeAnnotation(); // Go ahead and bind anyway so we don't get collateral errors. } if (!Annotations.isRetainedAtRuntime(annotationType)) { errors.withSource(annotationType) .missingRuntimeRetention(command.getSource()); // Go ahead and bind anyway so we don't get collateral errors. } Scope existing = injector.state.getScope(checkNotNull(annotationType, "annotation type")); if (existing != null) { errors.duplicateScopes(existing, annotationType, scope); } else { injector.state.putAnnotation(annotationType, checkNotNull(scope, "scope")); } return true; } }
@Override public Boolean visit(ScopeBinding command) { Scope scope = command.getScope(); Class<? extends Annotation> annotationType = command.getAnnotationType(); if (!Annotations.isScopeAnnotation(annotationType)) { errors.withSource(annotationType).missingScopeAnnotation(); // Go ahead and bind anyway so we don't get collateral errors. } if (!Annotations.isRetainedAtRuntime(annotationType)) { errors.withSource(annotationType) .missingRuntimeRetention(command.getSource()); // Go ahead and bind anyway so we don't get collateral errors. } Scope existing = injector.state.getScope(checkNotNull(annotationType, "annotation type")); if (existing != null) { errors.duplicateScopes(existing, annotationType, scope); } else { injector.state.putAnnotation(annotationType, checkNotNull(scope, "scope")); } return true; } }
@Override public Boolean visit(ScopeBinding command) { Scope scope = command.getScope(); Class<? extends Annotation> annotationType = command.getAnnotationType(); if (!Annotations.isScopeAnnotation(annotationType)) { errors.withSource(annotationType).missingScopeAnnotation(); // Go ahead and bind anyway so we don't get collateral errors. } if (!Annotations.isRetainedAtRuntime(annotationType)) { errors.withSource(annotationType) .missingRuntimeRetention(command.getSource()); // Go ahead and bind anyway so we don't get collateral errors. } Scope existing = injector.state.getScope(checkNotNull(annotationType, "annotation type")); if (existing != null) { errors.duplicateScopes(existing, annotationType, scope); } else { injector.state.putAnnotation(annotationType, checkNotNull(scope, "scope")); } return true; } }