001/*
002 * Copyright (c) 2009 The openGion Project.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
013 * either express or implied. See the License for the specific language
014 * governing permissions and limitations under the License.
015 */
016package org.opengion.fukurou.model;
017
018/**
019 * 引数のテキストを変換する、関数型インターフェースです。
020 *
021 * xlsx等のEXCELを、イベント方式でテキストデータを読み取り、変換するケースを
022 * 想定していますが、それ以外にも使用可能です。
023 * メソッドを一つだけ用意した、関数型インターフェースです。
024 *
025 * @og.rev 6.2.4.2 (2015/05/29) 新規作成
026 * @og.group ファイル入力
027 *
028 * @version  6.0
029 * @author   Kazuhiko Hasegawa
030 * @since    JDK7.0,
031 */
032@FunctionalInterface
033public interface TextConverter<V,C> {
034
035        /**
036         * 入力文字列を、変換します。
037         *
038         * 変換されなかった場合は、null を返します。
039         * 例えば、何らかの変換処理を行う場合、データを読み取って、変換して、書き込みます。
040         * 変換が無かった場合、書き込む必要もない為、null を返すことで、変換が無かったことを
041         * 知らせます。
042         * よって、ある文字列を変換した結果を、null に設定することはできません。
043         * コメントは、それぞれのデータに関する付加情報を与えます。
044         * 例えば、EXCELなら、SHEET や、セル記号、オブジェクトの位置などです。
045         *
046         * @og.rev 6.2.4.2 (2015/05/29) テキスト変換処理
047         * @og.rev 6.3.1.0 (2015/06/28) TextConverterに、引数(cmnt)を追加
048         *
049         * @param       val  入力文字列
050         * @param       cmnt コメント
051         * @return      変換文字列(変換されない場合は、null)
052         */
053        V change( final V val , final C cmnt );
054}