Package org.springframework.core.type.filter

Examples of org.springframework.core.type.filter.AnnotationTypeFilter


  protected TypeFilter createTypeFilter(Element element, ClassLoader classLoader) {
    String filterType = element.getAttribute(FILTER_TYPE_ATTRIBUTE);
    String expression = element.getAttribute(FILTER_EXPRESSION_ATTRIBUTE);
    try {
      if ("annotation".equals(filterType)) {
        return new AnnotationTypeFilter((Class<Annotation>) classLoader.loadClass(expression));
      }
      else if ("assignable".equals(filterType)) {
        return new AssignableTypeFilter(classLoader.loadClass(expression));
      }
      else if ("regex".equals(filterType)) {
View Full Code Here


   */
  public AnnotationApplicationContext(ApplicationContext parent) {
    super(parent);
    registerDefaultPostProcessors();
    this.scanner = new ClassPathScanningCandidateComponentProvider(false);
    this.scanner.addIncludeFilter(new AnnotationTypeFilter(Configuration.class));
    this.scanner.setResourceLoader(this);
  }
View Full Code Here

   * @return new {@link ClassPathScanningCandidateComponentProvider}
   */
  public ClassPathScanningCandidateComponentProvider getProvider(ResourceLoader resourceLoader) {
    ClassPathScanningCandidateComponentProvider scanner;
    scanner = new ClassPathScanningCandidateComponentProvider(false);
    scanner.addIncludeFilter(new AnnotationTypeFilter(Configuration.class));
    scanner.addExcludeFilter(new NestedClassTypeFilter());
    scanner.setResourceLoader(resourceLoader);
    return scanner;
  }
View Full Code Here

   * {@link Component @Component} meta-annotation including the
   * {@link Repository @Repository}, {@link Service @Service}, and
   * {@link Controller @Controller} stereotype annotations.
   */
  protected void registerDefaultFilters() {
    this.includeFilters.add(new AnnotationTypeFilter(Component.class));
  }
View Full Code Here

    if (StringUtils.hasText(basePackage)) {
      ClassPathScanningCandidateComponentProvider componentProvider = new ClassPathScanningCandidateComponentProvider(
          false);
      for (Class<? extends Annotation> annoClass : getEntityAnnotations()) {
        componentProvider.addIncludeFilter(new AnnotationTypeFilter(annoClass));
      }

      for (BeanDefinition candidate : componentProvider.findCandidateComponents(basePackage)) {
        classes.add(ClassUtils.forName(candidate.getBeanClassName(), beanClassLoader));
      }
View Full Code Here

    Set<Class<?>> initialEntitySet = new HashSet<Class<?>>();

    if (StringUtils.hasText(basePackage)) {
      ClassPathScanningCandidateComponentProvider componentProvider = new ClassPathScanningCandidateComponentProvider(
          false);
      componentProvider.addIncludeFilter(new AnnotationTypeFilter(Document.class));
      componentProvider.addIncludeFilter(new AnnotationTypeFilter(Persistent.class));

      for (BeanDefinition candidate : componentProvider.findCandidateComponents(basePackage)) {
        initialEntitySet.add(ClassUtils.forName(candidate.getBeanClassName(),
            AbstractMongoConfiguration.class.getClassLoader()));
      }
View Full Code Here

      return null;
    }

    ClassPathScanningCandidateComponentProvider componentProvider = new ClassPathScanningCandidateComponentProvider(
        false);
    componentProvider.addIncludeFilter(new AnnotationTypeFilter(Document.class));
    componentProvider.addIncludeFilter(new AnnotationTypeFilter(Persistent.class));

    Set<String> classes = new ManagedSet<String>();
    for (BeanDefinition candidate : componentProvider.findCandidateComponents(basePackage)) {
      classes.add(candidate.getBeanClassName());
    }
View Full Code Here

    private static final String BASE_PATH = "org.apache.syncope.console.wicket.markup.html.form";

    public PreviewerClassScanner() {
        super(false);
        addIncludeFilter(new AnnotationTypeFilter(BinaryPreview.class));
    }
View Full Code Here

      case ANNOTATION:
        Assert.isAssignable(Annotation.class, filterClass, "An error occured when processing a @ComponentScan "
            + "ANNOTATION type filter: ");
        @SuppressWarnings("unchecked")
        Class<Annotation> annoClass = (Class<Annotation>) filterClass;
        typeFilters.add(new AnnotationTypeFilter(annoClass));
        break;
      case ASSIGNABLE_TYPE:
        typeFilters.add(new AssignableTypeFilter(filterClass));
        break;
      case CUSTOM:
View Full Code Here

    }

    public static Set<String> scanBasePackages(String...basePackages) {
        ClassPathScanningCandidateComponentProvider componentProvider = new ClassPathScanningCandidateComponentProvider(false);
//        componentProvider.addIncludeFilter(new AnnotationTypeFilter(Persistent.class));
        componentProvider.addIncludeFilter(new AnnotationTypeFilter(NodeEntity.class));
        componentProvider.addIncludeFilter(new AnnotationTypeFilter(RelationshipEntity.class));

        Set<String> classes = new ManagedSet<String>();
        for (String basePackage : basePackages) {
            for (BeanDefinition candidate : componentProvider.findCandidateComponents(basePackage)) {
                classes.add(candidate.getBeanClassName());
View Full Code Here

TOP

Related Classes of org.springframework.core.type.filter.AnnotationTypeFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.