com.github.mygreen.cellformatter.term.TextTerm Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of excel-cellformatter Show documentation
Show all versions of excel-cellformatter Show documentation
Excelのセルの書式を解析してフォーマットするライブラリ。
package com.github.mygreen.cellformatter.term;
import java.util.Locale;
import com.github.mygreen.cellformatter.lang.ArgUtils;
import com.github.mygreen.cellformatter.lang.MSLocale;
import com.github.mygreen.cellformatter.tokenizer.Token;
/**
* テキスト用の書式用の特別な項
* @author T.TSUCHIE
*
*/
public abstract class TextTerm implements Term {
public static AtMarkTerm atMark(final Token.Symbol token) {
return new AtMarkTerm(token);
}
/**
* 記号'@'の項
*/
public static class AtMarkTerm extends TextTerm {
private final Token.Symbol token;
public AtMarkTerm(final Token.Symbol token) {
ArgUtils.notNull(token, "token");
this.token = token;
}
@Override
public String format(final String value, final MSLocale formatLocale, final Locale runtimeLocale) {
return value == null ? "" : value;
}
public Token.Symbol getToken() {
return token;
}
}
}