Java Code Examples for org.springframework.core.type.classreading.MetadataReader#getResource()

The following examples show how to use org.springframework.core.type.classreading.MetadataReader#getResource() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConfigurationClass.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * Create a new {@link ConfigurationClass} with the given name.
 * @param metadataReader reader used to parse the underlying {@link Class}
 * @param beanName must not be {@code null}
 * @see ConfigurationClass#ConfigurationClass(Class, ConfigurationClass)
 */
public ConfigurationClass(MetadataReader metadataReader, String beanName) {
	Assert.notNull(beanName, "Bean name must not be null");
	this.metadata = metadataReader.getAnnotationMetadata();
	this.resource = metadataReader.getResource();
	this.beanName = beanName;
}
 
Example 2
Source File: ConfigurationClass.java    From java-technology-stack with MIT License 5 votes vote down vote up
/**
 * Create a new {@link ConfigurationClass} with the given name.
 * @param metadataReader reader used to parse the underlying {@link Class}
 * @param beanName must not be {@code null}
 * @see ConfigurationClass#ConfigurationClass(Class, ConfigurationClass)
 */
public ConfigurationClass(MetadataReader metadataReader, String beanName) {
	Assert.notNull(beanName, "Bean name must not be null");
	this.metadata = metadataReader.getAnnotationMetadata();
	this.resource = metadataReader.getResource();
	this.beanName = beanName;
}
 
Example 3
Source File: MyTypeFilter.java    From SpringAll with MIT License 5 votes vote down vote up
@Override
public boolean match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory) {
    // 获取当前正在扫描的类的注解信息
    AnnotationMetadata annotationMetadata = metadataReader.getAnnotationMetadata();
    // 获取当前正在扫描的类的类信息
    ClassMetadata classMetadata = metadataReader.getClassMetadata();
    // 获取当前正在扫描的类的路径等信息
    Resource resource = metadataReader.getResource();

    String className = classMetadata.getClassName();
    return StringUtils.hasText("er");
}
 
Example 4
Source File: ConfigurationClass.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new {@link ConfigurationClass} with the given name.
 * @param metadataReader reader used to parse the underlying {@link Class}
 * @param beanName must not be {@code null}
 * @see ConfigurationClass#ConfigurationClass(Class, ConfigurationClass)
 */
public ConfigurationClass(MetadataReader metadataReader, String beanName) {
	Assert.hasText(beanName, "Bean name must not be null");
	this.metadata = metadataReader.getAnnotationMetadata();
	this.resource = metadataReader.getResource();
	this.beanName = beanName;
}
 
Example 5
Source File: ConfigurationClass.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * Create a new {@link ConfigurationClass} with the given name.
 * @param metadataReader reader used to parse the underlying {@link Class}
 * @param beanName must not be {@code null}
 * @see ConfigurationClass#ConfigurationClass(Class, ConfigurationClass)
 */
public ConfigurationClass(MetadataReader metadataReader, String beanName) {
	Assert.hasText(beanName, "Bean name must not be null");
	this.metadata = metadataReader.getAnnotationMetadata();
	this.resource = metadataReader.getResource();
	this.beanName = beanName;
}
 
Example 6
Source File: ConfigurationClass.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * Create a new {@link ConfigurationClass} representing a class that was imported
 * using the {@link Import} annotation or automatically processed as a nested
 * configuration class (if importedBy is not {@code null}).
 * @param metadataReader reader used to parse the underlying {@link Class}
 * @param importedBy the configuration class importing this one or {@code null}
 * @since 3.1.1
 */
public ConfigurationClass(MetadataReader metadataReader, @Nullable ConfigurationClass importedBy) {
	this.metadata = metadataReader.getAnnotationMetadata();
	this.resource = metadataReader.getResource();
	this.importedBy.add(importedBy);
}
 
Example 7
Source File: ConfigurationClass.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * Create a new {@link ConfigurationClass} representing a class that was imported
 * using the {@link Import} annotation or automatically processed as a nested
 * configuration class (if importedBy is not {@code null}).
 * @param metadataReader reader used to parse the underlying {@link Class}
 * @param importedBy the configuration class importing this one or {@code null}
 * @since 3.1.1
 */
public ConfigurationClass(MetadataReader metadataReader, @Nullable ConfigurationClass importedBy) {
	this.metadata = metadataReader.getAnnotationMetadata();
	this.resource = metadataReader.getResource();
	this.importedBy.add(importedBy);
}
 
Example 8
Source File: ConfigurationClass.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a new {@link ConfigurationClass} representing a class that was imported
 * using the {@link Import} annotation or automatically processed as a nested
 * configuration class (if importedBy is not {@code null}).
 * @param metadataReader reader used to parse the underlying {@link Class}
 * @param importedBy the configuration class importing this one or {@code null}
 * @since 3.1.1
 */
public ConfigurationClass(MetadataReader metadataReader, ConfigurationClass importedBy) {
	this.metadata = metadataReader.getAnnotationMetadata();
	this.resource = metadataReader.getResource();
	this.importedBy.add(importedBy);
}
 
Example 9
Source File: ConfigurationClass.java    From spring4-understanding with Apache License 2.0 2 votes vote down vote up
/**
 * Create a new {@link ConfigurationClass} representing a class that was imported
 * using the {@link Import} annotation or automatically processed as a nested
 * configuration class (if importedBy is not {@code null}).
 * @param metadataReader reader used to parse the underlying {@link Class}
 * @param importedBy the configuration class importing this one or {@code null}
 * @since 3.1.1
 */
public ConfigurationClass(MetadataReader metadataReader, ConfigurationClass importedBy) {
	this.metadata = metadataReader.getAnnotationMetadata();
	this.resource = metadataReader.getResource();
	this.importedBy.add(importedBy);
}