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.develop;
017
018 import java.util.Map;
019 import java.util.List;
020
021 import org.opengion.fukurou.util.StringUtil;
022 import org.opengion.fukurou.xml.JspParserFilter;
023
024 /**
025 * コンストラクタに引数で与えられたã?スタãƒ??タæƒ??をå?に、特定ã?JSPタグæƒ??を生成する基底クラスã€?
026 * マスタãƒ??タæƒ??はGF92のNMSYORIカラãƒ??種別毎にJspConvertEntityオブジェクトに事前に準備するå¿?¦�があるã€?
027 *
028 * ä¾?
029 * JspConvertEntity e = new JspConvertEntity("RESULT");
030 * e.setTableName("GF92");
031 * e.setColumnName("NMSYORI");
032 *
033 *
034 * 継承先ã?クラスのexecuteメソãƒ?ƒ‰では、引数のマスタãƒ??タæƒ??からJSPタグのæ–?—å?を生成するå?ç�?‚’実è£?�—ますã?
035 *
036 * @author Takeshi.Takada
037 *
038 */
039 public final class JspCreateFactory {
040
041 /** 作æ?するクラスのベã?スとなる文字å? {@value} */
042 private static final String CLS_BASE = "org.opengion.plugin.develop.JspCreate_" ;
043
044 /**
045 * プライベã?ãƒ?ãƒ?ƒ•ォルトコンストラクタ
046 *
047 * こã?クラスはファクトリクラスであり、インスタンスの作æ?を禁止しますã?
048 */
049 private JspCreateFactory() {}
050
051 /**
052 * コンストラクタ(メイン)
053 *
054 * 引数のキーæ–?—å?を使用して、新しい JspParserFilter オブジェクトを作æ?しますã?
055 * 基準文字å?はã€?org.opengion.plugin.develop.JspCreate_" ですã?
056 *
057 * @param key JspCreate_****の****部åˆ?
058 * @param master マスタãƒ??タæƒ??のMap
059 *
060 * @return 新しく作æ?されたJspParserFilter
061 */
062 public static JspParserFilter newInstance( final String key , final Map<String,List<JspConvertEntity>> master ) {
063
064 AbstractJspCreate jspGen = (AbstractJspCreate)StringUtil.newInstance( CLS_BASE + key );
065
066 jspGen.init( master );
067
068 return jspGen ;
069 }
070 }