@Override public Set<Annotation> apply(Class<?> javaClass) { Set<Annotation> annotations = getAnnotations(javaClass); boolean scopeFound = false; for (Annotation annotation : annotations) { boolean isScope = getAnnotationClass(annotation.annotationType()).isScope(); if (isScope && scopeFound) { // there are at least two scopes, we need to choose one using scope inheritance rules (4.1) return applyScopeInheritanceRules(annotations, javaClass); } if (isScope) { scopeFound = true; } } return annotations; }
public Set<Annotation> applyScopeInheritanceRules(Set<Annotation> annotations, Class<?> javaClass) { ImmutableSet.Builder<Annotation> result = ImmutableSet.builder(); for (Annotation annotation : annotations) { if (!getAnnotationClass(annotation.annotationType()).isScope()) { result.add(annotation); } } result.addAll(findTopLevelScopeDefinitions(javaClass)); return result.build(); }
this.backedAnnotatedTypeAnnotations = cacheBuilder.build(new BackedAnnotatedTypeAnnotationsFunction()); this.isScopeAnnotation = cacheBuilder.build(new IsScopeAnnotationFunction());
@Override public Set<Annotation> apply(Class<?> javaClass) { Set<Annotation> annotations = getAnnotations(javaClass); boolean scopeFound = false; for (Annotation annotation : annotations) { boolean isScope = getAnnotationClass(annotation.annotationType()).isScope(); if (isScope && scopeFound) { // there are at least two scopes, we need to choose one using scope inheritance rules (4.1) return applyScopeInheritanceRules(annotations, javaClass); } if (isScope) { scopeFound = true; } } return annotations; }
@Override public Set<Annotation> apply(Class<?> javaClass) { Set<Annotation> annotations = getAnnotations(javaClass); boolean scopeFound = false; for (Annotation annotation : annotations) { boolean isScope = getAnnotationClass(annotation.annotationType()).isScope(); if (isScope && scopeFound) { // there are at least two scopes, we need to choose one using scope inheritance rules (4.1) return applyScopeInheritanceRules(annotations, javaClass); } if (isScope) { scopeFound = true; } } return annotations; }
@Override public Set<Annotation> apply(Class<?> javaClass) { Set<Annotation> annotations = getAnnotations(javaClass); boolean scopeFound = false; for (Annotation annotation : annotations) { boolean isScope = getAnnotationClass(annotation.annotationType()).isScope(); if (isScope && scopeFound) { // there are at least two scopes, we need to choose one using scope inheritance rules (4.1) return applyScopeInheritanceRules(annotations, javaClass); } if (isScope) { scopeFound = true; } } return annotations; }
@Override public Set<Annotation> apply(Class<?> javaClass) { Set<Annotation> annotations = getAnnotationSet(javaClass); boolean scopeFound = false; for (Annotation annotation : annotations) { boolean isScope = isScopeAnnotation.getValue(annotation.annotationType()); if (isScope && scopeFound) { // there are at least two scopes, we need to choose one using scope inheritance rules (4.1) return applyScopeInheritanceRules(annotations, javaClass); } if (isScope) { scopeFound = true; } } return annotations; }
@Override public Set<Annotation> apply(Class<?> javaClass) { Set<Annotation> annotations = getAnnotations(javaClass); boolean scopeFound = false; for (Annotation annotation : annotations) { boolean isScope = getAnnotationClass(annotation.annotationType()).isScope(); if (isScope && scopeFound) { // there are at least two scopes, we need to choose one using scope inheritance rules (4.1) return applyScopeInheritanceRules(annotations, javaClass); } if (isScope) { scopeFound = true; } } return annotations; }
public Set<Annotation> applyScopeInheritanceRules(Set<Annotation> annotations, Class<?> javaClass) { ImmutableSet.Builder<Annotation> result = ImmutableSet.builder(); for (Annotation annotation : annotations) { if (!getAnnotationClass(annotation.annotationType()).isScope()) { result.add(annotation); } } result.addAll(findTopLevelScopeDefinitions(javaClass)); return result.build(); }
public Set<Annotation> applyScopeInheritanceRules(Set<Annotation> annotations, Class<?> javaClass) { ImmutableSet.Builder<Annotation> result = ImmutableSet.builder(); for (Annotation annotation : annotations) { if (!getAnnotationClass(annotation.annotationType()).isScope()) { result.add(annotation); } } result.addAll(findTopLevelScopeDefinitions(javaClass)); return result.build(); }
public DefaultReflectionCache(TypeStore store) { this.store = store; ComputingCacheBuilder cacheBuilder = ComputingCacheBuilder.newBuilder(); this.annotations = cacheBuilder.build(ANNOTATIONS_FUNCTION); this.declaredAnnotations = cacheBuilder.build(DECLARED_ANNOTATIONS_FUNCTION); this.backedAnnotatedTypeAnnotations = cacheBuilder.build(new BackedAnnotatedTypeAnnotationsFunction()); this.annotationClasses = cacheBuilder.build(new AnnotationClassFunction()); }
public Set<Annotation> applyScopeInheritanceRules(Set<Annotation> annotations, Class<?> javaClass) { ImmutableSet.Builder<Annotation> result = ImmutableSet.builder(); for (Annotation annotation : annotations) { if (!getAnnotationClass(annotation.annotationType()).isScope()) { result.add(annotation); } } result.addAll(findTopLevelScopeDefinitions(javaClass)); return result.build(); }
public DefaultReflectionCache(TypeStore store) { this.store = store; ComputingCacheBuilder cacheBuilder = ComputingCacheBuilder.newBuilder(); this.annotations = cacheBuilder.build(ANNOTATIONS_FUNCTION); this.declaredAnnotations = cacheBuilder.build(DECLARED_ANNOTATIONS_FUNCTION); this.backedAnnotatedTypeAnnotations = cacheBuilder.build(new BackedAnnotatedTypeAnnotationsFunction()); this.annotationClasses = cacheBuilder.build(new AnnotationClassFunction()); }
public Set<Annotation> applyScopeInheritanceRules(Set<Annotation> annotations, Class<?> javaClass) { ImmutableSet.Builder<Annotation> result = ImmutableSet.builder(); for (Annotation annotation : annotations) { if (!getAnnotationClass(annotation.annotationType()).isScope()) { result.add(annotation); } } result.addAll(findTopLevelScopeDefinitions(javaClass)); return result.build(); }
public DefaultReflectionCache(TypeStore store) { this.store = store; ComputingCacheBuilder cacheBuilder = ComputingCacheBuilder.newBuilder(); this.annotations = cacheBuilder.build(ANNOTATIONS_FUNCTION); this.declaredAnnotations = cacheBuilder.build(DECLARED_ANNOTATIONS_FUNCTION); this.backedAnnotatedTypeAnnotations = cacheBuilder.build(new BackedAnnotatedTypeAnnotationsFunction()); this.annotationClasses = cacheBuilder.build(new AnnotationClassFunction()); }
public Set<Annotation> applyScopeInheritanceRules(Set<Annotation> annotations, Class<?> javaClass) { Set<Annotation> result = new HashSet<Annotation>(); for (Annotation annotation : annotations) { if (!isScopeAnnotation.getValue(annotation.annotationType())) { result.add(annotation); } } result.addAll(findTopLevelScopeDefinitions(javaClass)); return ImmutableSet.copyOf(result); }
public DefaultReflectionCache(TypeStore store) { this.store = store; ComputingCacheBuilder cacheBuilder = ComputingCacheBuilder.newBuilder(); this.annotations = cacheBuilder.build(ANNOTATIONS_FUNCTION); this.declaredAnnotations = cacheBuilder.build(DECLARED_ANNOTATIONS_FUNCTION); this.backedAnnotatedTypeAnnotations = cacheBuilder.build(new BackedAnnotatedTypeAnnotationsFunction()); this.annotationClasses = cacheBuilder.build(new AnnotationClassFunction()); }
public DefaultReflectionCache(TypeStore store) { this.store = store; ComputingCacheBuilder cacheBuilder = ComputingCacheBuilder.newBuilder(); this.annotations = cacheBuilder.build(ANNOTATIONS_FUNCTION); this.declaredAnnotations = cacheBuilder.build(DECLARED_ANNOTATIONS_FUNCTION); this.backedAnnotatedTypeAnnotations = cacheBuilder.build(new BackedAnnotatedTypeAnnotationsFunction()); this.annotationClasses = cacheBuilder.build(new AnnotationClassFunction()); }