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

org.onetwo.common.annotation.AbstractAnnotationProcessor Maven / Gradle / Ivy

There is a newer version: 4.7.2
Show newest version
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