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.hayabusa.resource;
017
018import java.text.MessageFormat;
019import java.util.Arrays;                                                                                        // 6.4.7.0 (2016/06/03)
020
021import org.opengion.fukurou.util.StringUtil ;
022import org.opengion.hayabusa.common.HybsSystemException;                        // 6.4.7.0 (2016/06/03)
023
024import static org.opengion.fukurou.system.HybsConst.BUFFER_MIDDLE;      // 6.1.0.0 (2014/12/26) refactoring
025import static org.opengion.fukurou.system.HybsConst.CR ;                        // 6.1.0.0 (2014/12/26)
026
027/**
028 * systemId , lang に対応したラベルデータを作成します。
029 *
030 * ラベルデータは、項目(CLM)に対して、各種ラベル情報を持っています。
031 * 従来のラベルは、表示名称として、一種類しか持っていませんでしたが、
032 * ラベルデータは、3種類の名称と、1種類の概要を持っています。
033 *
034 *   label       : 名称(長)      従来のラベルと同じで定義された文字そのものです。
035 *   shortLabel  : 名称(HTML短)  概要説明をバルーン表示する短い名称です。
036 *   longLabel   : 名称(HTML長)  概要説明をバルーン表示する長い名称です。
037 *   description : 概要説明      カラムの説明やバルーンに使用します。
038 *
039 * 名称(HTML長)は、従来の表示名称にあたります。これは、一般的なラベルとして
040 * 使用されます。名称(HTML短)は、テーブル一覧のヘッダーの様に、特殊なケースで、
041 * 簡略化された名称を使用するときに利用されます。この切り替えは、自動で判断されます。
042 * 名称(HTML短)に、なにも設定されていない場合は、名称(HTML長)が自動的に使用されますので
043 * 初期データ移行時には、そのまま、通常時もテーブルヘッダー時も同じ文字列が
044 * 使用されます。
045 * ただし、一覧表示のうち、EXCEL出力などのデータには、名称(長)が使用されます。
046 * これは、名称(HTML短)や名称(HTML長)は、Tips表示を行う為のHTML構文を採用している為
047 * テキスト等に出力するには不適切だからです。また、EXCEL等のツールでは、ラベル名が
048 * 長くてもセル幅等で調整できる為、簡略化された名称よりも正式名称で出力します。
049 *
050 * ラベルデータを作成する場合は、同一ラベルで、作成区分(KBSAKU)違いの場合は、
051 * 最も大きな作成区分を持つコードを使用します。
052 * 作成区分(KBSAKU)は、0:システム予約、1:アプリ設定、2:ユーザー設定 という具合に
053 * カスタマイズの度合いに応じて大きな数字を割り当てることで、キー情報を上書き修正
054 * することが可能になります。(削除することは出来ません。)
055 *
056 * @og.rev 4.0.0.0 (2004/12/31) 新規作成
057 * @og.group リソース管理
058 *
059 * @version  4.0
060 * @author   Kazuhiko Hasegawa
061 * @since    JDK5.0,
062 */
063public final class LabelData implements LabelInterface {
064
065        /** 内部データのカラム番号 {@value}        */
066        public static final int CLM                     = 0 ;
067        /** 内部データのカラム番号 {@value}        */
068        public static final int SNAME           = 1 ;
069        /** 内部データのカラム番号 {@value}        */
070        public static final int LNAME           = 2 ;
071        /** 内部データのカラム番号 {@value}        */
072        public static final int DESCRIPTION     = 3 ;
073//      /** 内部データのカラム数 {@value} */
074//      public static final int DATA_SIZE       = 4 ;           // 7.2.6.0 (2020/06/30) 未使用なので削除
075
076        /** リソース読み込みのために一時利用 4.3.5.7 (2009/03/22) */
077        /* default */ static final int FG_LOAD          = 4 ;
078        /** FGLOAD の読み込み済み設定用のUNIQ 6.3.1.1 (2015/07/10) */
079        /* default */ static final int UNIQ                     = 5 ;
080        /** FGLOAD の読み込み済み設定用のSYSTEM_ID 6.3.1.1 (2015/07/10) */
081        /* default */ static final int SYSTEM_ID        = 6 ;
082
083        /** 内部データのカラム番号 {@value}        */
084        public static final int KBSAKU          = 7 ;   // 7.4.2.0 (2021/05/18) 内部的に使ってないが定義しておく
085        /** 内部データのカラム番号 {@value}        */
086        public static final int SNO                     = 8 ;   // 7.2.6.1 (2020/07/17) 内部的に使ってないが定義しておく
087
088        private final String    key                     ;               // é …ç›®
089        private final String    label           ;               // 名称(長)
090        private final String    shortLabel      ;               // 名称(HTML短)
091        private final String    longLabel       ;               // 名称(HTML長)
092        private final String    description     ;               // 概要説明
093        private final boolean   official        ;               // リソースDBから作成されたかどうか
094//      private final boolean   isFormat        ;               // メッセージフォーマット対象かどうか 4.0.0.0 (2007/10/17) 7.1.0.1 (2020/02/07) 長,短,概要などあるため、直前にチェック
095        private final String    rawShortLabel;          // 名称(未変換短) 4.3.8.0 (2009/08/01)
096//      private final boolean   isFormatDesc;           // 概要がフォーマット対象か 4.3.7.6 (2009/07/15) 7.1.0.1 (2020/02/07) 未使用
097        private final String    rawLongLabel;           // 名称(未変換長) 5.6.8.2 (2013/09/20)
098
099        /**
100         * null LabelData オブジェクトを作成します。
101         * このオブジェクトは、DBリソース上に存在しない場合に使用される
102         * null 情報を表す、LabelData オブジェクトです。
103         *
104         * @og.rev 5.6.8.2 (2013/09/20) rawLongLabel対応
105         * @og.rev 5.7.3.0 (2014/02/07) public に格上げします。
106         * @og.rev 7.0.1.5 (2018/12/10) 名前とラベルだけ異なるLabelDataオブジェクトを作成します。
107         *
108         * @param       inkey   キー情報
109         */
110        public LabelData( final String inkey ) {
111                this( inkey,inkey );
112//              key                     = inkey.intern() ;
113//              label           = key ;         // 名称(長)
114//              shortLabel      = key ;         // 名称(HTML短)
115//              longLabel       = key ;         // 名称(HTML長)
116//              description     = ""  ;         // 概要説明
117//              official        = false;        // 非正式
118//              isFormat        = false;        // 非フォーマット 4.0.0.0 (2007/10/17)
119//              rawShortLabel = key;    // 名称(未変換短) 4.3.8.0 (2009/08/01)
120//              isFormatDesc = false;   // 概要フォーマット 4.3.7.6 (2009/07/15)
121//              rawLongLabel = key;             // 名称(未変換長)5.6.8.2 (2013/09/20)
122        }
123
124        /**
125         * 名前とラベルだけ異なるLabelDataオブジェクトを作成します。
126         *
127         * これは、ラベルを簡易的に利用する場合に使用する、LabelData オブジェクトです。
128         *
129         * @og.rev 7.0.1.5 (2018/12/10) 名前とラベルだけ異なるLabelDataオブジェクトを作成します。
130         * @og.rev 7.1.0.1 (2020/02/07) isFormat、isFormatDescは、長,短,概要などあるため、直前にチェックするので廃止。
131         *
132         * @param       inkey   キー情報
133         * @param       inLbl   ラベル
134         */
135        public LabelData( final String inkey,final String inLbl ) {
136                key                     = inkey.intern() ;
137                label           = inLbl ;       // 名称(長)                …(not null)
138                shortLabel      = inLbl ;       // 名称(HTML短)
139                longLabel       = inLbl ;       // 名称(HTML長)
140                description     = ""  ;         // 概要説明
141                official        = false;        // 非正式
142//              isFormat        = false;        // 非フォーマット 4.0.0.0 (2007/10/17) 7.1.0.1 (2020/02/07) 廃止
143                rawShortLabel = inLbl;  // 名称(未変換短) 4.3.8.0 (2009/08/01)
144//              isFormatDesc = false;   // 概要フォーマット 4.3.7.6 (2009/07/15) 7.1.0.1 (2020/02/07) 廃止
145                rawLongLabel = inLbl;   // 名称(未変換長)5.6.8.2 (2013/09/20)
146        }
147
148        /**
149         * 配列文字列のデータを元に、LabelDataオブジェクトを構築します。
150         * このコンストラクタは、他のパッケージから呼び出せないように、
151         * パッケージプライベートにしておきます。
152         * このコンストラクタは、DBリソースファイルを想定しています。
153         *
154         * @og.rev 5.4.0.1 (2011/11/01) SNAME、概要説明、rawShortLabel 関係の処理を修正
155         * @og.rev 5.6.8.2 (2013/09/20) rawLongLabel対応
156         * @og.rev 6.2.2.0 (2015/03/27) BRと\nを相互に変換する処理を追加
157         * @og.rev 6.2.2.3 (2015/04/10) htmlフィルターに、BR→改行処理機能を追加。
158         * @og.rev 6.3.9.0 (2015/11/06) StringUtil.yenN2br は、null を返しません。
159         * @og.rev 7.1.0.1 (2020/02/07) isFormat、isFormatDescは、長,短,概要などあるため、直前にチェックするので廃止。
160         * @og.rev 7.2.9.0 (2020/10/12) rawShortLabelは、DB検索未設定の場合は、nullなので、初期値指定を行う。
161         *
162         * @param       data    CLM,SNAME,LNAME,DESCRIPTION
163         */
164        /* default */ LabelData( final String[] data ) {
165                key                     = data[CLM].intern() ;                                                          // é …ç›®
166                label           = StringUtil.yenN2br( data[LNAME] ) ;                           // 6.2.2.3 (2015/04/10) 名称(HTML長)
167                description     = StringUtil.yenN2br( data[DESCRIPTION] ) ;                     // 6.2.2.3 (2015/04/10) 概要説明
168                official        = true;                                                                                         // 正式
169//              isFormat        = label.indexOf( '{' ) >= 0 ;                                           // 4.0.0.0 (2007/10/17)
170                String title = null;
171
172                rawLongLabel = label;                                                                                   // 名称(未変換長)5.6.8.2 (2013/09/20)
173                if( description.isEmpty() ) {                                                                   // 6.3.9.0 (2015/11/06) StringUtil.yenN2br は、null を返しません。
174//                      isFormatDesc = false;
175                        // 5.4.0.1 (2011/11/01) title と label が間違っている。(SNAME が存在する場合)
176                        title     = StringUtil.htmlFilter( label,true ) ;                       // 6.2.2.0 (2015/03/27)
177
178                        // 概要説明がない場合は、そのままラベルを使用する。
179                        longLabel = label;
180                }
181                else {
182//                      isFormatDesc = description.indexOf( '{' ) >= 0 ;                        // 5.1.8.0 (2010/07/01) nullポインタの参照外し対策
183                        title        = StringUtil.htmlFilter( description,true ) ;      // 6.2.2.0 (2015/03/27)
184
185                        // 概要説明がある場合は、ツールチップにDESCRIPTIONを表示する。
186                        longLabel = "<span title=\""
187                                                        + title
188                                                        + "\">"
189                                                        + label
190                                                        + "</span>" ;
191                }
192
193                final String sname = data[SNAME];               // 名称(HTML短)
194                if( sname == null || sname.isEmpty() ) {
195                        // SNAME がない場合は、longLabel を使用する。
196                        shortLabel    = longLabel;
197//                      rawShortLabel = label;          // 5.4.0.1 (2011/11/01) longLabel を使うと、ツールチップが加味されるため。
198                        rawShortLabel = null;           // 7.2.9.0 (2020/10/12)
199                }
200                else {
201                        // SNAME が存在する場合、ツールチップにdescriptionかlabelを使用する。
202                        shortLabel = "<span title=\""
203                                                        + title
204                                                        + "\">"
205                                                        + sname
206                                                        + "</span>" ;
207                        rawShortLabel = sname; // 4.3.8.0 (2009/08/01)
208                }
209        }
210
211        /**
212         * ラベルオブジェクトのキーを返します。
213         *
214         * @return      ラベルオブジェクトのキー
215         */
216        @Override       // LabelInterface
217        public String getKey() { return key; }
218
219        /**
220         * ラベルオブジェクトの名称を返します。
221         * これは、DB上の LNAME(名称(長))に該当します。
222         *
223         * @return      ラベルオブジェクトの名称(長)
224         */
225        @Override       // LabelInterface
226        public String getLabel() { return label; }
227
228        /**
229         * ラベルインターフェースの引数付きメッセージを返します。
230         * メッセージの引数部分に、文字列配列を適用して、MessageFormat
231         * で変換した結果を返します。(MessageData でのみ有効です。)
232         *
233         * @og.rev 4.0.0.0 (2007/10/17) メッセージリソース統合に伴い、MessageDataより移行
234         * @og.rev 4.3.8.0 (2009/08/01) 引数にHTMLサニタイジング処理
235         * @og.rev 5.0.0.2 (2009/09/15) サニタイジング処理をやめる
236         * @og.rev 6.4.3.4 (2016/03/11) ラベル {n} が存在しない場合は、引数を連結せず、元のラベルを返す。
237         * @og.rev 6.4.5.0 (2016/04/08) リソースから作成された場合は、引数を連結せず、そうでない場合は連結します。
238         * @og.rev 6.4.7.0 (2016/06/03) IllegalArgumentException が発生した場合に、見えるようにする。
239         * @og.rev 7.0.7.0 (2019/12/13) #getMessage(String...) , #getDescription(String...) , #getShortMessage(String...) を統合します。
240         *
241         * @param       vals    メッセージ引数の文字列配列(可変長引数)
242         *
243         * @return      ラベルインターフェースの引数付きメッセージ
244         */
245        @Override       // LabelInterface
246        public String getMessage( final String... vals ) {              // 6.1.1.0 (2015/01/17) 可変長引数でもnullは来る。
247                return getMessage( label,vals );
248        }
249
250        /**
251         * ラベルインターフェースの引数付きメッセージを返します。
252         * メッセージの引数部分に、文字列配列を適用して、MessageFormat
253         * で変換した結果を返します。(MessageData でのみ有効です。)
254         *
255         * @og.rev 4.0.0.0 (2007/10/17) メッセージリソース統合に伴い、MessageDataより移行
256         * @og.rev 4.3.8.0 (2009/08/01) 引数にHTMLサニタイジング処理
257         * @og.rev 5.0.0.2 (2009/09/15) サニタイジング処理をやめる
258         * @og.rev 6.4.3.4 (2016/03/11) ラベル {n} が存在しない場合は、引数を連結せず、元のラベルを返す。
259         * @og.rev 6.4.5.0 (2016/04/08) リソースから作成された場合は、引数を連結せず、そうでない場合は連結します。
260         * @og.rev 6.4.7.0 (2016/06/03) IllegalArgumentException が発生した場合に、見えるようにする。
261         * @og.rev 7.0.7.0 (2019/12/13) #getMessage(String...) , #getDescription(String...) , #getShortMessage(String...) を統合します。
262         * @og.rev 7.1.0.1 (2020/02/07) isFormat、isFormatDescは、長,短,概要などあるため、直前にチェックするので廃止。
263         *
264         * @param       lbl             メッセージを作成する元となるラベル文字列
265         * @param       vals    メッセージ引数の文字列配列(可変長引数)
266         *
267         * @return      ラベルインターフェースの引数付きメッセージ
268         */
269//      public String getMessage( final String... vals ) {                      // 6.1.1.0 (2015/01/17) 可変長引数でもnullは来る。
270        private String getMessage( final String lbl , final String[] vals ) {
271                final String rtn ;
272
273                final String[] args             = vals == null ? new String[0] : vals ;
274                final boolean isFormat  = lbl != null && lbl.indexOf( '{' ) >= 0 ;              // 7.1.0.1 (2020/02/07)
275                if( isFormat ) {
276                        // 6.4.7.0 (2016/06/03) IllegalArgumentException が発生した場合に、見えるようにする。
277                        try {
278//                              rtn = MessageFormat.format( label,(Object[])args );
279                                rtn = MessageFormat.format( lbl,(Object[])args );
280                        }
281                        catch( final IllegalArgumentException ex ) {
282                                final String errMsg = "MessageFormatエラー:"
283                                                        + " Key [" + key + "]"
284//                                                      + " Pattern [" + label + "]"
285                                                        + " Pattern [" + lbl + "]"
286                                                        + " Arguments [" + Arrays.toString( (Object[])args ) + "]" ;
287                                throw new HybsSystemException( errMsg,ex );
288                        }
289                }
290                else {
291                        // 6.4.5.0 (2016/04/08) リソースから作成された場合は、引数を連結せず、そうでない場合は連結します。
292                        if( official ) {
293//                              rtn = label ;                   // 6.4.3.4 (2016/03/11)
294                                rtn = lbl ;                             // 6.4.3.4 (2016/03/11)
295                        }
296                        else {
297                                final StringBuilder buf = new StringBuilder( BUFFER_MIDDLE )
298//                                      .append( label );
299                                        .append( lbl );
300                                for( final String val : args ) {
301//                                      if( val != null && ! val.equals( label ) ) {
302                                        if( val != null && ! val.equals( lbl ) ) {
303                                                buf.append( ' ' ).append( val );                                        // 6.0.2.5 (2014/10/31) char を append する。
304                                        }
305                                }
306                                rtn = buf.toString();
307                        }
308                }
309                return rtn ;
310        }
311
312        /**
313         * ラベルオブジェクトの名称(短)を返します。
314         * 概要説明がない場合でかつDB上のSNAMEが未設定の場合は、
315         * LNAME が返されます。SNAMEが設定されている場合は、
316         * ツールチップにLNAME が表示されます。
317         * 概要説明が存在する場合は、ツールチップに概要説明が
318         * 表示されます。
319         *
320         * @return      ラベルオブジェクトの名称(短)
321         */
322        @Override       // LabelInterface
323        public String getShortLabel() { return shortLabel; }
324
325        /**
326         * ラベルオブジェクトの名称(未変換短)を返します。
327         * このメソッドでは{0},{1}...をパラメータで置換します。
328         *
329         * @og.rev 7.0.7.0 (2019/12/13) #getMessage(String...) , #getDescription(String...) , #getShortMessage(String...) を統合します。
330         * @og.rev 7.2.9.0 (2020/10/12) rawShortLabelは、DB検索未設定の場合は、nullなので、初期値指定を行う。
331         *
332         * @param       vals    メッセージ引数の文字列配列(可変長引数)
333         *
334         * @return ラベルインターフェースの名前(短)
335         */
336        @Override       // LabelInterface
337        public String getShortMessage( final String... vals ) {
338                final String slbl = rawShortLabel == null ? label : rawShortLabel ;             // 7.2.9.0 (2020/10/12)
339//              return getMessage( rawShortLabel,vals );
340                return getMessage( slbl,vals );
341        }
342
343        /**
344         * ラベルオブジェクトの名称(長)を返します。
345         * 概要説明が存在する場合は、ツールチップに概要説明が
346         * 表示されます。
347         *
348         * @return      ラベルオブジェクトの名称(長)
349         * @see #getLongLabel( String )
350         */
351        @Override       // LabelInterface
352        public String getLongLabel() { return longLabel; }
353
354        /**
355         * ラベルインターフェースの名称(長)を返します。
356         * ツールチップに表示するタイトル属性(概要説明)を置き換えます。
357         * null の場合は、既存のgetLongLabel()を返します。
358         *
359         * @og.rev 6.2.2.0 (2015/03/27) BRと\nを相互に変換する処理を追加
360         * @og.rev 6.2.2.3 (2015/04/10) htmlフィルターに、BR→改行処理機能を追加。
361         *
362         * @param       title   ツールチップに表示するタイトル属性
363         *
364         * @return      ラベルインターフェースの名称(長)
365         * @see #getLongLabel()
366         */
367        @Override       // LabelInterface
368        public String getLongLabel( final String title ) {
369                final String tipsLabel ;
370                if( title == null ) {
371                        tipsLabel = longLabel;
372                }
373                else {
374                        tipsLabel = "<span title=\""
375                                                        + StringUtil.htmlFilter( title,true )   // 6.2.2.3 (2015/04/10)
376                                                        + "\">"
377                                                        + label
378                                                        + "</span>" ;
379                }
380                return tipsLabel ;
381        }
382
383        /**
384         * ラベルオブジェクトの概要説明を返します。
385         * 概要説明が存在する場合は、ラベルのツールチップに
386         * 概要説明が表示されます。
387         *
388         * @return      ラベルオブジェクトの概要説明
389         */
390        @Override       // LabelInterface
391        public String getDescription() { return description; }
392
393        /**
394         * ラベルオブジェクトの概要説明を返します。
395         * このメソッドでは{0},{1}...をパラメータで置換します。
396         *
397         * @og.rev 4.3.7.6 (2009/07/15) 新規作成
398         * @og.rev 4.3.8.0 (2009/08/01) 引数にHTMLサニタイジング処理
399         * @og.rev 5.0.0.2 (2009/09/15) サニタイジング処理をやめる
400         * @og.rev 5.4.0.1 (2011/11/01) {}が存在しない場合は単に概要を出力
401         * @og.rev 6.4.7.0 (2016/06/03) IllegalArgumentException が発生した場合に、見えるようにする。
402         * @og.rev 7.0.7.0 (2019/12/13) #getMessage(String...) , #getDescription(String...) , #getShortMessage(String...) を統合します。
403         *
404         * @param       vals    メッセージ引数の文字列配列(可変長引数)
405         *
406         * @return      ラベルオブジェクトの概要説明
407         */
408        @Override       // LabelInterface
409        public String getDescription( final String... vals ) {          // 6.1.1.0 (2015/01/17) 可変長引数でもnullは来る。
410                return getMessage( description,vals );
411
412//              final String rtn ;
413//
414//              // 6.1.1.0 (2015/01/17) 可変長引数でもnullは来る。
415//              final String[] args = ( vals == null ) ? new String[0] : vals ;
416//              if( isFormatDesc ) {
417//                      // 6.4.7.0 (2016/06/03) IllegalArgumentException が発生した場合に、見えるようにする。
418//                      try {
419//                              rtn = MessageFormat.format( description,(Object[])args );
420//                      }
421//                      catch( final IllegalArgumentException ex ) {
422//                              final String errMsg = "MessageFormatエラー:"
423//                                                      + " Key [" + key + "]"
424//                                                      + " Pattern [" + description + "]"
425//                                                      + " Arguments [" + Arrays.toString( (Object[])args ) + "]" ;
426//                              throw new HybsSystemException( errMsg,ex );
427//                      }
428//              }
429//              else {
430//                      // 5.4.0.1 (2011/11/01) {}が存在しない場合は単に概要を出力 ・・・ なら、直接セットに変更
431//                      rtn = description;
432//              }
433//              return rtn ;
434        }
435
436        /**
437         * リソースDBから作成されたかどうかを返します。
438         * 正式な場合は、true / リソースになく、独自に作成された場合は、false になります。
439         *
440         * @return      リソースDBから作成されたかどうか
441         */
442        @Override       // LabelInterface
443        public boolean isOfficial() { return official; }
444
445        /**
446         * ラベルオブジェクトの名称(長)をそのままの形で返します。
447         * (discription等を付けない)
448         *
449         * @og.rev 5.6.8.2 (2009/08/01) 追加
450         *
451         * @return      ラベルオブジェクトの名称(長)そのままの状態
452         * @og.rtnNotNull
453         */
454        public String getRawLongLabel() { return rawLongLabel; }
455
456        /**
457         * ラベルオブジェクトの名称(短)をspanタグを付けない状態で返します。
458         * SNAMEが未設定の場合は、LNAME が返されます。
459         *
460         * @og.rev 4.3.8.0 (2009/08/01) 追加
461         * @og.rev 7.2.9.0 (2020/10/12) rawShortLabelは、DB検索未設定の場合は、nullなので、初期値指定を行う。
462         *
463         * @return      ラベルオブジェクトの名称(短)にspanタグを付けない状態
464         * @og.rtnNotNull
465         */
466        public String getRawShortLabel() {
467//              return rawShortLabel;
468                return getRawShortLabel( label );               // 7.2.9.0 (2020/10/12)
469        }
470
471        /**
472         * ラベルオブジェクトの名称(短)をspanタグを付けない状態で返します。
473         * SNAMEが未設定の場合は、LNAME が返されます。
474         *
475         * @og.rev 7.2.9.0 (2020/10/12) rawShortLabelは、DB検索未設定の場合は、nullなので、初期値指定を行う。
476         *
477         * @param       defVal  名称(短)がnullの場合の初期値
478         *
479         * @return      ラベルオブジェクトの名称(短)にspanタグを付けない状態
480         */
481        public String getRawShortLabel( final String defVal ) {
482                return rawShortLabel == null ? defVal : rawShortLabel ;
483        }
484
485        /**
486         * オブジェクトの識別子として、詳細なユーザー情報を返します。
487         *
488         * @return  詳細なユーザー情報
489         * @og.rtnNotNull
490         */
491        @Override       // Object
492        public String toString() {
493                final StringBuilder rtn = new StringBuilder( BUFFER_MIDDLE )
494                        .append( "CLM :" ).append( key )
495                        .append( " SNAME :" ).append( shortLabel )
496                        .append( " LNAME :" ).append( longLabel )
497                        .append( " DESCRIPTION :" ).append( description ).append( CR );
498                return rtn.toString();
499        }
500}