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

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

The 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 and interfaces. */ @Override protected boolean isCandidateComponent(AnnotatedBeanDefinition beanDefinition) { final ClassMetadata metadata = beanDefinition.getMetadata(); return metadata.isIndependent(); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy