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 */
016 package org.opengion.hayabusa.db;
017
018 import org.opengion.fukurou.util.LogWriter;
019 import org.opengion.fukurou.util.StringUtil;
020
021 import org.opengion.hayabusa.common.HybsSystem;
022 import org.opengion.hayabusa.resource.CodeData;
023
024 /**
025 * ãƒ??タのコード情報を取り扱ã�?electionクラスの、NULL時オブジェクトですã?
026 *
027 * 以前ã?、Selection オブジェクトが null の場合に、NullPointerException で
028 * ã�?��なりエラーで停止してã�?�¾したがã?こã?、NULLセレクションを作æ?することでã€?
029 * 取りあえずã?どã�?�„ã�?ж況なのかã?判るよã�?�«しますã?
030 *
031 * @og.rev 5.7.3.0 (2014/02/07) 新規追åŠ?
032 * @og.group 選択データ制御
033 *
034 * @version 4.0
035 * @author Kazuhiko Hasegawa
036 * @since JDK5.0,
037 */
038 public class Selection_NULL extends Selection_KEYVAL {
039 private final String errMsg ;
040
041 /**
042 * 引数にエラーメãƒ?‚»ージを指定して作æ?する、コンストラクター
043 *
044 * @og.rev 5.7.3.0 (2014/02/07) 新規追åŠ?
045 *
046 * @param strCode エラーメãƒ?‚»ージæ–?—å?
047 */
048 public Selection_NULL( final String strCode ) {
049 super( null );
050 errMsg = strCode ;
051 }
052
053 /**
054 * 初期値が選択済みの 選択肢(オプション)を返しますã?
055 * 無条件で、エラーメãƒ?‚»ージを返しますã?
056 *
057 * @og.rev 5.7.3.0 (2014/02/07) 新規追åŠ?
058 *
059 * @param selectValue 選択されてã�?‚‹値
060 * @param seqFlag シーケンスアクセス機è? [true:ON/false:OFF]
061 * @param useShortLabel ラベル(短)をã?ースとしたオプション表示を行うかどã�?�‹(常にfalse)ã€?
062 *
063 * @return オプションタグ
064 * @see #getOption( String, boolean )
065 */
066 @Override
067 public String getOption( final String selectValue,final boolean seqFlag, final boolean useShortLabel ) {
068 return errMsg + " value=[" + selectValue + "]";
069 }
070
071 /**
072 * 選択肢(value)に対するラベルを返しますã?
073 * 無条件で、エラーメãƒ?‚»ージを返しますã?
074 *
075 * @og.rev 5.7.3.0 (2014/02/07) 新規追åŠ?
076 *
077 * @param selectValue 選択肢の値
078 * @param flag 短縮ラベルã‚?[true:使用する/false:しない](常に false)
079 *
080 * @return 選択肢のラベル
081 * @see #getValueLabel( String )
082 */
083 @Override
084 public String getValueLabel( final String selectValue,final boolean flag ) {
085 return errMsg + " value=[" + selectValue + "]";
086 }
087 }