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

ru.itbasis.utils.aspects.LoggerAbstractDialogForm.aj Maven / Gradle / Ivy

package ru.itbasis.utils.aspects;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.lang.reflect.Field;

@Aspect
public class LoggerAbstractDialogForm {
	private transient static final Logger LOG = LoggerFactory.getLogger(LoggerAbstractDialogForm.class.getName());

	@Pointcut("execution(* *.loadFieldData()) && this(ru.itbasis.utils.zk.ui.form.AbstractDialogForm)")
	protected void loadFieldData() {
	}

	@Around("loadFieldData()")
	public Object logLoadFieldData(ProceedingJoinPoint joinPoint) throws Throwable {
		if (LOG.isTraceEnabled()) {
			final Signature sig = joinPoint.getSignature();
			Field field = sig.getDeclaringType().getDeclaredField("_item");
			LOG.trace("item: {}", field);
		}
		return joinPoint.proceed();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy