
com.github.mygreen.supercsv.annotation.conversion.CsvLeftPad Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of super-csv-annotation Show documentation
Show all versions of super-csv-annotation Show documentation
CSVのJavaライブラリであるSuperCSVに、アノテーション機能を追加したライブラリです。
package com.github.mygreen.supercsv.annotation.conversion;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import com.github.mygreen.supercsv.annotation.DefaultGroup;
import com.github.mygreen.supercsv.builder.BuildCase;
/**
* 左側にパディングします。
* 変換対象の文字長が属性{@link #size()}の値を超える場合、パディングは行いません。
*
* @since 2.0
* @author T.TSUCHIE
*
*/
@Target({ElementType.FIELD, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Repeatable(CsvLeftPad.List.class)
@CsvConversion(value={})
public @interface CsvLeftPad {
/**
* パディングするサイズを指定します。
* @return 値は1以上を設定する必要があります。
*/
int size();
/**
* パディングする際の文字を指定します。
* @return パディングの文字
*/
char padChar() default ' ';
/**
* 適用するケースを指定します。
* @return 何も指定しない場合は全てのケースに適用されます。
*/
BuildCase[] cases() default {};
/**
* グループのクラスを指定します。
* 処理ごとに適用するアノテーションを切り替えたい場合に指定します。
* @return 指定しない場合は、{@link DefaultGroup}が適用され全ての処理に適用されます。
*/
Class>[] groups() default {};
/**
* アノテーションの処理順序の定義。
* @return 値が大きいほど後に実行されます。
* 値が同じ場合は、アノテーションのクラス名の昇順になります。
*/
int order() default 0;
/**
* アノテーションを複数個指定する際の要素です。
*/
@Target({ElementType.FIELD, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@interface List {
CsvLeftPad[] value();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy