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


Java AnnotationMetadata.getClassName方法代码示例

本文整理汇总了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);
}
 
开发者ID:xm-online,项目名称:xm-commons,代码行数:28,代码来源:LepServicesRegistrar.java

示例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);
    }
}
 
开发者ID:jaschenk,项目名称:Your-Microservice,代码行数:17,代码来源:YourMicroserviceBeanConfiguration.java

示例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)
  );
}
 
开发者ID:snowdrop,项目名称:spring-data-snowdrop,代码行数:14,代码来源:JpaWithSnowdropRegistrar.java

示例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());
    }
}
 
开发者ID:alibaba,项目名称:jetcache,代码行数:10,代码来源:JetCacheProxyConfiguration.java


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