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

pack-priv Class ConfigBeanDefinitionParser

extends Object
implements BeanDefinitionParser
Class Inheritance
All Implemented Interfaces
org.springframework.beans.factory.xml.BeanDefinitionParser
Imports
java.util.ArrayList, .List, org.w3c.dom.Element, .Node, .NodeList, org.springframework.aop.aspectj.AspectJAfterAdvice, .AspectJAfterReturningAdvice, .AspectJAfterThrowingAdvice, .AspectJAroundAdvice, .AspectJExpressionPointcut, .AspectJMethodBeforeAdvice, .AspectJPointcutAdvisor, .DeclareParentsAdvisor, org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor, org.springframework.beans.factory.config.BeanDefinition, .BeanReference, .ConstructorArgumentValues, .RuntimeBeanNameReference, .RuntimeBeanReference, org.springframework.beans.factory.parsing.CompositeComponentDefinition, .ParseState, org.springframework.beans.factory.support.AbstractBeanDefinition, .BeanDefinitionBuilder, .BeanDefinitionRegistry, .RootBeanDefinition, org.springframework.beans.factory.xml.BeanDefinitionParser, .ParserContext, org.springframework.lang.Nullable, org.springframework.util.StringUtils, org.springframework.util.xml.DomUtils

BeanDefinitionParser for the <aop:config> tag.
Authors
Rob Harrop, Juergen Hoeller, Adrian Colyer, Mark Fisher, Ramnivas Laddad
Since
2.0

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final int
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final int
private static final String
private final ParseState
private static final String
private static final int
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
configureAutoProxyCreator(ParserContext parserContext, Element element)

Configures the auto proxy creator needed to support the BeanDefinitions created by the '<aop:config/>' tag.

private AbstractBeanDefinition
createAdviceDefinition(Element adviceElement, ParserContext parserContext, String aspectName, int order, RootBeanDefinition methodDef, RootBeanDefinition aspectFactoryDef, List<BeanDefinition> beanDefinitions, List<BeanReference> beanReferences)

Creates the RootBeanDefinition for a POJO advice bean.

private AbstractBeanDefinition
createAdvisorBeanDefinition(Element advisorElement, ParserContext parserContext)

Create a RootBeanDefinition for the advisor described in the supplied.

private AspectComponentDefinition
createAspectComponentDefinition(Element aspectElement, String aspectId, List<BeanDefinition> beanDefs, List<BeanReference> beanRefs, ParserContext parserContext)

protected AbstractBeanDefinition
createPointcutDefinition(String expression)

Creates a BeanDefinition for the AspectJExpressionPointcut class using the supplied pointcut expression.

private Class<?>
getAdviceClass(Element adviceElement, ParserContext parserContext)

Gets the advice implementation class corresponding to the supplied Element.

private boolean
isAdviceNode(Node aNode, ParserContext parserContext)

Return true if the supplied node describes an advice type.

