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

public Class DefaultIntroductionAdvisor

extends Object
implements IntroductionAdvisor, ClassFilter, Ordered, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.springframework.core.Ordered, org.springframework.aop.ClassFilter, org.springframework.aop.IntroductionAdvisor, org.springframework.aop.IntroductionInfo, org.springframework.aop.Advisor
Annotations
@SuppressWarnings:serial
Imports
java.io.Serializable, java.util.LinkedHashSet, .Set, org.aopalliance.aop.Advice, org.springframework.aop.ClassFilter, .DynamicIntroductionAdvice, .IntroductionAdvisor, .IntroductionInfo, org.springframework.core.Ordered, org.springframework.lang.Nullable, org.springframework.util.Assert, .ClassUtils

Simple org.springframework.aop.IntroductionAdvisor implementation that by default applies to any class.
Authors
Rod Johnson, Juergen Hoeller
Since
11.11.2003

Field Summary

Modifier and TypeField and Description
private final Advice
private final Set<Class<?>>
private int

Constructor Summary

AccessConstructor and Description
public
DefaultIntroductionAdvisor(Advice
the Advice to apply (may implement the org.springframework.aop.IntroductionInfo interface)
advice
)

Create a DefaultIntroductionAdvisor for the given advice.

public
DefaultIntroductionAdvisor(Advice
the Advice to apply
advice
,
IntroductionInfo
the IntroductionInfo that describes the interface to introduce (may be null)
introductionInfo
)

Create a DefaultIntroductionAdvisor for the given advice.

public
DefaultIntroductionAdvisor(DynamicIntroductionAdvice
the Advice to apply
advice
,
Class<?>
the interface to introduce
ifc
)

Create a DefaultIntroductionAdvisor for the given advice.

Method Summary

Modifier and TypeMethod and Description
public void
addInterface(Class<?>
the interface to introduce
ifc
)

Add the specified interface to the list of interfaces to introduce.

public boolean
equals(Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
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 int
getOrder()

Implements org.springframework.core.Ordered.getOrder.

Get the order value of this object.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public boolean
matches(Class<?>
the candidate target class
clazz
)

Implements org.springframework.aop.ClassFilter.matches.

Should the pointcut apply to the given interface or target class?
public void
setOrder(int order)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public void
validateInterfaces()

Implements org.springframework.aop.IntroductionAdvisor.validateInterfaces.

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

Field Detail

adviceback to summary
private final Advice advice
interfacesback to summary
private final Set<Class<?>> interfaces
orderback to summary
private int order

Constructor Detail

DefaultIntroductionAdvisorback to summary
public DefaultIntroductionAdvisor(Advice advice)

Create a DefaultIntroductionAdvisor for the given advice.

Parameters
advice:Advice

the Advice to apply (may implement the org.springframework.aop.IntroductionInfo interface)

See Also
addInterface
DefaultIntroductionAdvisorback to summary
public DefaultIntroductionAdvisor(Advice advice, IntroductionInfo introductionInfo)

Create a DefaultIntroductionAdvisor for the given advice.

Parameters
advice:Advice

the Advice to apply

introductionInfo:IntroductionInfo

the IntroductionInfo that describes the interface to introduce (may be null)

DefaultIntroductionAdvisorback to summary
public DefaultIntroductionAdvisor(DynamicIntroductionAdvice advice, Class<?> ifc)

Create a DefaultIntroductionAdvisor for the given advice.

Parameters
advice:DynamicIntroductionAdvice

the Advice to apply

ifc:Class<?>

the interface to introduce

Method Detail

addInterfaceback to summary
public void addInterface(Class<?> ifc)

Add the specified interface to the list of interfaces to introduce.

Parameters
ifc:Class<?>

the interface to introduce

equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
other:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
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
getOrderback to summary
public int getOrder()

Implements org.springframework.core.Ordered.getOrder.

Doc from org.springframework.core.Ordered.getOrder.

Get the order value of this object.

Higher values are interpreted as lower priority. As a consequence, the object with the lowest value has the highest priority (somewhat analogous to Servlet load-on-startup values).

Same order values will result in arbitrary sort positions for the affected objects.

Returns:int

the order value

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
matchesback to summary
public boolean matches(Class<?> clazz)

Implements org.springframework.aop.ClassFilter.matches.

Doc from org.springframework.aop.ClassFilter.matches.

Should the pointcut apply to the given interface or target class?

Parameters
clazz:Class<?>

the candidate target class

Returns:boolean

whether the advice should apply to the given target class

Annotations
@Override
setOrderback to summary
public void setOrder(int order)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

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