亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? resultobjectfactoryutil.java

?? 本套系統(tǒng)采用了業(yè)界當(dāng)前最為流行的beanAction組件
?? JAVA
字號:
/*
 *  Copyright 2006 The Apache Software Foundation
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.ibatis.sqlmap.engine.mapping.result;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import com.ibatis.common.resources.Resources;

/**
 * This class is used to create instances of result objects.  It will
 * use the configured ResultObjectFactory if there is one, otherwise
 * it will use iBATIS' normal methods.
 * 
 * Note that this class is somewhat tightly coupled with
 * SqlExecuter - SqlExecute must call the setStatementId() and
 * setResultObjectFactory() methods before executing a statement.
 * This is a result of using a ThreadLocal to hold the current
 * configuration for the statement under execution.  Using a
 * ThreadLocal is a solution for IBATIS-366.  Without a ThreadLocal,
 * the current factory and statement id would have to be added to 
 * many method signatures - often in inappropriate places.
 * 
 * @author Jeff Butler
 */
public class ResultObjectFactoryUtil {
  
  /**
   * Use a ThreadLocal to hold the current statementId and
   * factory.  This is much easier than passing these
   * items all over the place, and it has no measurable impact on
   * performance (I did a test with 100000 result rows and found
   * no impact - Jeff Butler).
   */
  private static ThreadLocal factorySettings = new ThreadLocal();
  
  /**
   * Utility class - no instances
   */
  private ResultObjectFactoryUtil() {
    super();
  }

  /**
   * Algorithm:
   * 
   * <ul>
   *   <li>If factory is null, then create object internally()</li>
   *   <li>Otherwise try to create object through factory</li>
   *   <li>If null returned from factory, then create object internally</li>
   * </ul>
   * 
   * This allows the factory to selectively create objects, also allows for
   * the common possibility that a factory is not configured.
   * 
   * @param factory
   *          the factory to use. May be null!
   * @param statementId
   *          the ID of the statement that generated the call to this method
   * @param clazz
   *          the type of object to create
   * @return a new instance of the specified class.  The instance must
   *   be castable to the specified class.
   * @throws InstantiationException
   *           if the instance cannot be created. If you throw this Exception,
   *           iBATIS will throw a runtime exception in response and will end.
   * @throws IllegalAccessException
   *           if the constructor cannot be accessed. If you throw this
   *           Exception, iBATIS will throw a runtime exception in response and
   *           will end.
   */
  public static Object createObjectThroughFactory(Class clazz) throws InstantiationException,
      IllegalAccessException {
    
    FactorySettings fs = getFactorySettings();
    
    Object obj;
    if (fs.getResultObjectFactory() == null) {
      obj = createObjectInternally(clazz);
    } else {
      obj = fs.getResultObjectFactory().createInstance(fs.getStatementId(), clazz);
      if (obj == null) {
        obj = createObjectInternally(clazz);
      }
    }
    
    return obj;
  }

  /**
   * This method creates object using iBATIS' normal mechanism.  We
   * translate List and Collection to ArrayList, and Set to HashSet
   * because these interfaces may be requested in nested resultMaps
   * and we want to supply default implementations.
   * 
   * @param clazz
   * @return
   * @throws InstantiationException
   * @throws IllegalAccessException
   */
  private static Object createObjectInternally(Class clazz) throws InstantiationException, IllegalAccessException {
    Class classToCreate;
    if (clazz == List.class || clazz == Collection.class) {
      classToCreate = ArrayList.class;
    } else if (clazz == Set.class) {
      classToCreate = HashSet.class;
    } else {
      classToCreate = clazz;
    }
    
    Object obj = Resources.instantiate(classToCreate);
    return obj;
  }
  
  public static void setResultObjectFactory(ResultObjectFactory resultObjectFactory) {
    getFactorySettings().setResultObjectFactory(resultObjectFactory);
  }
  
  public static void setStatementId(String statementId) {
    getFactorySettings().setStatementId(statementId);
  }
  
  private static FactorySettings getFactorySettings() {
    FactorySettings fs = (FactorySettings) factorySettings.get();
    if (fs == null) {
      fs = new FactorySettings();
      factorySettings.set(fs);
    }
    
    return fs;
  }
  
  private static class FactorySettings {
    private ResultObjectFactory resultObjectFactory;
    private String statementId;
    
    public ResultObjectFactory getResultObjectFactory() {
      return resultObjectFactory;
    }
    
    public void setResultObjectFactory(ResultObjectFactory resultObjectFactory) {
      this.resultObjectFactory = resultObjectFactory;
    }
    
    public String getStatementId() {
      return statementId;
    }
    
