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.html;
017    
018    import 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     */
038    public 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    }