Java 类org.springframework.beans.factory.wiring.BeanWiringInfo 实例源码

项目:lams    文件:AnnotationBeanWiringInfoResolver.java   
/**
 * Build the BeanWiringInfo for the given Configurable annotation.
 * @param beanInstance the bean instance
 * @param annotation the Configurable annotation found on the bean class
 * @return the resolved BeanWiringInfo
 */
protected BeanWiringInfo buildWiringInfo(Object beanInstance, Configurable annotation) {
    if (!Autowire.NO.equals(annotation.autowire())) {
        return new BeanWiringInfo(annotation.autowire().value(), annotation.dependencyCheck());
    }
    else {
        if (!"".equals(annotation.value())) {
            // explicitly specified bean name
            return new BeanWiringInfo(annotation.value(), false);
        }
        else {
            // default bean name
            return new BeanWiringInfo(getDefaultBeanName(beanInstance), true);
        }
    }
}
项目:spring4-understanding    文件:AnnotationBeanWiringInfoResolver.java   
/**
 * Build the BeanWiringInfo for the given Configurable annotation.
 * @param beanInstance the bean instance
 * @param annotation the Configurable annotation found on the bean class
 * @return the resolved BeanWiringInfo
 */
protected BeanWiringInfo buildWiringInfo(Object beanInstance, Configurable annotation) {
    if (!Autowire.NO.equals(annotation.autowire())) {
        return new BeanWiringInfo(annotation.autowire().value(), annotation.dependencyCheck());
    }
    else {
        if (!"".equals(annotation.value())) {
            // explicitly specified bean name
            return new BeanWiringInfo(annotation.value(), false);
        }
        else {
            // default bean name
            return new BeanWiringInfo(getDefaultBeanName(beanInstance), true);
        }
    }
}
项目:spring    文件:AnnotationBeanWiringInfoResolver.java   
/**
 * Build the BeanWiringInfo for the given Configurable annotation.
 * @param beanInstance the bean instance
 * @param annotation the Configurable annotation found on the bean class
 * @return the resolved BeanWiringInfo
 */
protected BeanWiringInfo buildWiringInfo(Object beanInstance, Configurable annotation) {
    if (!Autowire.NO.equals(annotation.autowire())) {
        return new BeanWiringInfo(annotation.autowire().value(), annotation.dependencyCheck());
    }
    else {
        if (!"".equals(annotation.value())) {
            // explicitly specified bean name
            return new BeanWiringInfo(annotation.value(), false);
        }
        else {
            // default bean name
            return new BeanWiringInfo(getDefaultBeanName(beanInstance), true);
        }
    }
}
项目:class-guard    文件:AnnotationBeanWiringInfoResolver.java   
/**
 * Build the BeanWiringInfo for the given Configurable annotation.
 * @param beanInstance the bean instance
 * @param annotation the Configurable annotation found on the bean class
 * @return the resolved BeanWiringInfo
 */