    public void setStatementId(String statementId) {
      this.statementId = statementId;
    }
  }
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99re成人精品视频| 日韩国产在线观看| 欧美激情一区二区三区四区| 9191国产精品| 欧美一卡2卡3卡4卡| 日韩一区二区精品在线观看| 欧美男生操女生| 91超碰这里只有精品国产| 欧美日本一道本在线视频| 91精品一区二区三区久久久久久| 欧美嫩在线观看| 日韩视频免费观看高清完整版在线观看| 欧美日本免费一区二区三区| 91精品在线观看入口| 日韩三级精品电影久久久| 精品国产乱码久久久久久闺蜜| 精品国产乱码久久久久久夜甘婷婷 | 成人做爰69片免费看网站| 国产一区二区电影| 99久久er热在这里只有精品15| 91久久精品国产91性色tv| 欧美日韩专区在线| 2020国产成人综合网| 国产精品天天看| 亚洲午夜视频在线| 国产在线视视频有精品| 91在线看国产| 日韩无一区二区| 国产精品视频一二三| 亚洲宅男天堂在线观看无病毒| 日韩中文字幕区一区有砖一区| 久久国产精品区| 色吊一区二区三区| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 亚洲精品国产精品乱码不99 | 精品久久久久久最新网址| 国产欧美日韩卡一| 亚洲一区在线播放| 国产激情视频一区二区三区欧美 | 亚洲电影你懂得| 91精品国产综合久久精品性色| 欧美tickling网站挠脚心| 欧美国产一区视频在线观看| 午夜国产精品一区| 大胆欧美人体老妇| 欧美成人bangbros| 亚洲一区二区三区视频在线| 国产一区二区三区免费观看| 欧美四级电影在线观看| 国产精品视频九色porn| 美女视频黄 久久| 欧美亚洲综合另类| 国产精品福利影院| 国产精品18久久久久久久久| 欧美男生操女生| 一级特黄大欧美久久久| 丁香激情综合国产| 精品国产欧美一区二区| 天堂成人免费av电影一区| 99久久婷婷国产| 国产三区在线成人av| 蜜乳av一区二区三区| 欧美精品xxxxbbbb| 亚洲欧美韩国综合色| 国产成人免费高清| 久久香蕉国产线看观看99| 免费成人美女在线观看| 欧美日韩一区二区三区高清| 亚洲人成7777| 91影院在线免费观看| 国产精品伦理一区二区| 国产成人精品免费| 久久久综合视频| 国产一区久久久| 久久亚洲一区二区三区明星换脸| 奇米色一区二区三区四区| 666欧美在线视频| 午夜一区二区三区视频| 欧美日韩国产综合久久| 婷婷久久综合九色综合伊人色| 欧洲中文字幕精品| 性做久久久久久久免费看| 在线不卡的av| 黄色小说综合网站| 久久精品欧美日韩| 北条麻妃国产九九精品视频| 中文字幕精品在线不卡| 99免费精品在线| 亚洲成人动漫在线观看| 91精品国产91久久综合桃花| 美女精品自拍一二三四| 久久夜色精品国产噜噜av| 不卡一卡二卡三乱码免费网站| 国产精品福利一区二区三区| 精品婷婷伊人一区三区三| 日本欧美一区二区| 精品久久久久久久久久久久久久久 | 国产成人综合网| 国产精品国产三级国产aⅴ无密码| av成人免费在线观看| 午夜久久久影院| 欧美精品一区二区三区在线| 国产另类ts人妖一区二区| 最新国产成人在线观看| 8x8x8国产精品| 国产成人亚洲精品狼色在线| 亚洲激情第一区| 欧美一卡二卡在线| 成人黄色软件下载| 亚洲成av人片在线观看| 精品国产凹凸成av人网站| 成年人国产精品| 另类小说综合欧美亚洲| 日韩伦理电影网| 日韩免费在线观看| 91丝袜呻吟高潮美腿白嫩在线观看| 午夜国产精品一区| 亚洲欧洲日产国码二区| 精品一区二区在线免费观看| aaa欧美大片| 久久久久久久久97黄色工厂| 亚洲综合丝袜美腿| 色拍拍在线精品视频8848| 一区二区三区四区精品在线视频 | 日韩欧美二区三区| 99久久综合狠狠综合久久| 美女mm1313爽爽久久久蜜臀| 亚洲欧美成人一区二区三区| 日韩女优电影在线观看| 欧美影院午夜播放| 91在线精品一区二区| 国产麻豆精品视频| 久久精品免费看| 天天射综合影视| 亚洲综合丁香婷婷六月香| 一区在线观看视频| 欧洲视频一区二区| 在线成人av网站| 久久精品国产77777蜜臀| 亚洲一区中文日韩| 亚洲精品国产一区二区精华液 | 韩国毛片一区二区三区| 亚洲高清一区二区三区| 国产精品福利在线播放| 国产亚洲欧美日韩在线一区| 欧美一级久久久| 在线成人小视频| 欧美亚洲日本国产| 欧美日韩一区二区不卡| 一本色道久久综合亚洲aⅴ蜜桃| 春色校园综合激情亚洲| 国产白丝网站精品污在线入口| 久久成人18免费观看| 日本不卡一区二区三区 | 中文字幕国产一区| 日韩欧美不卡在线观看视频| 99re这里只有精品首页| 精品久久久久久久久久久久包黑料| 99re这里都是精品| 91尤物视频在线观看| 色综合久久中文字幕综合网| 丁香激情综合五月| 91视视频在线观看入口直接观看www | 亚洲视频小说图片| 最新中文字幕一区二区三区| 国产精品进线69影院| 亚洲欧美日韩系列| 亚洲一卡二卡三卡四卡五卡| 一区二区三区美女视频| 亚洲国产一区二区在线播放| 午夜精品久久久久久久久久久| 天堂在线一区二区| 极品少妇xxxx精品少妇偷拍| 成人一区二区三区视频| 91在线免费播放| 欧美精品日日鲁夜夜添| 日韩一区二区三区电影在线观看 | 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 中文字幕一区日韩精品欧美| 亚洲欧美一区二区在线观看| 亚洲一区免费观看| 久久99久久精品欧美| 国产精品91xxx| 色婷婷精品久久二区二区蜜臂av | 久久精品亚洲麻豆av一区二区 | 91蜜桃传媒精品久久久一区二区| 91极品美女在线| 91精选在线观看| 中文字幕一区二区三区在线不卡| 一二三四社区欧美黄| 九九在线精品视频| 欧美日韩国产精品成人| 欧美videos中文字幕| 综合网在线视频| 蜜臀精品久久久久久蜜臀| 丁香婷婷综合激情五月色| 欧美日韩中文字幕精品| 国产精品欧美精品| 日本免费在线视频不卡一不卡二| 国产69精品久久777的优势|