org.onetwo.common.annotation.AbstractAnnotationProcessor Maven / Gradle / Ivy
package org.onetwo.common.annotation;
import org.onetwo.common.utils.ArrayUtils;
@SuppressWarnings("rawtypes")
abstract public class AbstractAnnotationProcessor implements AnnotationProcessor{
private T[] listenActions;
public AbstractAnnotationProcessor(T... action) {
super();
this.listenActions = action;
}
public T[] getListenActions() {
return listenActions;
}
public boolean canDoAnnotation(AnnoContext context){
return context.getAnnotation()!=null && ArrayUtils.contains(listenActions, context.getEventAction());
}
@Override
public void doWithAnnotation(AnnoContext context) {
this.doAnnotation(context);
}
abstract public void doAnnotation(AnnoContext context);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy