Example usage for org.springframework.beans.factory.config RuntimeBeanNameReference setSource

List of usage examples for org.springframework.beans.factory.config RuntimeBeanNameReference setSource

Introduction

In this page you can find the example usage for org.springframework.beans.factory.config RuntimeBeanNameReference setSource.

Prototype

public void setSource(@Nullable Object source) 

Source Link

Document

Set the configuration source Object for this metadata element.

Usage

From source file:org.eclipse.gemini.blueprint.blueprint.config.internal.BlueprintParser.java

private Object parseIdRefElement(Element ele) {
    // A generic reference to any name of any bean/component.
    String refName = ele.getAttribute(COMPONENT_ID_ATTR);
    if (!StringUtils.hasLength(refName)) {
        error("'" + COMPONENT_ID_ATTR + "' is required for <idref> element", ele);
        return null;
    }//from www  . j a  va 2s . co m
    if (!StringUtils.hasText(refName)) {
        error("<idref> element contains empty target attribute", ele);
        return null;
    }
    RuntimeBeanNameReference ref = new RuntimeBeanNameReference(refName);
    ref.setSource(parserContext.extractSource(ele));
    return ref;
}

From source file:org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.java

/**
 * Return a typed String value Object for the given 'idref' element.
 *///from  w  w w  . ja v a 2s .  c o m
@Nullable
public Object parseIdRefElement(Element ele) {
    // A generic reference to any name of any bean.
    String refName = ele.getAttribute(BEAN_REF_ATTRIBUTE);
    if (!StringUtils.hasLength(refName)) {
        error("'bean' is required for <idref> element", ele);
        return null;
    }
    if (!StringUtils.hasText(refName)) {
        error("<idref> element contains empty target attribute", ele);
        return null;
    }
    RuntimeBeanNameReference ref = new RuntimeBeanNameReference(refName);
    ref.setSource(extractSource(ele));
    return ref;
}