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

cn.gjing.tools.excel.write.valid.handle.ExcelValidAnnotationHandler Maven / Gradle / Ivy

package cn.gjing.tools.excel.write.valid.handle;

import cn.gjing.tools.excel.write.ExcelWriterContext;
import org.apache.poi.ss.usermodel.Row;

import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.util.Map;

/**
 * Excel validation annotation handler
 *
 * @author Gjing
 **/
public abstract class ExcelValidAnnotationHandler {
    /**
     * Annotation class
     */
    protected final Class annotationClass;

    protected ExcelValidAnnotationHandler(Class annotationClass) {
        this.annotationClass = annotationClass;
    }

    /**
     * Get the validation annotation type of the handler
     *
     * @return Annotation Class
     */
    public Class getAnnotationClass() {
        return this.annotationClass;
    }

    /**
     * Validation handle
     *
     * @param validAnnotation Excel valid annotation
     * @param writerContext   Write context
     * @param field     Current field
     * @param row       Current row
     * @param colIndex  Current col index
     * @param boxValues Dropdown box value map
     */
    public abstract void handle(Annotation validAnnotation, ExcelWriterContext writerContext, Field field, Row row, int colIndex, Map boxValues);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy