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

jodd.methref.MethrefProxetta Maven / Gradle / Ivy

// Copyright (c) 2003-2014, Jodd Team (jodd.org). All Rights Reserved.

package jodd.methref;

import jodd.proxetta.ProxyAspect;
import jodd.proxetta.impl.ProxyProxettaBuilder;
import jodd.proxetta.impl.ProxyProxetta;
import jodd.proxetta.pointcuts.AllMethodsPointcut;

/**
 * Methref Proxetta builder and holder and facade.
 */
public class MethrefProxetta {

	protected final ProxyProxetta proxetta;

	public static final String METHREF_CLASSNAME_SUFFIX = "$Methref";

	public MethrefProxetta() {
		ProxyAspect aspects = new ProxyAspect(MethrefAdvice.class, new AllMethodsPointcut());

		proxetta = ProxyProxetta.withAspects(aspects);

		proxetta.setClassNameSuffix(METHREF_CLASSNAME_SUFFIX);
	}

	/**
	 * Generates new class.
	 */
	public Class defineProxy(Class target) {
		ProxyProxettaBuilder builder = proxetta.builder();
		builder.setTarget(target);
		return builder.define();
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy