BeanDefinitionParser implementation providing
a number of convenience methods and a
template method
that subclasses must override to provide the actual parsing logic.
Use this BeanDefinitionParser implementation when you want
to parse some arbitrarily complex XML into one or more
BeanDefinitions. If you just want to parse some
XML into a single BeanDefinition, you may wish to consider
the simpler convenience extensions of this class, namely
AbstractSingleBeanDefinitionParser and
AbstractSimpleBeanDefinitionParser.
| Modifier and Type | Field and Description |
|---|---|
| public static final String | ID_ATTRIBUTE
Constant for the "id" attribute. |
| public static final String | NAME_ATTRIBUTE
Constant for the "name" attribute. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final BeanDefinition | parse(Element
the element that is to be parsed into one or more element, ParserContext BeanDefinitionsthe object encapsulating the current state of the parsing process;
provides access to a parserContext)org.Implements org. Parse the specified |
| protected abstract AbstractBeanDefinition | parseInternal(Element
the element that is to be parsed into one or more element, ParserContext BeanDefinitionsthe object encapsulating the current state of the parsing process;
provides access to a parserContext)org.Central template method to actually parse the supplied |
| protected void | postProcessComponentDefinition(BeanComponentDefinition
the componentDefinition)BeanComponentDefinition that is to be processedHook method called after the primary parsing of a
|
| protected void | registerBeanDefinition(BeanDefinitionHolder
the bean definition to be registered definition, BeanDefinitionRegistry the registry that the bean is to be registered with registry) |
| protected String | Returns: the resolved idthe element that the bean definition has been built from element, AbstractBeanDefinition the bean definition to be registered definition, ParserContext the object encapsulating the current state of the parsing process;
provides access to a parserContext)org.Resolve the ID for the supplied |
| protected boolean | Returns: true in order to fire a component registration event
after parsing the bean definition; false to suppress the eventDetermine whether this parser is supposed to fire a
|
| protected boolean | Returns: whether the parser should always generate an idShould an ID be generated instead of read from the passed in |
| protected boolean | Returns: whether the parser should generate an id if no id was specifiedShould an ID be generated instead if the passed in |
| protected boolean | Returns: whether the parser should evaluate the "name" attribute as aliasesDetermine whether the element's "name" attribute should get parsed as bean definition aliases, i.e. alternative bean definition names. |
| ID_ATTRIBUTE | back to summary |
|---|---|
| public static final String ID_ATTRIBUTE Constant for the "id" attribute. | |
| NAME_ATTRIBUTE | back to summary |
|---|---|
| public static final String NAME_ATTRIBUTE Constant for the "name" attribute. | |
| AbstractBeanDefinitionParser | back to summary |
|---|---|
| public AbstractBeanDefinitionParser() | |
| parse | back to summary |
|---|---|
| public final BeanDefinition parse(Element element, ParserContext parserContext) Implements org. Doc from org. Parse the specified Implementations must return the primary
| |
| parseInternal | back to summary |
|---|---|
| protected abstract AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) Central template method to actually parse the supplied
| |
| postProcessComponentDefinition | back to summary |
|---|---|
| protected void postProcessComponentDefinition(BeanComponentDefinition componentDefinition) Hook method called after the primary parsing of a
Derived classes can override this method to supply any custom logic that is to be executed after all the parsing is finished. The default implementation is a no-op.
| |
| registerBeanDefinition | back to summary |
|---|---|
| protected void registerBeanDefinition(BeanDefinitionHolder definition, BeanDefinitionRegistry registry) Register the supplied Subclasses can override this method to control whether the supplied
The default implementation registers the supplied
| |
| resolveId | back to summary |
|---|---|
| protected String resolveId(Element element, AbstractBeanDefinition definition, ParserContext parserContext) throws BeanDefinitionStoreException Resolve the ID for the supplied When using
| |
| shouldFireEvents | back to summary |
|---|---|
| protected boolean shouldFireEvents() Determine whether this parser is supposed to fire a
This implementation returns
| |
| shouldGenerateId | back to summary |
|---|---|
| protected boolean shouldGenerateId() Should an ID be generated instead of read from the passed in Disabled by default; subclasses can override this to enable ID generation. Note that this flag is about always generating an ID; the parser won't even check for an "id" attribute in this case.
| |
| shouldGenerateIdAsFallback | back to summary |
|---|---|
| protected boolean shouldGenerateIdAsFallback() Should an ID be generated instead if the passed in 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.
| |
| shouldParseNameAsAliases | back to summary |
|---|---|
| protected boolean shouldParseNameAsAliases() Determine whether the element's "name" attribute should get parsed as bean definition aliases, i.e. alternative bean definition names. The default implementation returns
| |