亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
午夜精品免费在线| 不卡av在线网| www.日本不卡| 日韩欧美在线网站| 亚洲国产裸拍裸体视频在线观看乱了| 国产乱码精品一区二区三区忘忧草| 色视频欧美一区二区三区| 久久亚洲捆绑美女| 免费在线观看日韩欧美| 日本精品一级二级| 国产精品色一区二区三区| 精品一区二区三区久久| 8v天堂国产在线一区二区| 亚洲免费av网站| av午夜一区麻豆| 亚洲国产精品ⅴa在线观看| 国内久久精品视频| 精品国产3级a| 国内精品不卡在线| 久久这里只有精品6| 免费在线观看一区二区三区| 欧美日韩一区久久| 亚洲成人午夜电影| 色吊一区二区三区| 一区二区三区在线观看欧美| 岛国av在线一区| 国产亚洲欧美激情| 国产精品 日产精品 欧美精品| 精品99999| 国产成人av电影在线观看| 日韩欧美国产一区二区在线播放| 日本麻豆一区二区三区视频| 4438x成人网最大色成网站| 国内精品国产三级国产a久久| 制服丝袜亚洲精品中文字幕| 午夜久久久久久| 欧美一区欧美二区| 麻豆91免费看| 久久久精品国产免费观看同学| 国产一区 二区| 国产精品免费av| 99久免费精品视频在线观看 | 亚洲男人天堂av网| 色哟哟在线观看一区二区三区| 亚洲激情男女视频| 欧美欧美欧美欧美| 久久99蜜桃精品| 日本一区二区电影| 91国偷自产一区二区三区成为亚洲经典| 樱桃视频在线观看一区| 在线不卡a资源高清| 麻豆免费精品视频| 国产精品护士白丝一区av| 色88888久久久久久影院按摩| 性感美女极品91精品| 久久综合色鬼综合色| 97se亚洲国产综合自在线观| 亚洲电影一区二区三区| 欧美成人三级在线| 成人国产一区二区三区精品| 夜夜精品视频一区二区| 欧美大白屁股肥臀xxxxxx| 高清不卡一二三区| 亚洲国产成人av网| 2017欧美狠狠色| 日本黄色一区二区| 激情图片小说一区| 亚洲制服丝袜在线| 国产日产精品一区| 欧美另类变人与禽xxxxx| 国产精品一区二区在线观看不卡 | 麻豆成人在线观看| 日韩一区在线看| 日韩一区二区三区免费观看 | 国产中文一区二区三区| 亚洲精品美国一| 久久亚洲精精品中文字幕早川悠里| 91网页版在线| 国产一区二区三区电影在线观看| 一区二区三区在线免费播放| 久久青草欧美一区二区三区| 欧美性欧美巨大黑白大战| 国产一区二区导航在线播放| 樱桃视频在线观看一区| 国产亚洲精久久久久久| 欧美欧美午夜aⅴ在线观看| 成人av免费网站| 国产一区二区三区精品欧美日韩一区二区三区 | 美女网站视频久久| 国产一区欧美二区| 香蕉成人啪国产精品视频综合网| 中文字幕 久热精品 视频在线 | 欧美视频在线一区| 成人综合激情网| 久久97超碰色| 日韩电影免费在线观看网站| 一区二区三区国产豹纹内裤在线| 中文字幕欧美激情一区| 久久久美女艺术照精彩视频福利播放 | 日韩精品一区二区三区视频在线观看 | 一区二区在线观看av| 久久久久九九视频| 精品久久一二三区| 欧美一卡在线观看| 91精品国产综合久久精品app| 欧美亚洲精品一区| 日本久久一区二区三区| 99精品黄色片免费大全| 成人免费毛片片v| 菠萝蜜视频在线观看一区| 国产福利不卡视频| 成人a免费在线看| 成人av在线网| 成人午夜激情在线| 国产·精品毛片| 成人丝袜高跟foot| 成人免费电影视频| 99免费精品在线观看| 高清日韩电视剧大全免费| 成人激情动漫在线观看| eeuss鲁一区二区三区| 不卡av免费在线观看| 在线免费观看不卡av| 欧美色网一区二区| 91精品国产欧美一区二区| 制服丝袜亚洲播放| 欧美va日韩va| 国产欧美1区2区3区| 亚洲区小说区图片区qvod| 亚洲国产视频在线| 亚洲香蕉伊在人在线观| 日韩主播视频在线| 国产精品资源在线看| 99re在线视频这里只有精品| 欧美在线播放高清精品| 欧美高清视频不卡网| 欧美精品一区男女天堂| 国产精品久久久久久久久免费樱桃 | 国产精品五月天| 一区二区三区欧美日| 亚洲成在线观看| 国产专区欧美精品| 色综合久久88色综合天天| 884aa四虎影成人精品一区| 国产日韩欧美精品电影三级在线 | 欧美一区二区三区在线观看视频 | 亚洲综合精品自拍| 亚洲18影院在线观看| 国内精品写真在线观看| 一本久道中文字幕精品亚洲嫩| 欧美在线观看视频在线| 欧美成人综合网站| 一区二区三区视频在线看| 精品一区二区在线免费观看| 一本大道综合伊人精品热热 | 欧美另类z0zxhd电影| 国产亚洲精品bt天堂精选| 亚洲成人免费视| 国产成人亚洲综合a∨猫咪| 欧美三级中文字| 日本一区二区综合亚洲| 亚洲成av人在线观看| 成人一级视频在线观看| 日韩欧美一二三| 亚洲成av人综合在线观看| 东方欧美亚洲色图在线| 日韩欧美黄色影院| 一区二区成人在线观看| 国产成人精品午夜视频免费| 91精品麻豆日日躁夜夜躁| 亚洲日本丝袜连裤袜办公室| 国内外精品视频| 欧美一区二区免费观在线| 亚洲精品成人精品456| 国产黑丝在线一区二区三区| 日韩视频免费直播| 亚洲动漫第一页| 在线一区二区三区做爰视频网站| 日本一区免费视频| 国产麻豆一精品一av一免费 | 91激情在线视频| 亚洲欧洲日韩一区二区三区| 激情欧美一区二区| 欧美一卡二卡三卡四卡| 亚洲v日本v欧美v久久精品| 91色九色蝌蚪| 中文字幕日韩一区| 成人激情开心网| 国产精品久久久久一区二区三区共 | 久久欧美中文字幕| 精品一区二区三区香蕉蜜桃 | 日韩精品专区在线| 奇米精品一区二区三区四区| 欧美日韩一区二区三区四区 | 图片区日韩欧美亚洲| 欧日韩精品视频| 亚洲福利一区二区| 欧美日韩国产一级片| 亚洲电影激情视频网站| 欧美日韩精品一区视频|