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.html; 017 018import org.opengion.hayabusa.common.HybsSystem; 019 020/** 021 * VViewForm オブジェクトを取得する為に使用する,ファクトリクラスです。 022 * 023 * ViewForm オブジェクト の識別ID を元に、ViewFormFactory.newInstance( String id ) 024 * メソッドで,ViewForm オブジェクトを取得します。 025 * ViewFormFactory.close( ViewForm viewForm ) メソッドで,内部的に ViewFormFactory に 026 * オブジェクトを戻す事によって,ViewForm オブジェクトのプーリングを行なっています。 027 * 028 * 実装とマッピングの関係から,識別ID は、ViewFormFactory で static 定義します 029 * 大前提として、ユーザー共通で使用することを考えており,ユーザー個別にプール 030 * する必要があるならば, HttpSession オブジェクトに登録すべきです。 031 * 032 * @og.group 画面表示 033 * 034 * @version 4.0 035 * @author Kazuhiko Hasegawa 036 * @since JDK5.0, 037 */ 038public final class ViewFormFactory { 039 /** newInstance() 時のデフォルトクラス {@value} */ 040 public static final String DEFAULT = "HTMLTable" ; 041 042 /** 043 * デフォルトコンストラクターをprivateにして、 044 * オブジェクトの生成をさせないようにする。 045 * 046 */ 047 private ViewFormFactory() { 048 } 049 050 /** 051 * ViewForm オブジェクトを取得します。 052 * 遅い初期化を行なう事により,実際に必要となるまで ViewForm オブジェクトは 053 * 作成しません。 054 * 055 * @og.rev 3.5.4.2 (2003/12/15) ViewForm のサブクラス名変更。 056 * @og.rev 3.5.6.0 (2004/06/18) 各種プラグイン関連付け設定を、システムパラメータ に記述します。 057 * @og.rev 3.5.6.2 (2004/07/05) setID メソッド名がまぎらわしい為、変更します。 058 * @og.rev 4.0.0.0 (2005/01/31) キーの指定を、ViewForm. から、ViewForm_ に変更します。 059 * 060 * @param id 接続先ID 061 * 062 * @return ViewFormオブジェクト 063 */ 064 public static ViewForm newInstance( final String id ) { 065 String type = ( id == null ) ? DEFAULT : id ; 066 String cls = HybsSystem.sys( "ViewForm_" + type ) ; // 4.0.0 (2005/01/31) 067 ViewForm vf = (ViewForm)HybsSystem.newInstance( cls ); // 3.5.5.3 (2004/04/09) 068 vf.setId( type ); // 3.5.6.2 (2004/07/05) 069 070 return vf; 071 } 072}