implementation
that by default applies to any class.
| Method from org.springframework.aop.support.DefaultIntroductionAdvisor Detail: |
public void addInterface(Class intf) {
Assert.notNull(intf, "Interface must not be null");
if (!intf.isInterface()) {
throw new IllegalArgumentException("Specified class [" + intf.getName() + "] must be an interface");
}
this.interfaces.add(intf);
}
Add the specified interface to the list of interfaces to introduce. |
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (!(other instanceof DefaultIntroductionAdvisor)) {
return false;
}
DefaultIntroductionAdvisor otherAdvisor = (DefaultIntroductionAdvisor) other;
return (this.advice.equals(otherAdvisor.advice) && this.interfaces.equals(otherAdvisor.interfaces));
}
|
public Advice getAdvice() {
return this.advice;
}
|
public ClassFilter getClassFilter() {
return this;
}
|
public Class[] getInterfaces() {
return (Class[]) this.interfaces.toArray(new Class[this.interfaces.size()]);
}
|
public int getOrder() {
return this.order;
}
|
public int hashCode() {
return this.advice.hashCode() * 13 + this.interfaces.hashCode();
}
|
public boolean isPerInstance() {
return true;
}
|
public boolean matches(Class clazz) {
return true;
}
|
public void setOrder(int order) {
this.order = order;
}
|
public String toString() {
return ClassUtils.getShortName(getClass()) + ": advice [" + this.advice + "]; interfaces " +
ClassUtils.classNamesToString(this.interfaces);
}
|
public void validateInterfaces() throws IllegalArgumentException {
for (Iterator it = this.interfaces.iterator(); it.hasNext();) {
Class ifc = (Class) it.next();
if (this.advice instanceof DynamicIntroductionAdvice &&
!((DynamicIntroductionAdvice) this.advice).implementsInterface(ifc)) {
throw new IllegalArgumentException("DynamicIntroductionAdvice [" + this.advice + "] " +
"does not implement interface [" + ifc.getName() + "] specified for introduction");
}
}
}
|