org.springframework.beans.factory.config.BeanDefinition.getDescription()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中org.springframework.beans.factory.config.BeanDefinition.getDescription()方法的一些代码示例,展示了BeanDefinition.getDescription()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BeanDefinition.getDescription()方法的具体详情如下:
包路径:org.springframework.beans.factory.config.BeanDefinition
类名称:BeanDefinition
方法名:getDescription

BeanDefinition.getDescription介绍

[英]Return a human-readable description of this bean definition.
[中]返回此bean定义的可读描述。

代码示例

代码示例来源:origin: spring-projects/spring-framework

@Test
  public void test() {
    ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext(MyConfig.class);

    assertThat("someDependency was not post processed",
        ctx.getBeanFactory().getBeanDefinition("someDependency").getDescription(),
        equalTo("post processed by MyPostProcessor"));

    MyConfig config = ctx.getBean(MyConfig.class);
    assertTrue("Config class was not enhanced", ClassUtils.isCglibProxy(config));
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Test
public void viaComponentScanning() {
  AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
  ctx.scan("org.springframework.context.annotation.role");
  ctx.refresh();
  assertThat("Expected bean to have ROLE_APPLICATION",
      ctx.getBeanDefinition("componentWithoutRole").getRole(), is(BeanDefinition.ROLE_APPLICATION));
  assertThat(ctx.getBeanDefinition("componentWithoutRole").getDescription(), is((Object) null));
  assertThat("Expected bean to have ROLE_INFRASTRUCTURE",
      ctx.getBeanDefinition("componentWithRole").getRole(), is(BeanDefinition.ROLE_INFRASTRUCTURE));
  assertThat(ctx.getBeanDefinition("componentWithRole").getDescription(), is("A Component with a role"));
}

代码示例来源:origin: spring-projects/spring-framework

@Test
public void onBeanMethod() {
  AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
  ctx.register(Config.class);
  ctx.refresh();
  assertThat("Expected bean to have ROLE_APPLICATION",
      ctx.getBeanDefinition("foo").getRole(), is(BeanDefinition.ROLE_APPLICATION));
  assertThat(ctx.getBeanDefinition("foo").getDescription(), is((Object) null));
  assertThat("Expected bean to have ROLE_INFRASTRUCTURE",
      ctx.getBeanDefinition("bar").getRole(), is(BeanDefinition.ROLE_INFRASTRUCTURE));
  assertThat(ctx.getBeanDefinition("bar").getDescription(), is("A Bean method with a role"));
}

代码示例来源:origin: spring-projects/spring-framework

@Test
public void onComponentClass() {
  AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
  ctx.register(ComponentWithoutRole.class, ComponentWithRole.class);
  ctx.refresh();
  assertThat("Expected bean to have ROLE_APPLICATION",
      ctx.getBeanDefinition("componentWithoutRole").getRole(), is(BeanDefinition.ROLE_APPLICATION));
  assertThat(ctx.getBeanDefinition("componentWithoutRole").getDescription(), is((Object) null));
  assertThat("Expected bean to have ROLE_INFRASTRUCTURE",
      ctx.getBeanDefinition("componentWithRole").getRole(), is(BeanDefinition.ROLE_INFRASTRUCTURE));
  assertThat(ctx.getBeanDefinition("componentWithRole").getDescription(), is("A Component with a role"));
}

代码示例来源:origin: spring-projects/spring-integration

throw new CannotLoadBeanClassException(beanDefinition.getDescription(),
    beanName, beanMethod.getReturnTypeName(), e);

代码示例来源:origin: walkmod/walkmod-core

beanDefinitionRegistry.getBeanDefinition(name).getDescription(),
      getProperties(o)));
} else {
  result.add(new BeanDefinitionImpl(classification, id,
      beanDefinitionRegistry.getBeanDefinition(name).getDescription(),
      getProperties(o)));
  beanDefinitionRegistry.getBeanDefinition(name).getDescription(), getProperties(o)));

代码示例来源:origin: org.springframework.integration/spring-integration-core

throw new CannotLoadBeanClassException(beanDefinition.getDescription(),
    beanName, beanMethod.getReturnTypeName(), e);

代码示例来源:origin: org.walkmod/walkmod-core

beanDefinitionRegistry.getBeanDefinition(name).getDescription(),
      getProperties(o)));
} else {
  result.add(new BeanDefinitionImpl(classification, id,
      beanDefinitionRegistry.getBeanDefinition(name).getDescription(),
      getProperties(o)));
  beanDefinitionRegistry.getBeanDefinition(name).getDescription(), getProperties(o)));

代码示例来源:origin: com.foreach.across/across-core

setOriginatingBeanDefinition( original );
setPrimary( original.isPrimary() );
setDescription( original.getDescription() );
setRole( original.getRole() );
setScope( original.getScope() );

相关文章

微信公众号

最新文章

更多