Top Description Fields Constructors Methods
org.springframework.jdbc.config

pack-priv Class EmbeddedDatabaseBeanDefinitionParser

extends AbstractBeanDefinitionParser
Class Inheritance
Imports
org.w3c.dom.Element, org.springframework.beans.factory.config.BeanDefinition, org.springframework.beans.factory.support.AbstractBeanDefinition, .BeanDefinitionBuilder, org.springframework.beans.factory.xml.AbstractBeanDefinitionParser, .ParserContext, org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryBean, org.springframework.jdbc.datasource.init.ResourceDatabasePopulator, org.springframework.util.StringUtils

org.springframework.beans.factory.xml.BeanDefinitionParser that parses an embedded-database element and creates a BeanDefinition for an EmbeddedDatabaseFactoryBean.

Picks up nested script elements and configures a ResourceDatabasePopulator for each of them.

Authors
Oliver Gierke, Juergen Hoeller, Sam Brannen
Since
3.0
See Also
DatabasePopulatorConfigUtils

Field Summary

Modifier and TypeField and Description
pack-priv static final String
DB_NAME_ATTRIBUTE

Constant for the "database-name" attribute.

pack-priv static final String
GENERATE_NAME_ATTRIBUTE

Constant for the "generate-name" attribute.

Inherited from org.springframework.beans.factory.xml.AbstractBeanDefinitionParser:
ID_ATTRIBUTENAME_ATTRIBUTE

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected AbstractBeanDefinition
parseInternal(Element
the element that is to be parsed into one or more BeanDefinitions
element
,
ParserContext
the object encapsulating the current state of the parsing process; provides access to a org.springframework.beans.factory.support.BeanDefinitionRegistry
parserContext
)

Implements abstract org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parseInternal.

Central template method to actually parse the supplied Element into one or more BeanDefinitions.
private void
private void
private void
protected boolean
shouldGenerateIdAsFallback()

Overrides org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.shouldGenerateIdAsFallback.

Should an ID be generated instead if the passed in Element does not specify an "id" attribute explicitly?
Inherited from org.springframework.beans.factory.xml.AbstractBeanDefinitionParser:
parsepostProcessComponentDefinitionregisterBeanDefinitionresolveIdshouldFireEventsshouldGenerateIdshouldParseNameAsAliases

Field Detail

DB_NAME_ATTRIBUTEback to summary
pack-priv static final String DB_NAME_ATTRIBUTE

Constant for the "database-name" attribute.

GENERATE_NAME_ATTRIBUTEback to summary
pack-priv static final String GENERATE_NAME_ATTRIBUTE

Constant for the "generate-name" attribute.

Constructor Detail

EmbeddedDatabaseBeanDefinitionParserback to summary
pack-priv EmbeddedDatabaseBeanDefinitionParser()

Method Detail

parseInternalback to summary
protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext)

Implements abstract org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parseInternal.

Doc from org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parseInternal.

Central template method to actually parse the supplied Element into one or more BeanDefinitions.

Parameters
element:Element

the element that is to be parsed into one or more BeanDefinitions

parserContext:ParserContext

the object encapsulating the current state of the parsing process; provides access to a org.springframework.beans.factory.support.BeanDefinitionRegistry

Returns:AbstractBeanDefinition

the primary BeanDefinition resulting from the parsing of the supplied Element

Annotations
@Override
setDatabaseNameback to summary
private void setDatabaseName(Element element, BeanDefinitionBuilder builder)
setDatabaseTypeback to summary
private void setDatabaseType(Element element, BeanDefinitionBuilder builder)
setGenerateUniqueDatabaseNameFlagback to summary
private void setGenerateUniqueDatabaseNameFlag(Element element, BeanDefinitionBuilder builder)
shouldGenerateIdAsFallbackback to summary
protected boolean shouldGenerateIdAsFallback()

Overrides org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.shouldGenerateIdAsFallback.

Doc from org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.shouldGenerateIdAsFallback.

Should an ID be generated instead if the passed in Element does not specify an "id" attribute explicitly?

Disabled by default; subclasses can override this to enable ID generation as fallback: The parser will first check for an "id" attribute in this case, only falling back to a generated ID if no value was specified.

Returns:boolean

whether the parser should generate an id if no id was specified

Annotations
@Override