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 org.opengion.fukurou.util.StringUtil ; 019import org.opengion.hayabusa.common.HybsSystemException; // 6.4.7.0 (2016/06/03) 020 021import static org.opengion.fukurou.system.HybsConst.BUFFER_MIDDLE; // 6.1.0.0 (2014/12/26) refactoring 022import static org.opengion.fukurou.system.HybsConst.CR ; // 6.1.0.0 (2014/12/26) 023 024import java.text.MessageFormat; 025import java.util.Arrays; // 6.4.7.0 (2016/06/03) 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 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 public String getKey() { return key; } 217 218 /** 219 * ラベルオブジェクトの名称を返します。 220 * これは、DB上の LNAME(名称(長))に該当します。 221 * 222 * @return ラベルオブジェクトの名称(長) 223 */ 224 public String getLabel() { return label; } 225 226 /** 227 * ラベルオブジェクトの名称(短)を返します。 228 * 概要説明がない場合でかつDB上のSNAMEが未設定の場合は、 229 * LNAME が返されます。SNAMEが設定されている場合は、 230 * ツールチップにLNAME が表示されます。 231 * 概要説明が存在する場合は、ツールチップに概要説明が 232 * 表示されます。 233 * 234 * @return ラベルオブジェクトの名称(短) 235 */ 236 public String getShortLabel() { return shortLabel; } 237 238 /** 239 * ラベルオブジェクトの名称(長)を返します。 240 * 概要説明が存在する場合は、ツールチップに概要説明が 241 * 表示されます。 242 * 243 * @return ラベルオブジェクトの名称(長) 244 * @see #getLongLabel( String ) 245 */ 246 public String getLongLabel() { return longLabel; } 247 248 /** 249 * ラベルインターフェースの名称(長)を返します。 250 * ツールチップに表示するタイトル属性(概要説明)を置き換えます。 251 * null の場合は、既存のgetLongLabel()を返します。 252 * 253 * @og.rev 6.2.2.0 (2015/03/27) BRと\nを相互に変換する処理を追加 254 * @og.rev 6.2.2.3 (2015/04/10) htmlフィルターに、BR→改行処理機能を追加。 255 * 256 * @param title ツールチップに表示するタイトル属性 257 * 258 * @return ラベルインターフェースの名称(長) 259 * @see #getLongLabel() 260 */ 261 public String getLongLabel( final String title ) { 262 final String tipsLabel ; 263 if( title == null ) { 264 tipsLabel = longLabel; 265 } 266 else { 267 tipsLabel = "<span title=\"" 268 + StringUtil.htmlFilter( title,true ) // 6.2.2.3 (2015/04/10) 269 + "\">" 270 + label 271 + "</span>" ; 272 } 273 return tipsLabel ; 274 } 275 276 /** 277 * ラベルインターフェースの引数付きメッセージを返します。 278 * メッセージの引数部分に、文字列配列を適用して、MessageFormat 279 * で変換した結果を返します。(MessageData でのみ有効です。) 280 * 281 * @og.rev 4.0.0.0 (2007/10/17) メッセージリソース統合に伴い、MessageDataより移行 282 * @og.rev 4.3.8.0 (2009/08/01) 引数にHTMLサニタイジング処理 283 * @og.rev 5.0.0.2 (2009/09/15) サニタイジング処理をやめる 284 * @og.rev 6.4.3.4 (2016/03/11) ラベル {n} が存在しない場合は、引数を連結せず、元のラベルを返す。 285 * @og.rev 6.4.5.0 (2016/04/08) リソースから作成された場合は、引数を連結せず、そうでない場合は連結します。 286 * @og.rev 6.4.7.0 (2016/06/03) IllegalArgumentException が発生した場合に、見えるようにする。 287 * @og.rev 7.0.7.0 (2019/12/13) #getMessage(String...) , #getDescription(String...) , #getShortMessage(String...) を統合します。 288 * @og.rev 7.1.0.1 (2020/02/07) isFormat、isFormatDescは、長,短,概要などあるため、直前にチェックするので廃止。 289 * 290 * @param lbl メッセージを作成する元となるラベル文字列 291 * @param vals メッセージ引数の文字列配列(可変長引数) 292 * 293 * @return ラベルインターフェースの引数付きメッセージ 294 */ 295// public String getMessage( final String... vals ) { // 6.1.1.0 (2015/01/17) 可変長引数でもnullは来る。 296 private String getMessage( final String lbl , final String[] vals ) { 297 final String rtn ; 298 299 final String[] args = ( vals == null ) ? new String[0] : vals ; 300 final boolean isFormat = lbl != null && lbl.indexOf( '{' ) >= 0 ; // 7.1.0.1 (2020/02/07) 301 if( isFormat ) { 302 // 6.4.7.0 (2016/06/03) IllegalArgumentException が発生した場合に、見えるようにする。 303 try { 304// rtn = MessageFormat.format( label,(Object[])args ); 305 rtn = MessageFormat.format( lbl,(Object[])args ); 306 } 307 catch( final IllegalArgumentException ex ) { 308 final String errMsg = "MessageFormatエラー:" 309 + " Key [" + key + "]" 310// + " Pattern [" + label + "]" 311 + " Pattern [" + lbl + "]" 312 + " Arguments [" + Arrays.toString( (Object[])args ) + "]" ; 313 throw new HybsSystemException( errMsg,ex ); 314 } 315 } 316 else { 317 // 6.4.5.0 (2016/04/08) リソースから作成された場合は、引数を連結せず、そうでない場合は連結します。 318 if( official ) { 319// rtn = label ; // 6.4.3.4 (2016/03/11) 320 rtn = lbl ; // 6.4.3.4 (2016/03/11) 321 } 322 else { 323 final StringBuilder buf = new StringBuilder( BUFFER_MIDDLE ) 324// .append( label ); 325 .append( lbl ); 326 for( final String val : args ) { 327// if( val != null && ! val.equals( label ) ) { 328 if( val != null && ! val.equals( lbl ) ) { 329 buf.append( ' ' ).append( val ); // 6.0.2.5 (2014/10/31) char を append する。 330 } 331 } 332 rtn = buf.toString(); 333 } 334 } 335 return rtn ; 336 } 337 338 /** 339 * ラベルインターフェースの引数付きメッセージを返します。 340 * メッセージの引数部分に、文字列配列を適用して、MessageFormat 341 * で変換した結果を返します。(MessageData でのみ有効です。) 342 * 343 * @og.rev 4.0.0.0 (2007/10/17) メッセージリソース統合に伴い、MessageDataより移行 344 * @og.rev 4.3.8.0 (2009/08/01) 引数にHTMLサニタイジング処理 345 * @og.rev 5.0.0.2 (2009/09/15) サニタイジング処理をやめる 346 * @og.rev 6.4.3.4 (2016/03/11) ラベル {n} が存在しない場合は、引数を連結せず、元のラベルを返す。 347 * @og.rev 6.4.5.0 (2016/04/08) リソースから作成された場合は、引数を連結せず、そうでない場合は連結します。 348 * @og.rev 6.4.7.0 (2016/06/03) IllegalArgumentException が発生した場合に、見えるようにする。 349 * @og.rev 7.0.7.0 (2019/12/13) #getMessage(String...) , #getDescription(String...) , #getShortMessage(String...) を統合します。 350 * 351 * @param vals メッセージ引数の文字列配列(可変長引数) 352 * 353 * @return ラベルインターフェースの引数付きメッセージ 354 */ 355 public String getMessage( final String... vals ) { // 6.1.1.0 (2015/01/17) 可変長引数でもnullは来る。 356 return getMessage( label,vals ); 357 358// final String rtn ; 359// 360// final String[] args = ( vals == null ) ? new String[0] : vals ; 361// if( isFormat ) { 362// // 6.4.7.0 (2016/06/03) IllegalArgumentException が発生した場合に、見えるようにする。 363// try { 364// rtn = MessageFormat.format( label,(Object[])args ); 365// } 366// catch( final IllegalArgumentException ex ) { 367// final String errMsg = "MessageFormatエラー:" 368// + " Key [" + key + "]" 369// + " Pattern [" + label + "]" 370// + " Arguments [" + Arrays.toString( (Object[])args ) + "]" ; 371// throw new HybsSystemException( errMsg,ex ); 372// } 373// } 374// else { 375// // 6.4.5.0 (2016/04/08) リソースから作成された場合は、引数を連結せず、そうでない場合は連結します。 376// if( official ) { 377// rtn = label ; // 6.4.3.4 (2016/03/11) 378// } 379// else { 380// final StringBuilder buf = new StringBuilder( BUFFER_MIDDLE ) 381// .append( label ); 382// for( final String val : args ) { 383// if( val != null && ! val.equals( label ) ) { 384// buf.append( ' ' ).append( val ); // 6.0.2.5 (2014/10/31) char を append する。 385// } 386// } 387// rtn = buf.toString(); 388// } 389// } 390// return rtn ; 391 } 392 393 /** 394 * ラベルオブジェクトの概要説明を返します。 395 * 概要説明が存在する場合は、ラベルのツールチップに 396 * 概要説明が表示されます。 397 * 398 * @return ラベルオブジェクトの概要説明 399 */ 400 public String getDescription() { return description; } 401 402 /** 403 * ラベルオブジェクトの概要説明を返します。 404 * このメソッドでは{0},{1}...をパラメータで置換します。 405 * 406 * @og.rev 4.3.7.6 (2009/07/15) 新規作成 407 * @og.rev 4.3.8.0 (2009/08/01) 引数にHTMLサニタイジング処理 408 * @og.rev 5.0.0.2 (2009/09/15) サニタイジング処理をやめる 409 * @og.rev 5.4.0.1 (2011/11/01) {}が存在しない場合は単に概要を出力 410 * @og.rev 6.4.7.0 (2016/06/03) IllegalArgumentException が発生した場合に、見えるようにする。 411 * @og.rev 7.0.7.0 (2019/12/13) #getMessage(String...) , #getDescription(String...) , #getShortMessage(String...) を統合します。 412 * 413 * @param vals メッセージ引数の文字列配列(可変長引数) 414 * 415 * @return ラベルオブジェクトの概要説明 416 */ 417 public String getDescription( final String... vals ) { // 6.1.1.0 (2015/01/17) 可変長引数でもnullは来る。 418 return getMessage( description,vals ); 419 420// final String rtn ; 421// 422// // 6.1.1.0 (2015/01/17) 可変長引数でもnullは来る。 423// final String[] args = ( vals == null ) ? new String[0] : vals ; 424// if( isFormatDesc ) { 425// // 6.4.7.0 (2016/06/03) IllegalArgumentException が発生した場合に、見えるようにする。 426// try { 427// rtn = MessageFormat.format( description,(Object[])args ); 428// } 429// catch( final IllegalArgumentException ex ) { 430// final String errMsg = "MessageFormatエラー:" 431// + " Key [" + key + "]" 432// + " Pattern [" + description + "]" 433// + " Arguments [" + Arrays.toString( (Object[])args ) + "]" ; 434// throw new HybsSystemException( errMsg,ex ); 435// } 436// } 437// else { 438// // 5.4.0.1 (2011/11/01) {}が存在しない場合は単に概要を出力 ・・・ なら、直接セットに変更 439// rtn = description; 440// } 441// return rtn ; 442 } 443 444 /** 445 * ラベルオブジェクトの名称(未変換短)を返します。 446 * このメソッドでは{0},{1}...をパラメータで置換します。 447 * 448 * @og.rev 7.0.7.0 (2019/12/13) #getMessage(String...) , #getDescription(String...) , #getShortMessage(String...) を統合します。 449 * @og.rev 7.2.9.0 (2020/10/12) rawShortLabelは、DB検索未設定の場合は、nullなので、初期値指定を行う。 450 * 451 * @param vals メッセージ引数の文字列配列(可変長引数) 452 * 453 * @return ラベルインターフェースの名前(短) 454 */ 455 public String getShortMessage( final String... vals ) { 456 final String slbl = rawShortLabel == null ? label : rawShortLabel ; // 7.2.9.0 (2020/10/12) 457// return getMessage( rawShortLabel,vals ); 458 return getMessage( slbl,vals ); 459 } 460 461 /** 462 * リソースDBから作成されたかどうかを返します。 463 * 正式な場合は、true / リソースになく、独自に作成された場合は、false になります。 464 * 465 * @return リソースDBから作成されたかどうか 466 */ 467 public boolean isOfficial() { return official; } 468 469 /** 470 * ラベルオブジェクトの名称(長)をそのままの形で返します。 471 * (discription等を付けない) 472 * 473 * @og.rev 5.6.8.2 (2009/08/01) 追加 474 * 475 * @return ラベルオブジェクトの名称(長)そのままの状態 476 * @og.rtnNotNull 477 */ 478 public String getRawLongLabel() { return rawLongLabel; } 479 480 /** 481 * ラベルオブジェクトの名称(短)をspanタグを付けない状態で返します。 482 * SNAMEが未設定の場合は、LNAME が返されます。 483 * 484 * @og.rev 4.3.8.0 (2009/08/01) 追加 485 * @og.rev 7.2.9.0 (2020/10/12) rawShortLabelは、DB検索未設定の場合は、nullなので、初期値指定を行う。 486 * 487 * @return ラベルオブジェクトの名称(短)にspanタグを付けない状態 488 * @og.rtnNotNull 489 */ 490 public String getRawShortLabel() { 491// return rawShortLabel; 492 return getRawShortLabel( label ); // 7.2.9.0 (2020/10/12) 493 } 494 495 /** 496 * ラベルオブジェクトの名称(短)をspanタグを付けない状態で返します。 497 * SNAMEが未設定の場合は、LNAME が返されます。 498 * 499 * @og.rev 7.2.9.0 (2020/10/12) rawShortLabelは、DB検索未設定の場合は、nullなので、初期値指定を行う。 500 * 501 * @param defVal 名称(短)がnullの場合の初期値 502 * 503 * @return ラベルオブジェクトの名称(短)にspanタグを付けない状態 504 */ 505 public String getRawShortLabel( final String defVal ) { 506 return rawShortLabel == null ? defVal : rawShortLabel ; 507 } 508 509 /** 510 * オブジェクトの識別子として,詳細なユーザー情報を返します。 511 * 512 * @return 詳細なユーザー情報 513 * @og.rtnNotNull 514 */ 515 @Override 516 public String toString() { 517 final StringBuilder rtn = new StringBuilder( BUFFER_MIDDLE ) 518 .append( "CLM :" ).append( key ) 519 .append( " SNAME :" ).append( shortLabel ) 520 .append( " LNAME :" ).append( longLabel ) 521 .append( " DESCRIPTION :" ).append( description ).append( CR ); 522 return rtn.toString(); 523 } 524}