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

com.github.houbb.csv.annotation.Csv Maven / Gradle / Ivy

There is a newer version: 0.2.0
Show newest version
package com.github.houbb.csv.annotation;

import com.github.houbb.csv.api.IReadConverter;
import com.github.houbb.csv.api.IWriteConverter;
import com.github.houbb.csv.support.convert.read.CommonReadConverter;
import com.github.houbb.csv.support.convert.write.StringWriteConverter;

import java.lang.annotation.*;

/**
 * CSV 注解
 * @author binbin.hou
 * @since 0.0.1
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Target(ElementType.FIELD)
public @interface Csv {

    /**
     * 读取是否需要
     * @return 是
     */
    boolean readRequire() default true;

    /**
     * 写入是否需要
     * @return 是
     */
    boolean writeRequire() default true;

    /**
     * 字段显示名称
     * 1. 默认使用 field.name
     * @return 显示名称
     */
    String label() default "";

    /**
     * 读取转换
     * @return 处理实现类
     */
    Class readConverter() default CommonReadConverter.class;

    /**
     * 写入转换
     * @return 处理实现类
     */
    Class writeConverter() default StringWriteConverter.class;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy