org.springframework.config.java.parsing
Class AbstractClassScanningBeanDefinitionReader

java.lang.Object
  extended by org.springframework.beans.factory.support.AbstractBeanDefinitionReader
      extended by org.springframework.config.java.parsing.AbstractClassScanningBeanDefinitionReader
All Implemented Interfaces:
org.springframework.beans.factory.support.BeanDefinitionReader
Direct Known Subclasses:
AbstractAsmClassScanningBeanDefinitionReader

public abstract class AbstractClassScanningBeanDefinitionReader
extends org.springframework.beans.factory.support.AbstractBeanDefinitionReader

Annotation based bean definition reader that will use the given location/pattern to locate classes and analyze them. It will consider classes given through:

The underlying classLoader is used to load the classes from URL, jars or folders.

Author:
Costin Leau, Rod Johnson

Field Summary
protected  org.apache.commons.logging.Log log
           
 
Fields inherited from class org.springframework.beans.factory.support.AbstractBeanDefinitionReader
logger
 
Constructor Summary
AbstractClassScanningBeanDefinitionReader(org.springframework.beans.factory.support.BeanDefinitionRegistry beanFactory)
           
 
Method Summary
protected  boolean isFQN(java.lang.String className)
          Can't really judge if we have a class or not based on a name.
 int loadBeanDefinitions(org.springframework.core.io.Resource resource)
           
protected  java.lang.Class loadClass(java.lang.String className)
          Utility method which loads a class without initializing it and translates the CNF exception into BeanDefinitionStoreException.
protected abstract  void processComponentOrFactoryClass(java.lang.Class clazz)
          A component class or component factory class has been found.
protected abstract  int searchClass(java.io.InputStream stream)
          Search the class for any innerClasses.
protected  int searchClass(org.springframework.core.io.Resource resource)
           
 
Methods inherited from class org.springframework.beans.factory.support.AbstractBeanDefinitionReader
getBeanClassLoader, getBeanFactory, getBeanNameGenerator, getResourceLoader, loadBeanDefinitions, loadBeanDefinitions, loadBeanDefinitions, setBeanClassLoader, setBeanNameGenerator, setResourceLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final org.apache.commons.logging.Log log
Constructor Detail

AbstractClassScanningBeanDefinitionReader

public AbstractClassScanningBeanDefinitionReader(org.springframework.beans.factory.support.BeanDefinitionRegistry beanFactory)
Method Detail

loadBeanDefinitions

public int loadBeanDefinitions(org.springframework.core.io.Resource resource)
                        throws org.springframework.beans.factory.BeanDefinitionStoreException
Throws:
org.springframework.beans.factory.BeanDefinitionStoreException

isFQN

protected boolean isFQN(java.lang.String className)
Can't really judge if we have a class or not based on a name. It can be outside a package and have only one letter which is lowercase.

Parameters:
className -
Returns:

searchClass

protected int searchClass(org.springframework.core.io.Resource resource)
                   throws java.io.IOException
Throws:
java.io.IOException

searchClass

protected abstract int searchClass(java.io.InputStream stream)
                            throws java.io.IOException
Search the class for any innerClasses.

Parameters:
stream -
Returns:
Throws:
java.io.IOException

loadClass

protected java.lang.Class loadClass(java.lang.String className)
Utility method which loads a class without initializing it and translates the CNF exception into BeanDefinitionStoreException.

Parameters:
className -
Returns:

processComponentOrFactoryClass

protected abstract void processComponentOrFactoryClass(java.lang.Class clazz)
A component class or component factory class has been found. Process it, presumably by creating a bean definition

Parameters:
clazz - component class or component factory class


Copyright © 2005-2007 Spring Framework. All Rights Reserved.