当前位置: 首页>>代码示例>>Java>>正文


Java AnnotationMetadata.isAnnotated方法代码示例

本文整理汇总了Java中org.springframework.core.type.AnnotationMetadata.isAnnotated方法的典型用法代码示例。如果您正苦于以下问题:Java AnnotationMetadata.isAnnotated方法的具体用法?Java AnnotationMetadata.isAnnotated怎么用?Java AnnotationMetadata.isAnnotated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.core.type.AnnotationMetadata的用法示例。


在下文中一共展示了AnnotationMetadata.isAnnotated方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: registerBeanDefinitions

import org.springframework.core.type.AnnotationMetadata; //导入方法依赖的package包/类
@Override
public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry registry) {
	// Single annotation
	if (annotationMetadata.isAnnotated(repeatableAnnotation.getName())) {
		register(annotationMetadata.getAnnotationAttributes(repeatableAnnotation.getName()), registry, false);
	} else if (annotationMetadata.isAnnotated(repeatableAnnotationContainer.getName())) {
		// Multiple annotations
		Map<String, Object> attributes = annotationMetadata
				.getAnnotationAttributes(repeatableAnnotationContainer.getName());
		AnnotationAttributes[] repetitions = (AnnotationAttributes[]) attributes.get("value");
		if (repetitions != null) {
			for (AnnotationAttributes repetition : repetitions) {
				register(repetition, registry, true);
			}
		}
	}
}
 
开发者ID:holon-platform,项目名称:holon-core,代码行数:18,代码来源:AbstractRepeatableAnnotationRegistrar.java

示例2: registerBeanDefinitions

import org.springframework.core.type.AnnotationMetadata; //导入方法依赖的package包/类
@Override
public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry registry) {
	if (!annotationMetadata.isAnnotated(EnableJdbcDatastore.class.getName())) {
		// ignore call from sub classes
		return;
	}

	Map<String, Object> attributes = annotationMetadata
			.getAnnotationAttributes(EnableJdbcDatastore.class.getName());

	// attributes
	String dataContextId = BeanRegistryUtils.getAnnotationValue(attributes, "dataContextId", null);
	PrimaryMode primaryMode = BeanRegistryUtils.getAnnotationValue(attributes, "primary", PrimaryMode.AUTO);
	String dataSourceReference = BeanRegistryUtils.getAnnotationValue(attributes, "dataSourceReference", null);

	String dataSourceBeanName = dataSourceReference;
	if (dataSourceBeanName == null) {
		dataSourceBeanName = BeanRegistryUtils.buildBeanName(dataContextId,
				EnableDataSource.DEFAULT_DATASOURCE_BEAN_NAME);
	}

	registerDatastore(registry, getEnvironment(), dataContextId, primaryMode, dataSourceBeanName,
			BeanRegistryUtils.getAnnotationValue(attributes, "platform", DatabasePlatform.NONE),
			BeanRegistryUtils.getAnnotationValue(attributes, "transactional", true), beanClassLoader);
}
 
开发者ID:holon-platform,项目名称:holon-datastore-jdbc,代码行数:26,代码来源:JdbcDatastoreRegistrar.java

示例3: registerBeanDefinitions

import org.springframework.core.type.AnnotationMetadata; //导入方法依赖的package包/类
@Override
public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry registry) {

	if (!annotationMetadata.isAnnotated(EnableDataSource.class.getName())) {
		// ignore call from sub classes
		return;
	}

	Map<String, Object> attributes = annotationMetadata.getAnnotationAttributes(EnableDataSource.class.getName());

	// Annotation values
	String dataContextId = BeanRegistryUtils.getAnnotationValue(attributes, "dataContextId", null);
	PrimaryMode primaryMode = BeanRegistryUtils.getAnnotationValue(attributes, "primary", PrimaryMode.AUTO);
	boolean registerTransactionManager = BeanRegistryUtils.getAnnotationValue(attributes,
			"enableTransactionManager", false);

	String dsBeanName = registerDataSource(getEnvironment(), registry, dataContextId, primaryMode);

	// Transaction manager

	if (registerTransactionManager) {
		registerDataSourceTransactionManager(registry, dsBeanName, dataContextId, primaryMode);
	}

}
 
开发者ID:holon-platform,项目名称:holon-jdbc,代码行数:26,代码来源:DataSourceRegistrar.java

示例4: registerBeanDefinitions

import org.springframework.core.type.AnnotationMetadata; //导入方法依赖的package包/类
@Override
public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry registry) {

	if (!annotationMetadata.isAnnotated(EnableJpa.class.getName())) {
		// ignore call from sub classes
		return;
	}

	Map<String, Object> attributes = annotationMetadata.getAnnotationAttributes(EnableJpa.class.getName());

	registerJpaBeans(registry, beanFactory, getEnvironment(), attributes, beanClassLoader);
}
 
开发者ID:holon-platform,项目名称:holon-datastore-jpa,代码行数:13,代码来源:JpaRegistrar.java

示例5: registerBeanDefinitions

import org.springframework.core.type.AnnotationMetadata; //导入方法依赖的package包/类
@Override
public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry registry) {

	if (!annotationMetadata.isAnnotated(EnableJpaDatastore.class.getName())) {
		// ignore call from sub classes
		return;
	}

	Map<String, Object> attributes = annotationMetadata.getAnnotationAttributes(EnableJpaDatastore.class.getName());

	// attributes
	String dataContextId = BeanRegistryUtils.getAnnotationValue(attributes, "dataContextId", null);
	PrimaryMode primaryMode = BeanRegistryUtils.getAnnotationValue(attributes, "primary", PrimaryMode.AUTO);
	String entityManagerFactoryReference = BeanRegistryUtils.getAnnotationValue(attributes,
			"entityManagerFactoryReference", null);

	String emfBeanName = entityManagerFactoryReference;
	if (emfBeanName == null) {
		emfBeanName = BeanRegistryUtils.buildBeanName(dataContextId,
				EnableJpa.DEFAULT_ENTITYMANAGERFACTORY_BEAN_NAME);
	}

	registerDatastore(registry, dataContextId, primaryMode, emfBeanName,
			BeanRegistryUtils.getAnnotationValue(attributes, "transactional", true),
			BeanRegistryUtils.getAnnotationValue(attributes, "autoFlush", false), beanClassLoader);

}
 
开发者ID:holon-platform,项目名称:holon-datastore-jpa,代码行数:28,代码来源:JpaDatastoreRegistrar.java

示例6: isFullConfigurationCandidate

import org.springframework.core.type.AnnotationMetadata; //导入方法依赖的package包/类
/**
 * Check the given metadata for a full configuration class candidate
 * (i.e. a class annotated with {@code @Configuration}).
 * @param metadata the metadata of the annotated class
 * @return {@code true} if the given class is to be processed as a full
 * configuration class, including cross-method call interception
 */
public static boolean isFullConfigurationCandidate(AnnotationMetadata metadata) {
	return metadata.isAnnotated(Configuration.class.getName());
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:ConfigurationClassUtils.java

示例7: isLiteConfigurationCandidate

import org.springframework.core.type.AnnotationMetadata; //导入方法依赖的package包/类
/**
 * Check the given metadata for a lite configuration class candidate
 * (e.g. a class annotated with {@code @Component} or just having
 * {@code @Import} declarations or {@code @Bean methods}).
 * @param metadata the metadata of the annotated class
 * @return {@code true} if the given class is to be processed as a lite
 * configuration class, just registering it and scanning it for {@code @Bean} methods
 */
public static boolean isLiteConfigurationCandidate(AnnotationMetadata metadata) {
	// Do not consider an interface or an annotation...
	return (!metadata.isInterface() && (metadata.isAnnotated(Component.class.getName()) ||
			metadata.isAnnotated(Import.class.getName()) || metadata.hasAnnotatedMethods(Bean.class.getName())));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:ConfigurationClassUtils.java


注:本文中的org.springframework.core.type.AnnotationMetadata.isAnnotated方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。