
ru.itbasis.utils.aspects.LoggerAbstractField.aj Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zk-utils Show documentation
Show all versions of zk-utils Show documentation
Utils from Zk Framework from simple create UI
The newest version!
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 LoggerAbstractField {
private transient static final Logger LOG = LoggerFactory.getLogger(LoggerAbstractField.class.getName());
@Pointcut("execution(* *.setValue*(..)) && this(ru.itbasis.utils.zk.ui.form.fields.AbstractField)")
protected void setValue() {
}
@Around("setValue()")
public Object logSetValue(ProceedingJoinPoint joinPoint) throws Throwable {
if (LOG.isTraceEnabled()) {
final Signature sig = joinPoint.getSignature();
Field field = sig.getDeclaringType().getDeclaredFields()[0];
LOG.trace("value: {}", field);
}
return joinPoint.proceed();
}
}