public BeanDefinition
parse(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 org.springframework.beans.factory.xml.BeanDefinitionParser.parse.

Parse the specified Element and register the resulting BeanDefinition(s) with the BeanDefinitionRegistry embedded in the supplied ParserContext.

private AbstractBeanDefinition

Returns:

the generated advice RootBeanDefinition
parseAdvice
(String aspectName, int order, Element aspectElement, Element adviceElement, ParserContext parserContext, List<BeanDefinition> beanDefinitions, List<BeanReference> beanReferences)

Parses one of 'before', 'after', 'after-returning', 'after-throwing' or 'around' and registers the resulting BeanDefinition with the supplied BeanDefinitionRegistry.

private void
parseAdvisor(Element advisorElement, ParserContext parserContext)

Parses the supplied <advisor> element and registers the resulting org.springframework.aop.Advisor and any resulting org.springframework.aop.Pointcut with the supplied BeanDefinitionRegistry.

private void
parseAspect(Element aspectElement, ParserContext parserContext)

private AbstractBeanDefinition
parseDeclareParents(Element declareParentsElement, ParserContext parserContext)

Parse a 'declare-parents' element and register the appropriate DeclareParentsAdvisor with the BeanDefinitionRegistry encapsulated in the supplied ParserContext.

private AbstractBeanDefinition
parsePointcut(Element pointcutElement, ParserContext parserContext)

Parses the supplied <pointcut> and registers the resulting Pointcut with the BeanDefinitionRegistry.

private Object
parsePointcutProperty(Element element, ParserContext parserContext)

Parses the pointcut or pointcut-ref attributes of the supplied Element and add a pointcut property as appropriate.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ADVICE_BEAN_NAMEback to summary
private static final String ADVICE_BEAN_NAME
ADVICE_REFback to summary
private static final String ADVICE_REF
ADVISORback to summary
private static final String ADVISOR
AFTERback to summary
private static final String AFTER
AFTER_RETURNING_ELEMENTback to summary
private static final String AFTER_RETURNING_ELEMENT
AFTER_THROWING_ELEMENTback to summary
private static final String AFTER_THROWING_ELEMENT
ARG_NAMESback to summary
private static final String ARG_NAMES
ARG_NAMES_PROPERTYback to summary
private static final String ARG_NAMES_PROPERTY
AROUNDback to summary
private static final String AROUND
ASPECTback to summary
private static final String ASPECT
ASPECT_INSTANCE_FACTORY_INDEXback to summary
private static final int ASPECT_INSTANCE_FACTORY_INDEX
ASPECT_NAME_PROPERTYback to summary
private static final String ASPECT_NAME_PROPERTY
BEFOREback to summary
private static final String BEFORE
DECLARATION_ORDER_PROPERTYback to summary
private static final String DECLARATION_ORDER_PROPERTY
DECLARE_PARENTSback to summary
private static final String DECLARE_PARENTS
DEFAULT_IMPLback to summary
private static final String DEFAULT_IMPL
DELEGATE_REFback to summary
private static final String DELEGATE_REF
EXPRESSIONback to summary
private static final String EXPRESSION
IDback to summary
private static final String ID
IMPLEMENT_INTERFACEback to summary
private static final String IMPLEMENT_INTERFACE
METHOD_INDEXback to summary
private static final int METHOD_INDEX
ORDER_PROPERTYback to summary
private static final String ORDER_PROPERTY
parseStateback to summary
private final ParseState parseState
POINTCUTback to summary
private static final String POINTCUT
POINTCUT_INDEXback to summary
private static final int POINTCUT_INDEX
POINTCUT_REFback to summary
private static final String POINTCUT_REF
REFback to summary
private static final String REF
RETURNINGback to summary
private static final String RETURNING
RETURNING_PROPERTYback to summary
private static final String RETURNING_PROPERTY
THROWINGback to summary
private static final String THROWING
THROWING_PROPERTYback to summary
private static final String THROWING_PROPERTY
TYPE_PATTERNback to summary
private static final String TYPE_PATTERN

Constructor Detail

ConfigBeanDefinitionParserback to summary
pack-priv ConfigBeanDefinitionParser()

Method Detail

configureAutoProxyCreatorback to summary
private void configureAutoProxyCreator(ParserContext parserContext, Element element)

Configures the auto proxy creator needed to support the BeanDefinitions created by the '<aop:config/>' tag. Will force class proxying if the 'proxy-target-class' attribute is set to 'true'.

See Also
AopNamespaceUtils
createAdviceDefinitionback to summary
private AbstractBeanDefinition createAdviceDefinition(Element adviceElement, ParserContext parserContext, String aspectName, int order, RootBeanDefinition methodDef, RootBeanDefinition aspectFactoryDef, List<BeanDefinition> beanDefinitions, List<BeanReference> beanReferences)

Creates the RootBeanDefinition for a POJO advice bean. Also causes pointcut parsing to occur so that the pointcut may be associate with the advice bean. This same pointcut is also configured as the pointcut for the enclosing Advisor definition using the supplied MutablePropertyValues.

createAdvisorBeanDefinitionback to summary
private AbstractBeanDefinition createAdvisorBeanDefinition(Element advisorElement, ParserContext parserContext)

Create a RootBeanDefinition for the advisor described in the supplied. Does not parse any associated 'pointcut' or 'pointcut-ref' attributes.

createAspectComponentDefinitionback to summary
private AspectComponentDefinition createAspectComponentDefinition(Element aspectElement, String aspectId, List<BeanDefinition> beanDefs, List<BeanReference> beanRefs, ParserContext parserContext)
createPointcutDefinitionback to summary
protected AbstractBeanDefinition createPointcutDefinition(String expression)

Creates a BeanDefinition for the AspectJExpressionPointcut class using the supplied pointcut expression.

getAdviceClassback to summary
private Class<?> getAdviceClass(Element adviceElement, ParserContext parserContext)

Gets the advice implementation class corresponding to the supplied Element.

isAdviceNodeback to summary
private boolean isAdviceNode(Node aNode, ParserContext parserContext)

Return true if the supplied node describes an advice type. May be one of: 'before', 'after', 'after-returning', 'after-throwing' or 'around'.

parseback to summary
public BeanDefinition parse(Element element, ParserContext parserContext)

Implements org.springframework.beans.factory.xml.BeanDefinitionParser.parse.

Doc from org.springframework.beans.factory.xml.BeanDefinitionParser.parse.

Parse the specified Element and register the resulting BeanDefinition(s) with the BeanDefinitionRegistry embedded in the supplied ParserContext.

Implementations must return the primary BeanDefinition that results from the parse if they will ever be used in a nested fashion (for example as an inner tag in a <property/> tag). Implementations may return null if they will not be used in a nested fashion.

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:BeanDefinition

the primary BeanDefinition

Annotations
@Override
@Nullable
parseAdviceback to summary
private AbstractBeanDefinition parseAdvice(String aspectName, int order, Element aspectElement, Element adviceElement, ParserContext parserContext, List<BeanDefinition> beanDefinitions, List<BeanReference> beanReferences)

Parses one of 'before', 'after', 'after-returning', 'after-throwing' or 'around' and registers the resulting BeanDefinition with the supplied BeanDefinitionRegistry.

Returns:AbstractBeanDefinition

the generated advice RootBeanDefinition

parseAdvisorback to summary
private void parseAdvisor(Element advisorElement, ParserContext parserContext)

Parses the supplied <advisor> element and registers the resulting org.springframework.aop.Advisor and any resulting org.springframework.aop.Pointcut with the supplied BeanDefinitionRegistry.

parseAspectback to summary
private void parseAspect(Element aspectElement, ParserContext parserContext)
parseDeclareParentsback to summary
private AbstractBeanDefinition parseDeclareParents(Element declareParentsElement, ParserContext parserContext)

Parse a 'declare-parents' element and register the appropriate DeclareParentsAdvisor with the BeanDefinitionRegistry encapsulated in the supplied ParserContext.

parsePointcutback to summary
private AbstractBeanDefinition parsePointcut(Element pointcutElement, ParserContext parserContext)

Parses the supplied <pointcut> and registers the resulting Pointcut with the BeanDefinitionRegistry.

parsePointcutPropertyback to summary
private Object parsePointcutProperty(Element element, ParserContext parserContext)

Parses the pointcut or pointcut-ref attributes of the supplied Element and add a pointcut property as appropriate. Generates a org.springframework.beans.factory.config.BeanDefinition for the pointcut if necessary and returns its bean name, otherwise returns the bean name of the referred pointcut.

Annotations
@Nullable