/** * Extract the stereotype to use for the specified compatible filter. * @param filter the filter to handle * @return the stereotype in the index matching this filter * @since 5.0 * @see #indexSupportsIncludeFilter(TypeFilter) */ @Nullable private String extractStereotype(TypeFilter filter) { if (filter instanceof AnnotationTypeFilter) { return ((AnnotationTypeFilter) filter).getAnnotationType().getName(); } if (filter instanceof AssignableTypeFilter) { return ((AssignableTypeFilter) filter).getTargetType().getName(); } return null; }
/** * Extract the stereotype to use for the specified compatible filter. * @param filter the filter to handle * @return the stereotype in the index matching this filter * @since 5.0 * @see #indexSupportsIncludeFilter(TypeFilter) */ @Nullable private String extractStereotype(TypeFilter filter) { if (filter instanceof AnnotationTypeFilter) { return ((AnnotationTypeFilter) filter).getAnnotationType().getName(); } if (filter instanceof AssignableTypeFilter) { return ((AssignableTypeFilter) filter).getTargetType().getName(); } return null; }
/** * Determine if the specified include {@link TypeFilter} is supported by the index. * @param filter the filter to check * @return whether the index supports this include filter * @since 5.0 * @see #extractStereotype(TypeFilter) */ private boolean indexSupportsIncludeFilter(TypeFilter filter) { if (filter instanceof AnnotationTypeFilter) { Class<? extends Annotation> annotation = ((AnnotationTypeFilter) filter).getAnnotationType(); return (AnnotationUtils.isAnnotationDeclaredLocally(Indexed.class, annotation) || annotation.getName().startsWith("javax.")); } if (filter instanceof AssignableTypeFilter) { Class<?> target = ((AssignableTypeFilter) filter).getTargetType(); return AnnotationUtils.isAnnotationDeclaredLocally(Indexed.class, target); } return false; }
/** * Determine if the specified include {@link TypeFilter} is supported by the index. * @param filter the filter to check * @return whether the index supports this include filter * @since 5.0 * @see #extractStereotype(TypeFilter) */ private boolean indexSupportsIncludeFilter(TypeFilter filter) { if (filter instanceof AnnotationTypeFilter) { Class<? extends Annotation> annotation = ((AnnotationTypeFilter) filter).getAnnotationType(); return (AnnotationUtils.isAnnotationDeclaredLocally(Indexed.class, annotation) || annotation.getName().startsWith("javax.")); } if (filter instanceof AssignableTypeFilter) { Class<?> target = ((AssignableTypeFilter) filter).getTargetType(); return AnnotationUtils.isAnnotationDeclaredLocally(Indexed.class, target); } return false; }
Set<String> candidates = new HashSet<>(); for (AnnotationTypeFilter filter : entityTypeFilters) { candidates.addAll(this.componentsIndex.getCandidateTypes(pkg, filter.getAnnotationType().getName()));
Set<String> candidates = new HashSet<>(); for (AnnotationTypeFilter filter : entityTypeFilters) { candidates.addAll(this.componentsIndex.getCandidateTypes(pkg, filter.getAnnotationType().getName()));
/** * Extract the stereotype to use for the specified compatible filter. * @param filter the filter to handle * @return the stereotype in the index matching this filter * @since 5.0 * @see #indexSupportsIncludeFilter(TypeFilter) */ @Nullable private String extractStereotype(TypeFilter filter) { if (filter instanceof AnnotationTypeFilter) { return ((AnnotationTypeFilter) filter).getAnnotationType().getName(); } if (filter instanceof AssignableTypeFilter) { return ((AssignableTypeFilter) filter).getTargetType().getName(); } return null; }
/** * Determine if the specified include {@link TypeFilter} is supported by the index. * @param filter the filter to check * @return whether the index supports this include filter * @since 5.0 * @see #extractStereotype(TypeFilter) */ private boolean indexSupportsIncludeFilter(TypeFilter filter) { if (filter instanceof AnnotationTypeFilter) { Class<? extends Annotation> annotation = ((AnnotationTypeFilter) filter).getAnnotationType(); return (AnnotationUtils.isAnnotationDeclaredLocally(Indexed.class, annotation) || annotation.getName().startsWith("javax.")); } if (filter instanceof AssignableTypeFilter) { Class<?> target = ((AssignableTypeFilter) filter).getTargetType(); return AnnotationUtils.isAnnotationDeclaredLocally(Indexed.class, target); } return false; }