All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jsimpledb.spring.JSimpleDBClassScanner Maven / Gradle / Ivy

There is a newer version: 3.6.1
Show newest version

/*
 * Copyright (C) 2015 Archie L. Cobbs. All rights reserved.
 */

package org.jsimpledb.spring;

import org.jsimpledb.annotation.JSimpleClass;
import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition;
import org.springframework.core.env.Environment;
import org.springframework.core.type.ClassMetadata;

/**
 * Scans the classpath for types annotated as {@link JSimpleClass @JSimpleClass}.
 */
public class JSimpleDBClassScanner extends AnnotatedClassScanner {

    /**
     * Constructor.
     */
    public JSimpleDBClassScanner() {
        super(JSimpleClass.class);
    }

    /**
     * Constructor.
     *
     * @param useDefaultFilters whether to register the default filters for {@link JSimpleClass @JSimpleClass} type annotations
     * @param environment environment to use
     */
    public JSimpleDBClassScanner(boolean useDefaultFilters, Environment environment) {
        super(useDefaultFilters, environment, JSimpleClass.class);
    }

    /**
     * Determine if the given bean definition is a possible search candidate.
     *
     * 

* This method is overridden in {@link JSimpleDBClassScanner} to allow abstract classes. */ @Override protected boolean isCandidateComponent(AnnotatedBeanDefinition beanDefinition) { final ClassMetadata metadata = beanDefinition.getMetadata(); return !metadata.isInterface() && metadata.isIndependent(); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy