本文整理汇总了Java中org.springframework.core.type.AnnotationMetadata.getClassName方法的典型用法代码示例。如果您正苦于以下问题:Java AnnotationMetadata.getClassName方法的具体用法?Java AnnotationMetadata.getClassName怎么用?Java AnnotationMetadata.getClassName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.core.type.AnnotationMetadata
的用法示例。
在下文中一共展示了AnnotationMetadata.getClassName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerLepService
import org.springframework.core.type.AnnotationMetadata; //导入方法依赖的package包/类
private void registerLepService(BeanDefinitionRegistry registry,
AnnotationMetadata annotationMetadata,
Map<String, Object> attributes) {
// has a default, won't be null
boolean primary = (Boolean) attributes.get("primary");
String className = annotationMetadata.getClassName();
BeanDefinitionBuilder definition = BeanDefinitionBuilder
.genericBeanDefinition(LepServiceFactoryBean.class);
definition.addPropertyValue("type", className);
definition.addPropertyValue("annotationMetadata", annotationMetadata);
definition.setAutowireMode(AbstractBeanDefinition.AUTOWIRE_BY_TYPE);
AbstractBeanDefinition beanDefinition = definition.getBeanDefinition();
beanDefinition.setPrimary(primary);
String name = getBeanName(annotationMetadata, attributes);
String alias = name + LepService.class.getSimpleName();
String qualifier = getQualifier(attributes);
if (StringUtils.hasText(qualifier)) {
alias = qualifier;
}
BeanDefinitionHolder holder = new BeanDefinitionHolder(beanDefinition, name,
new String[] {alias});
BeanDefinitionReaderUtils.registerBeanDefinition(holder, registry);
}
示例2: setImportMetadata
import org.springframework.core.type.AnnotationMetadata; //导入方法依赖的package包/类
/**
* setImportMetadata
*
* @param importMetadata Annotations Metadata to validate...
*/
@Override
public void setImportMetadata(AnnotationMetadata importMetadata) {
Map<String, Object> map = importMetadata.getAnnotationAttributes(EnableYourMicroservice.class.getName());
this.enableYourMicroservice = AnnotationAttributes.fromMap(map);
if (this.enableYourMicroservice == null) {
String message =
"@EnableYourMicroservice is not present on importing class " + importMetadata.getClassName();
LOGGER.error(message);
throw new IllegalArgumentException(message);
}
}
示例3: registerBeanDefinitions
import org.springframework.core.type.AnnotationMetadata; //导入方法依赖的package包/类
@Override
public void registerBeanDefinitions(AnnotationMetadata importMetadata, BeanDefinitionRegistry registry) {
AnnotationAttributes attributes = AnnotationAttributes.fromMap(
importMetadata.getAnnotationAttributes(JpaWithSnowdropConfiguration.class.getName(), false));
if (attributes == null) {
throw new IllegalArgumentException(
"@JpaWithSnowdropConfiguration is not present on importing class " + importMetadata.getClassName());
}
registry.registerBeanDefinition(
JpaRepositoryFactoryBeanSnowdropPostProcessor.class.getName(),
buildPostProcessorDefinition(importMetadata, attributes)
);
}
示例4: setImportMetadata
import org.springframework.core.type.AnnotationMetadata; //导入方法依赖的package包/类
@Override
public void setImportMetadata(AnnotationMetadata importMetadata) {
this.enableMethodCache = AnnotationAttributes.fromMap(
importMetadata.getAnnotationAttributes(EnableMethodCache.class.getName(), false));
if (this.enableMethodCache == null) {
throw new IllegalArgumentException(
"@EnableMethodCache is not present on importing class " + importMetadata.getClassName());
}
}