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

public Class DeclareParentsAdvisor

extends Object
implements IntroductionAdvisor
Class Inheritance
All Implemented Interfaces
org.springframework.aop.IntroductionAdvisor, org.springframework.aop.IntroductionInfo, org.springframework.aop.Advisor
Imports
org.aopalliance.aop.Advice, org.springframework.aop.ClassFilter, .IntroductionAdvisor, .IntroductionInterceptor, org.springframework.aop.support.ClassFilters, .DelegatePerTargetObjectIntroductionInterceptor, .DelegatingIntroductionInterceptor

Introduction advisor delegating to the given object. Implements AspectJ annotation-style behavior for the DeclareParents annotation.
Authors
Rod Johnson, Ramnivas Laddad
Since
2.0

Field Summary

Modifier and TypeField and Description
private final Advice
private final Class<?>
private final ClassFilter

Constructor Summary

AccessConstructor and Description
public
DeclareParentsAdvisor(Class<?>
static field defining the introduction
interfaceType
,
String
type pattern the introduction is restricted to
typePattern
,
Class<?>
the default implementation class
defaultImpl
)

Create a new advisor for this DeclareParents field.

public
DeclareParentsAdvisor(Class<?>
static field defining the introduction
interfaceType
,
String
type pattern the introduction is restricted to
typePattern
,
Object
the delegate implementation object
delegateRef
)

Create a new advisor for this DeclareParents field.

private
DeclareParentsAdvisor(Class<?>
static field defining the introduction
interfaceType
,
String
type pattern the introduction is restricted to
typePattern
,
IntroductionInterceptor
the delegation advice as IntroductionInterceptor
interceptor
)

Private constructor to share common code between impl-based delegate and reference-based delegate (cannot use method such as init() to share common code, due the use of final fields).

Method Summary

Modifier and TypeMethod and Description
public Advice
getAdvice()

Implements org.springframework.aop.Advisor.getAdvice.

Return the advice part of this aspect.
public ClassFilter
getClassFilter()

Implements org.springframework.aop.IntroductionAdvisor.getClassFilter.

Return the filter determining which target classes this introduction should apply to.
public Class<?>[]
getInterfaces()

Implements org.springframework.aop.IntroductionInfo.getInterfaces.

Return the additional interfaces introduced by this Advisor or Advice.
public void
validateInterfaces()

Implements org.springframework.aop.IntroductionAdvisor.validateInterfaces.

Can the advised interfaces be implemented by the introduction advice?
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

adviceback to summary
private final Advice advice
introducedInterfaceback to summary
private final Class<?> introducedInterface
typePatternClassFilterback to summary
private final ClassFilter typePatternClassFilter

Constructor Detail

DeclareParentsAdvisorback to summary
public DeclareParentsAdvisor(Class<?> interfaceType, String typePattern, Class<?> defaultImpl)

Create a new advisor for this DeclareParents field.

Parameters
interfaceType:Class<?>

static field defining the introduction

typePattern:String

type pattern the introduction is restricted to

defaultImpl:Class<?>

the default implementation class

DeclareParentsAdvisorback to summary
public DeclareParentsAdvisor(Class<?> interfaceType, String typePattern, Object delegateRef)

Create a new advisor for this DeclareParents field.

Parameters
interfaceType:Class<?>

static field defining the introduction

typePattern:String

type pattern the introduction is restricted to

delegateRef:Object

the delegate implementation object

DeclareParentsAdvisorback to summary
private DeclareParentsAdvisor(Class<?> interfaceType, String typePattern, IntroductionInterceptor interceptor)

Private constructor to share common code between impl-based delegate and reference-based delegate (cannot use method such as init() to share common code, due the use of final fields).

Parameters
interfaceType:Class<?>

static field defining the introduction

typePattern:String

type pattern the introduction is restricted to

interceptor:IntroductionInterceptor

the delegation advice as IntroductionInterceptor

Method Detail

getAdviceback to summary
public Advice getAdvice()

Implements org.springframework.aop.Advisor.getAdvice.

Doc from org.springframework.aop.Advisor.getAdvice.

Return the advice part of this aspect. An advice may be an interceptor, a before advice, a throws advice, etc.

Returns:Advice

the advice that should apply if the pointcut matches

Annotations
@Override
getClassFilterback to summary
public ClassFilter getClassFilter()

Implements org.springframework.aop.IntroductionAdvisor.getClassFilter.

Doc from org.springframework.aop.IntroductionAdvisor.getClassFilter.

Return the filter determining which target classes this introduction should apply to.

This represents the class part of a pointcut. Note that method matching doesn't make sense to introductions.

Returns:ClassFilter

the class filter

Annotations
@Override
getInterfacesback to summary
public Class<?>[] getInterfaces()

Implements org.springframework.aop.IntroductionInfo.getInterfaces.

Doc from org.springframework.aop.IntroductionInfo.getInterfaces.

Return the additional interfaces introduced by this Advisor or Advice.

Returns:Class<?>[]

the introduced interfaces

Annotations
@Override
validateInterfacesback to summary
public void validateInterfaces() throws IllegalArgumentException

Implements org.springframework.aop.IntroductionAdvisor.validateInterfaces.

Doc from org.springframework.aop.IntroductionAdvisor.validateInterfaces.

Can the advised interfaces be implemented by the introduction advice? Invoked before adding an IntroductionAdvisor.

Annotations
@Override
Exceptions
IllegalArgumentException:
if the advised interfaces can't be implemented by the introduction advice