spring-framework / org.springframework.beans.factory.groovy / GroovyBeanDefinitionReader / loadBeanDefinitions

loadBeanDefinitions

open fun loadBeanDefinitions(resource: Resource): Int

Load bean definitions from the specified Groovy script or XML file.

Note that ".xml" files will be parsed as XML content; all other kinds of resources will be parsed as Groovy scripts.

Parameters

resource - the resource descriptor for the Groovy script or XML file

Exceptions

BeanDefinitionStoreException - in case of loading or parsing errors

Return
the number of bean definitions found

open fun loadBeanDefinitions(encodedResource: EncodedResource): Int

Load bean definitions from the specified Groovy script or XML file.

Note that ".xml" files will be parsed as XML content; all other kinds of resources will be parsed as Groovy scripts.

Parameters

encodedResource - the resource descriptor for the Groovy script or XML file, allowing specification of an encoding to use for parsing the file

Exceptions

BeanDefinitionStoreException - in case of loading or parsing errors

Return
the number of bean definitions found