Definition Type: Element
Name: lookup-method
Namespace: http://www.springframework.org/schema/beans
Type: anyType:http://www.w3.org/2001/XMLSchema
Containing Schema: spring-beans-3.1.xsd
Abstract
Documentation:
A lookup method causes the IoC container to override the given method and return the bean with the name given in the bean attribute. This is a form of Method Injection. It is particularly useful as an alternative to implementing the BeanFactoryAware interface, in order to be able to make getBean() calls for non-singleton instances at runtime. In this case, Method Injection is a less invasive alternative.
Collapse XSD Schema Diagram:
Drilldown into bean in schema spring-beans-3_1_xsd Drilldown into name in schema spring-beans-3_1_xsdXSD Diagram of lookup-method in schema spring-beans-3_1_xsd (Membrane Service Proxy)
Collapse XSD Schema Code:
<xsd:element name="lookup-method">
    <xsd:annotation>
        <xsd:documentation><![CDATA[
	A lookup method causes the IoC container to override the given method
	and return the bean with the name given in the bean attribute. This is
	a form of Method Injection. It is particularly useful as an alternative
	to implementing the BeanFactoryAware interface, in order to be able to
	make getBean() calls for non-singleton instances at runtime. In this
	case, Method Injection is a less invasive alternative.
			]]></xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
        <xsd:complexContent>
            <xsd:restriction base="xsd:anyType">
                <xsd:attribute name="name" type="xsd:string">
                    <xsd:annotation>
                        <xsd:documentation><![CDATA[
	The name of the lookup method. This method must take no arguments.
							]]></xsd:documentation>
                    </xsd:annotation>
                </xsd:attribute>
                <xsd:attribute name="bean" type="xsd:string">
                    <xsd:annotation>
                        <xsd:documentation><![CDATA[
	The name of the bean in the current or ancestor factories that
	the lookup method should resolve to. Often this bean will be a
	prototype, in which case the lookup method will return a distinct
	instance on every invocation. This is useful for single-threaded objects.
							]]></xsd:documentation>
                    </xsd:annotation>
                </xsd:attribute>
            </xsd:restriction>
        </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
Collapse Child Attributes:
Name Type Default Value Use
name beans:name (Optional)
bean beans:bean (Optional)
<anyAttribute>