protected BeanWiringInfo buildWiringInfo(Object beanInstance, Configurable annotation) {
    if (!Autowire.NO.equals(annotation.autowire())) {
        return new BeanWiringInfo(annotation.autowire().value(), annotation.dependencyCheck());
    }
    else {
        if (!"".equals(annotation.value())) {
            // explicitly specified bean name
            return new BeanWiringInfo(annotation.value(), false);
        }
        else {
            // default bean name
            return new BeanWiringInfo(getDefaultBeanName(beanInstance), true);
        }
    }
}
项目:spring4-understanding    文件:AnnotationBeanWiringInfoResolverTests.java   
@Test
public void testResolveWiringInfoWithAnInstanceOfAnAnnotatedClassWithAutowiringTurnedOffExplicitly() {
    AnnotationBeanWiringInfoResolver resolver = new AnnotationBeanWiringInfoResolver();
    BeanWiringInfo info = resolver.resolveWiringInfo(new WirelessSoap());
    assertNotNull("Must *not* be returning null for an @Configurable class instance even when autowiring is NO", info);
    assertFalse(info.indicatesAutowiring());
    assertEquals(WirelessSoap.class.getName(), info.getBeanName());
}
项目:spring4-understanding    文件:AnnotationBeanWiringInfoResolverTests.java   
@Test
public void testResolveWiringInfoWithAnInstanceOfAnAnnotatedClassWithAutowiringTurnedOffExplicitlyAndCustomBeanName() {
    AnnotationBeanWiringInfoResolver resolver = new AnnotationBeanWiringInfoResolver();
    BeanWiringInfo info = resolver.resolveWiringInfo(new NamedWirelessSoap());
    assertNotNull("Must *not* be returning null for an @Configurable class instance even when autowiring is NO", info);
    assertFalse(info.indicatesAutowiring());
    assertEquals("DerBigStick", info.getBeanName());
}
项目:class-guard    文件:AnnotationBeanWiringInfoResolverTests.java   
@Test
public void testResolveWiringInfoWithAnInstanceOfAnAnnotatedClassWithAutowiringTurnedOffExplicitly() {
    AnnotationBeanWiringInfoResolver resolver = new AnnotationBeanWiringInfoResolver();
    BeanWiringInfo info = resolver.resolveWiringInfo(new WirelessSoap());
    assertNotNull("Must *not* be returning null for an @Configurable class instance even when autowiring is NO", info);
    assertFalse(info.indicatesAutowiring());
    assertEquals(WirelessSoap.class.getName(), info.getBeanName());
}
项目:class-guard    文件:AnnotationBeanWiringInfoResolverTests.java   
@Test
public void testResolveWiringInfoWithAnInstanceOfAnAnnotatedClassWithAutowiringTurnedOffExplicitlyAndCustomBeanName() {
    AnnotationBeanWiringInfoResolver resolver = new AnnotationBeanWiringInfoResolver();
    BeanWiringInfo info = resolver.resolveWiringInfo(new NamedWirelessSoap());
    assertNotNull("Must *not* be returning null for an @Configurable class instance even when autowiring is NO", info);
    assertFalse(info.indicatesAutowiring());
    assertEquals("DerBigStick", info.getBeanName());
}
项目:lams    文件:AnnotationBeanWiringInfoResolver.java   
@Override
public BeanWiringInfo resolveWiringInfo(Object beanInstance) {
    Assert.notNull(beanInstance, "Bean instance must not be null");
    Configurable annotation = beanInstance.getClass().getAnnotation(Configurable.class);
    return (annotation != null ? buildWiringInfo(beanInstance, annotation) : null);
}
项目:spring4-understanding    文件:AnnotationBeanWiringInfoResolver.java   
@Override
public BeanWiringInfo resolveWiringInfo(Object beanInstance) {
    Assert.notNull(beanInstance, "Bean instance must not be null");
    Configurable annotation = beanInstance.getClass().getAnnotation(Configurable.class);
    return (annotation != null ? buildWiringInfo(beanInstance, annotation) : null);
}
项目:spring    文件:AnnotationBeanWiringInfoResolver.java   
@Override
public BeanWiringInfo resolveWiringInfo(Object beanInstance) {
    Assert.notNull(beanInstance, "Bean instance must not be null");
    Configurable annotation = beanInstance.getClass().getAnnotation(Configurable.class);
    return (annotation != null ? buildWiringInfo(beanInstance, annotation) : null);
}
项目:class-guard    文件:AnnotationBeanWiringInfoResolver.java   
public BeanWiringInfo resolveWiringInfo(Object beanInstance) {
    Assert.notNull(beanInstance, "Bean instance must not be null");
    Configurable annotation = beanInstance.getClass().getAnnotation(Configurable.class);
    return (annotation != null ? buildWiringInfo(beanInstance, annotation) : null);
}