org.springframework.aop.support.ClassFilters Java Examples

The following examples show how to use org.springframework.aop.support.ClassFilters. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DeclareParentsAdvisor.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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)
 * @param interfaceType static field defining the introduction
 * @param typePattern type pattern the introduction is restricted to
 * @param implementationClass implementation class
 * @param advice delegation advice
 */
private DeclareParentsAdvisor(Class<?> interfaceType, String typePattern, Class<?> implementationClass, Advice advice) {
	this.introducedInterface = interfaceType;
	ClassFilter typePatternFilter = new TypePatternClassFilter(typePattern);

	// Excludes methods implemented.
	ClassFilter exclusion = new ClassFilter() {
		@Override
		public boolean matches(Class<?> clazz) {
			return !(introducedInterface.isAssignableFrom(clazz));
		}
	};

	this.typePatternClassFilter = ClassFilters.intersection(typePatternFilter, exclusion);
	this.advice = advice;
}
 
Example #2
Source File: DeclareParentsAdvisor.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
/**
 * 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 the use of final fields)
 * @param interfaceType static field defining the introduction
 * @param typePattern type pattern the introduction is restricted to
 * @param implementationClass implementation class
 * @param advice delegation advice
 */
private DeclareParentsAdvisor(Class<?> interfaceType, String typePattern, Class<?> implementationClass, Advice advice) {
	this.introducedInterface = interfaceType;
	ClassFilter typePatternFilter = new TypePatternClassFilter(typePattern);

	// Excludes methods implemented.
	ClassFilter exclusion = new ClassFilter() {
		@Override
		public boolean matches(Class<?> clazz) {
			return !(introducedInterface.isAssignableFrom(clazz));
		}
	};

	this.typePatternClassFilter = ClassFilters.intersection(typePatternFilter, exclusion);
	this.advice = advice;
}
 
Example #3
Source File: DeclareParentsAdvisor.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * 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).
 * @param interfaceType static field defining the introduction
 * @param typePattern type pattern the introduction is restricted to
 * @param interceptor the delegation advice as {@link IntroductionInterceptor}
 */
private DeclareParentsAdvisor(Class<?> interfaceType, String typePattern, IntroductionInterceptor interceptor) {
	this.advice = interceptor;
	this.introducedInterface = interfaceType;

	// Excludes methods implemented.
	ClassFilter typePatternFilter = new TypePatternClassFilter(typePattern);
	ClassFilter exclusion = (clazz -> !this.introducedInterface.isAssignableFrom(clazz));
	this.typePatternClassFilter = ClassFilters.intersection(typePatternFilter, exclusion);
}
 
Example #4
Source File: DeclareParentsAdvisor.java    From java-technology-stack with MIT License 5 votes vote down vote up
/**
 * 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).
 * @param interfaceType static field defining the introduction
 * @param typePattern type pattern the introduction is restricted to
 * @param interceptor the delegation advice as {@link IntroductionInterceptor}
 */
private DeclareParentsAdvisor(Class<?> interfaceType, String typePattern, IntroductionInterceptor interceptor) {
	this.advice = interceptor;
	this.introducedInterface = interfaceType;

	// Excludes methods implemented.
	ClassFilter typePatternFilter = new TypePatternClassFilter(typePattern);
	ClassFilter exclusion = (clazz -> !this.introducedInterface.isAssignableFrom(clazz));
	this.typePatternClassFilter = ClassFilters.intersection(typePatternFilter, exclusion);
}