public class GenericGroovyXmlContextLoader extends GenericXmlContextLoader
AbstractGenericContextLoader
that reads
bean definitions from Groovy scripts and XML configuration files.
Default resource locations are detected using the suffixes
"-context.xml"
and "Context.groovy"
.
GroovyBeanDefinitionReader
,
GenericXmlContextLoader
,
AnnotationConfigContextLoader
logger
Constructor and Description |
---|
GenericGroovyXmlContextLoader() |
Modifier and Type | Method and Description |
---|---|
protected String |
getResourceSuffix()
GenericGroovyXmlContextLoader supports both Groovy and XML
resource types for detection of defaults. |
protected String[] |
getResourceSuffixes()
Returns
"-context.xml" and "Context.groovy" in order to
support detection of a default XML config file or Groovy script. |
protected void |
loadBeanDefinitions(GenericApplicationContext context,
MergedContextConfiguration mergedConfig)
Load bean definitions into the supplied
context
from the locations in the supplied MergedContextConfiguration . |
createBeanDefinitionReader, validateMergedContextConfiguration
customizeBeanFactory, customizeContext, loadContext, loadContext, prepareContext
generateDefaultLocations, isGenerateDefaultLocations, modifyLocations, prepareContext, processContextConfiguration, processLocations
protected void loadBeanDefinitions(GenericApplicationContext context, MergedContextConfiguration mergedConfig)
context
from the locations in the supplied MergedContextConfiguration
.
If a location ends with the suffix ".xml"
, bean definitions
will be loaded from that location using an XmlBeanDefinitionReader
;
otherwise, a GroovyBeanDefinitionReader
will be used.
loadBeanDefinitions
in class AbstractGenericContextLoader
context
- the context into which the bean definitions should be loadedmergedConfig
- the merged context configurationAbstractGenericContextLoader.loadBeanDefinitions(org.springframework.context.support.GenericApplicationContext, org.springframework.test.context.MergedContextConfiguration)
protected String[] getResourceSuffixes()
"-context.xml" and "Context.groovy"
in order to
support detection of a default XML config file or Groovy script.getResourceSuffixes
in class AbstractContextLoader
null
or emptyAbstractContextLoader.generateDefaultLocations(Class)
protected String getResourceSuffix()
GenericGroovyXmlContextLoader
supports both Groovy and XML
resource types for detection of defaults. Consequently, this method
is not supported.getResourceSuffix
in class GenericXmlContextLoader
null
or emptyUnsupportedOperationException
getResourceSuffixes()