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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? beanutilsbean.java

?? 這是一個有關common beanutils 的源碼
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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 org.apache.commons.beanutils;


import java.beans.IndexedPropertyDescriptor;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Array;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import org.apache.commons.beanutils.expression.Resolver;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;


/**
 * <p>JavaBean property population methods.</p>
 *
 * <p>This class provides implementations for the utility methods in
 * {@link BeanUtils}.
 * Different instances can be used to isolate caches between classloaders
 * and to vary the value converters registered.</p>
 *
 * @author Craig R. McClanahan
 * @author Ralph Schaer
 * @author Chris Audley
 * @author Rey Francois
 * @author Gregor Rayman
 * @version $Revision: 687117 $ $Date: 2008-08-19 19:19:36 +0100 (Tue, 19 Aug 2008) $
 * @see BeanUtils
 * @since 1.7
 */

public class BeanUtilsBean {


    // ------------------------------------------------------ Private Class Variables

    /** 
     * Contains <code>BeanUtilsBean</code> instances indexed by context classloader.
     */
    private static final ContextClassLoaderLocal 
            BEANS_BY_CLASSLOADER = new ContextClassLoaderLocal() {
                        // Creates the default instance used when the context classloader is unavailable
                        protected Object initialValue() {
                            return new BeanUtilsBean();
                        }
                    };
    
    /** 
     * Gets the instance which provides the functionality for {@link BeanUtils}.
     * This is a pseudo-singleton - an single instance is provided per (thread) context classloader.
     * This mechanism provides isolation for web apps deployed in the same container.
     *
     * @return The (pseudo-singleton) BeanUtils bean instance
     */
    public static BeanUtilsBean getInstance() {
        return (BeanUtilsBean) BEANS_BY_CLASSLOADER.get();
    }

    /** 
     * Sets the instance which provides the functionality for {@link BeanUtils}.
     * This is a pseudo-singleton - an single instance is provided per (thread) context classloader.
     * This mechanism provides isolation for web apps deployed in the same container.
     * 
     * @param newInstance The (pseudo-singleton) BeanUtils bean instance
     */
    public static void setInstance(BeanUtilsBean newInstance) {
        BEANS_BY_CLASSLOADER.set(newInstance);
    }

    // --------------------------------------------------------- Attributes

    /**
     * Logging for this instance
     */
    private Log log = LogFactory.getLog(BeanUtils.class);
    
    /** Used to perform conversions between object types when setting properties */
    private ConvertUtilsBean convertUtilsBean;
    
    /** Used to access properties*/
    private PropertyUtilsBean propertyUtilsBean;

    /** A reference to Throwable's initCause method, or null if it's not there in this JVM */
    private static final Method INIT_CAUSE_METHOD = getInitCauseMethod();

    // --------------------------------------------------------- Constuctors

    /** 
     * <p>Constructs an instance using new property 
     * and conversion instances.</p>
     */
    public BeanUtilsBean() {
        this(new ConvertUtilsBean(), new PropertyUtilsBean());
    }

    /** 
     * <p>Constructs an instance using given conversion instances
     * and new {@link PropertyUtilsBean} instance.</p>
     *
     * @param convertUtilsBean use this <code>ConvertUtilsBean</code> 
     * to perform conversions from one object to another
     *
     * @since 1.8.0
     */
    public BeanUtilsBean(ConvertUtilsBean convertUtilsBean) {
        this(convertUtilsBean, new PropertyUtilsBean());
    }

    /** 
     * <p>Constructs an instance using given property and conversion instances.</p>
     *
     * @param convertUtilsBean use this <code>ConvertUtilsBean</code> 
     * to perform conversions from one object to another
     * @param propertyUtilsBean use this <code>PropertyUtilsBean</code>
     * to access properties
     */
    public BeanUtilsBean(
                            ConvertUtilsBean convertUtilsBean, 
                            PropertyUtilsBean propertyUtilsBean) {
                            
        this.convertUtilsBean = convertUtilsBean;
        this.propertyUtilsBean = propertyUtilsBean;
    }

    // --------------------------------------------------------- Public Methods

    /**
     * <p>Clone a bean based on the available property getters and setters,
     * even if the bean class itself does not implement Cloneable.</p>
     *
     * <p>
     * <strong>Note:</strong> this method creates a <strong>shallow</strong> clone.
     * In other words, any objects referred to by the bean are shared with the clone
     * rather than being cloned in turn.
     * </p>
     *
     * @param bean Bean to be cloned
     * @return the cloned bean
     *
     * @exception IllegalAccessException if the caller does not have
     *  access to the property accessor method
     * @exception InstantiationException if a new instance of the bean's
     *  class cannot be instantiated
     * @exception InvocationTargetException if the property accessor method
     *  throws an exception
     * @exception NoSuchMethodException if an accessor method for this
     *  property cannot be found
     */
    public Object cloneBean(Object bean)
            throws IllegalAccessException, InstantiationException,
            InvocationTargetException, NoSuchMethodException {

        if (log.isDebugEnabled()) {
            log.debug("Cloning bean: " + bean.getClass().getName());
        }
        Object newBean = null;
        if (bean instanceof DynaBean) {
            newBean = ((DynaBean) bean).getDynaClass().newInstance();
        } else {
            newBean = bean.getClass().newInstance();
        }
        getPropertyUtils().copyProperties(newBean, bean);
        return (newBean);

    }


    /**
     * <p>Copy property values from the origin bean to the destination bean
     * for all cases where the property names are the same.  For each
     * property, a conversion is attempted as necessary.  All combinations of
     * standard JavaBeans and DynaBeans as origin and destination are
     * supported.  Properties that exist in the origin bean, but do not exist
     * in the destination bean (or are read-only in the destination bean) are
     * silently ignored.</p>
     *
     * <p>If the origin "bean" is actually a <code>Map</code>, it is assumed
     * to contain String-valued <strong>simple</strong> property names as the keys, pointing at
     * the corresponding property values that will be converted (if necessary)
     * and set in the destination bean. <strong>Note</strong> that this method
     * is intended to perform a "shallow copy" of the properties and so complex
     * properties (for example, nested ones) will not be copied.</p>
     *
     * <p>This method differs from <code>populate()</code>, which
     * was primarily designed for populating JavaBeans from the map of request
     * parameters retrieved on an HTTP request, is that no scalar->indexed
     * or indexed->scalar manipulations are performed.  If the origin property
     * is indexed, the destination property must be also.</p>
     *
     * <p>If you know that no type conversions are required, the
     * <code>copyProperties()</code> method in {@link PropertyUtils} will
     * execute faster than this method.</p>
     *
     * <p><strong>FIXME</strong> - Indexed and mapped properties that do not
     * have getter and setter methods for the underlying array or Map are not
     * copied by this method.</p>
     *
     * @param dest Destination bean whose properties are modified
     * @param orig Origin bean whose properties are retrieved
     *
     * @exception IllegalAccessException if the caller does not have
     *  access to the property accessor method
     * @exception IllegalArgumentException if the <code>dest</code> or
     *  <code>orig</code> argument is null or if the <code>dest</code> 
     *  property type is different from the source type and the relevant
     *  converter has not been registered.
     * @exception InvocationTargetException if the property accessor method
     *  throws an exception
     */
    public void copyProperties(Object dest, Object orig)
        throws IllegalAccessException, InvocationTargetException {

        // Validate existence of the specified beans
        if (dest == null) {
            throw new IllegalArgumentException
                    ("No destination bean specified");
        }
        if (orig == null) {
            throw new IllegalArgumentException("No origin bean specified");
        }
        if (log.isDebugEnabled()) {
            log.debug("BeanUtils.copyProperties(" + dest + ", " +
                      orig + ")");
        }

        // Copy the properties, converting as necessary
        if (orig instanceof DynaBean) {
            DynaProperty[] origDescriptors =
                ((DynaBean) orig).getDynaClass().getDynaProperties();
            for (int i = 0; i < origDescriptors.length; i++) {
                String name = origDescriptors[i].getName();
                // Need to check isReadable() for WrapDynaBean
                // (see Jira issue# BEANUTILS-61)
                if (getPropertyUtils().isReadable(orig, name) &&
                    getPropertyUtils().isWriteable(dest, name)) {
                    Object value = ((DynaBean) orig).get(name);
                    copyProperty(dest, name, value);
                }
            }
        } else if (orig instanceof Map) {
            Iterator entries = ((Map) orig).entrySet().iterator();
            while (entries.hasNext()) {
                Map.Entry entry = (Map.Entry) entries.next();
                String name = (String)entry.getKey();
                if (getPropertyUtils().isWriteable(dest, name)) {
                    copyProperty(dest, name, entry.getValue());
                }
            }
        } else /* if (orig is a standard JavaBean) */ {
            PropertyDescriptor[] origDescriptors =
                getPropertyUtils().getPropertyDescriptors(orig);
            for (int i = 0; i < origDescriptors.length; i++) {
                String name = origDescriptors[i].getName();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕一区二区三区蜜月| 99久久99久久精品国产片果冻| 国产日产欧美一区二区三区| 欧美日韩国产另类不卡| 99久久亚洲一区二区三区青草| 国产一区二三区| 久久99国产乱子伦精品免费| 日韩主播视频在线| 亚洲高清免费在线| 中文字幕制服丝袜成人av| 日韩免费视频一区二区| 精品视频在线视频| 欧美日韩激情在线| 911精品国产一区二区在线| 99精品视频在线播放观看| 99久久99精品久久久久久| 不卡免费追剧大全电视剧网站| 国产麻豆91精品| 成人在线综合网| 99久久99久久精品免费看蜜桃| jiyouzz国产精品久久| 97精品超碰一区二区三区| 色中色一区二区| 欧美精品在线观看播放| 欧美日韩一卡二卡| 欧美精品久久天天躁| 久久婷婷久久一区二区三区| 国产偷国产偷亚洲高清人白洁 | 欧美一卡二卡在线| 久久久99久久精品欧美| 亚洲激情图片一区| 久久精工是国产品牌吗| 成人免费视频一区二区| 欧美午夜一区二区| 日本一区二区三区国色天香 | 亚洲欧美视频在线观看视频| 一区二区三区在线免费播放| 蜜桃一区二区三区在线| 99精品视频在线播放观看| 欧美一区二区三区的| 国产精品国产自产拍高清av| 奇米影视一区二区三区| 91免费小视频| 国产亚洲精品中文字幕| 日韩在线一二三区| 日本乱人伦aⅴ精品| 2023国产精品视频| 五月天精品一区二区三区| 北条麻妃一区二区三区| 欧美一激情一区二区三区| 一区二区三区国产精华| 国产.精品.日韩.另类.中文.在线.播放 | 欧洲视频一区二区| 这里是久久伊人| 国产精品不卡在线观看| 国产性天天综合网| 日本vs亚洲vs韩国一区三区二区 | 美日韩一区二区三区| 国产伦精品一区二区三区视频青涩| 懂色av一区二区在线播放| 日韩美女视频19| 日韩和欧美一区二区三区| 国产福利91精品一区| 911精品国产一区二区在线| 久久久久久免费| 亚洲成人资源在线| 99re热这里只有精品视频| 欧美日韩国产高清一区二区三区 | 亚洲一区二区三区小说| 国产老妇另类xxxxx| 欧美一级黄色片| 一区二区三区**美女毛片| 粉嫩一区二区三区在线看| 在线电影院国产精品| 亚洲精品视频免费观看| 高清在线不卡av| 精品久久久久久久久久久久久久久久久 | 老司机精品视频线观看86| 在线观看一区日韩| 亚洲天堂精品视频| 成人黄色av网站在线| 久久久久久久久久久久久夜| 九九国产精品视频| 欧美一区二区视频在线观看| 一区二区三区欧美日韩| 99国产麻豆精品| 18成人在线观看| 成人一区二区三区| xvideos.蜜桃一区二区| 日本午夜一区二区| 欧美一区二区三区不卡| 日日嗨av一区二区三区四区| 欧美日韩免费一区二区三区| 亚洲免费视频成人| 欧美高清hd18日本| 蜜臀av性久久久久av蜜臀妖精| 欧美熟乱第一页| 日韩成人dvd| 欧美一区二区三区喷汁尤物| 午夜精品久久久久久久蜜桃app| 91福利视频在线| 亚洲午夜日本在线观看| 精品视频在线免费看| 秋霞av亚洲一区二区三| 欧美大胆人体bbbb| 国产一区二区三区国产| 久久天堂av综合合色蜜桃网| 丁香婷婷综合色啪| 亚洲日本在线视频观看| 欧美男生操女生| 韩国在线一区二区| 亚洲三级在线看| 欧美乱熟臀69xxxxxx| 久久99国产乱子伦精品免费| 国产精品你懂的在线| 91久久线看在观草草青青| 香蕉av福利精品导航| 精品久久久久久最新网址| 成a人片亚洲日本久久| 亚洲最新视频在线观看| 日韩欧美一区二区三区在线| 成人一级片在线观看| 一区二区三区 在线观看视频| 日韩女同互慰一区二区| 成人激情午夜影院| 奇米777欧美一区二区| 精品88久久久久88久久久| 色综合久久综合网| 国产酒店精品激情| 亚洲少妇30p| 久久久久久久国产精品影院| 在线观看www91| 国产成人av福利| 亚洲成人av电影| 国产精品灌醉下药二区| 日韩欧美亚洲另类制服综合在线| 成人h版在线观看| 日本欧美在线看| 亚洲乱码精品一二三四区日韩在线| 欧美一级二级三级蜜桃| 色综合一个色综合亚洲| 国产乱码一区二区三区| 天堂蜜桃一区二区三区| 亚洲人123区| 国产精品全国免费观看高清 | 欧美aa在线视频| 一区二区三区在线高清| 国产三级精品视频| 91精品午夜视频| 欧美日韩亚州综合| 波多野洁衣一区| 国产福利一区二区| 国产在线视视频有精品| 婷婷成人激情在线网| 亚洲精品国产第一综合99久久| 久久久久久久久久久电影| 91.com在线观看| 欧美日韩日日骚| 欧美综合亚洲图片综合区| 99精品国产热久久91蜜凸| 国产精品91xxx| 蜜臀久久99精品久久久久宅男| 亚洲精品午夜久久久| 自拍视频在线观看一区二区| 久久精品欧美日韩精品| 精品国产三级电影在线观看| 91精品在线一区二区| 欧美日韩国产综合久久| 欧美日韩久久一区| 欧美人伦禁忌dvd放荡欲情| 95精品视频在线| 91丨porny丨首页| 91蝌蚪porny| 欧美日韩国产成人在线免费| 色8久久精品久久久久久蜜| 91黄色免费网站| 欧美高清一级片在线| 日韩欧美二区三区| 久久久亚洲精品一区二区三区| 欧美国产综合色视频| 中文字幕欧美日韩一区| 国产精品美女www爽爽爽| 亚洲免费观看高清完整版在线观看熊| 亚洲欧洲国产日韩| 亚洲一级不卡视频| 天天综合色天天综合| 免费在线观看一区| 成人一区二区三区视频在线观看 | 欧美v日韩v国产v| 2020日本不卡一区二区视频| 国产亚洲精品福利| 一区二区三区高清| 日本欧美一区二区三区乱码| 久久er精品视频| 风间由美一区二区三区在线观看| 91美女在线视频| 日韩一级黄色大片| 国产精品美女久久久久久2018| 亚洲天堂精品视频| 日本中文字幕一区|