All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jodd.proxetta.pointcuts.AllRealMethodsPointcut Maven / Gradle / Ivy

Go to download

Jodd Proxetta is the fastest proxy creator with unique approach for defying pointcuts and advices.

There is a newer version: 6.0.1
Show newest version
// Copyright (c) 2003-2014, Jodd Team (jodd.org). All Rights Reserved.

package jodd.proxetta.pointcuts;

import jodd.proxetta.MethodInfo;

/**
 * Pointcut on all public methods that are not getters or setters
 */
public class AllRealMethodsPointcut extends ProxyPointcutSupport {

	public boolean apply(MethodInfo methodInfo) {

		if (hasReturnValue(methodInfo)
				&& (matchMethodName(methodInfo, "get*") || (matchMethodName(methodInfo, "is*")))
				&& hasNoArguments(methodInfo)) {
			// getter
			return false;
		}

		if (matchMethodName(methodInfo, "set*")
				&& hasOneArgument(methodInfo)) {
			// setter
			return false;
		}

		return isPublic(methodInfo);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy