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

jodd.proxetta.ProxyAspect 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;

import jodd.proxetta.pointcuts.AllMethodsPointcut;

/**
 * Proxy aspect contains advice and pointcut rules for applying advice.
 */
public class ProxyAspect {

	protected final Class advice;
	protected final ProxyPointcut pointcut;

	/**
	 * Creates aspect defined with provided advice and pointcut for all class methods.
	 */
	public ProxyAspect(Class advice) {
		this(advice, new AllMethodsPointcut());
	}

	/**
	 * Creates aspect defined with provided advice and pointcut.
	 */
	public ProxyAspect(Class advice, ProxyPointcut pointcut) {
		this.advice = advice;
		this.pointcut = pointcut;
	}

	/**
	 * Returns proxy advice class.
	 */
	public Class getAdvice() {
		return advice;
	}

	/**
	 * Returns proxy pointcut.
	 */
	public ProxyPointcut getPointcut() {
		return pointcut;
	}


	@Override
	public String toString() {
		return "ProxyAspect{" +
				"advice=" + advice.getName() +
				", pointcut=" + pointcut.getClass().getName() +
				'}';
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy