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

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

?? wrapdynabean.java

?? 這是一個有關common beanutils 的源碼
?? JAVA
字號:
/*
 * 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.io.Serializable;
import java.lang.reflect.InvocationTargetException;


/**
 * <p>Implementation of <code>DynaBean</code> that wraps a standard JavaBean
 * instance, so that DynaBean APIs can be used to access its properties.</p>
 *
 * <p>
 * The most common use cases for this class involve wrapping an existing java bean.
 * (This makes it different from the typical use cases for other <code>DynaBean</code>'s.) 
 * For example:
 * </p>
 * <code><pre>
 *  Object aJavaBean = ...;
 *  ...
 *  DynaBean db = new WrapDynaBean(aJavaBean);
 *  ...
 * </pre></code>
 *
 * <p><strong>IMPLEMENTATION NOTE</strong> - This implementation does not
 * support the <code>contains()</code> and <code>remove()</code> methods.</p>
 *
 * @author Craig McClanahan
 * @version $Revision: 555824 $ $Date: 2007-07-13 01:27:15 +0100 (Fri, 13 Jul 2007) $
 */

public class WrapDynaBean implements DynaBean, Serializable {


    // ---------------------------------------------------------- Constructors


    /**
     * Construct a new <code>DynaBean</code> associated with the specified
     * JavaBean instance.
     *
     * @param instance JavaBean instance to be wrapped
     */
    public WrapDynaBean(Object instance) {

        super();
        this.instance = instance;
        this.dynaClass = (WrapDynaClass)getDynaClass();

    }


    // ---------------------------------------------------- Instance Variables


    /**
     * The <code>DynaClass</code> "base class" that this DynaBean
     * is associated with.
     */
    protected transient WrapDynaClass dynaClass = null;


    /**
     * The JavaBean instance wrapped by this WrapDynaBean.
     */
    protected Object instance = null;


    // ------------------------------------------------------ DynaBean Methods


    /**
     * Does the specified mapped property contain a value for the specified
     * key value?
     *
     * @param name Name of the property to check
     * @param key Name of the key to check
     * @return <code>true<code> if the mapped property contains a value for
     * the specified key, otherwise <code>false</code>
     *
     * @exception IllegalArgumentException if there is no property
     *  of the specified name
     */
    public boolean contains(String name, String key) {

        throw new UnsupportedOperationException
                ("WrapDynaBean does not support contains()");

    }


    /**
     * Return the value of a simple property with the specified name.
     *
     * @param name Name of the property whose value is to be retrieved
     * @return The property's value
     *
     * @exception IllegalArgumentException if there is no property
     *  of the specified name
     */
    public Object get(String name) {

        Object value = null;
        try {
            value = PropertyUtils.getSimpleProperty(instance, name);
        } catch (InvocationTargetException ite) {
            Throwable cause = ite.getTargetException();
            throw new IllegalArgumentException
                    ("Error reading property '" + name +
                              "' nested exception - " + cause);
        } catch (Throwable t) {
            throw new IllegalArgumentException
                    ("Error reading property '" + name +
                              "', exception - " + t);
        }
        return (value);

    }


    /**
     * Return the value of an indexed property with the specified name.
     *
     * @param name Name of the property whose value is to be retrieved
     * @param index Index of the value to be retrieved
     * @return The indexed property's value
     *
     * @exception IllegalArgumentException if there is no property
     *  of the specified name
     * @exception IllegalArgumentException if the specified property
     *  exists, but is not indexed
     * @exception IndexOutOfBoundsException if the specified index
     *  is outside the range of the underlying property
     * @exception NullPointerException if no array or List has been
     *  initialized for this property
     */
    public Object get(String name, int index) {

        Object value = null;
        try {
            value = PropertyUtils.getIndexedProperty(instance, name, index);
        } catch (IndexOutOfBoundsException e) {
            throw e;
        } catch (InvocationTargetException ite) {
            Throwable cause = ite.getTargetException();
            throw new IllegalArgumentException
                    ("Error reading indexed property '" + name +
                              "' nested exception - " + cause);
        } catch (Throwable t) {
            throw new IllegalArgumentException
                    ("Error reading indexed property '" + name +
                              "', exception - " + t);
        }
        return (value);

    }


    /**
     * Return the value of a mapped property with the specified name,
     * or <code>null</code> if there is no value for the specified key.
     *
     * @param name Name of the property whose value is to be retrieved
     * @param key Key of the value to be retrieved
     * @return The mapped property's value
     *
     * @exception IllegalArgumentException if there is no property
     *  of the specified name
     * @exception IllegalArgumentException if the specified property
     *  exists, but is not mapped
     */
    public Object get(String name, String key) {

        Object value = null;
        try {
            value = PropertyUtils.getMappedProperty(instance, name, key);
        } catch (InvocationTargetException ite) {
            Throwable cause = ite.getTargetException();
            throw new IllegalArgumentException
                    ("Error reading mapped property '" + name +
                              "' nested exception - " + cause);
        } catch (Throwable t) {
            throw new IllegalArgumentException
                    ("Error reading mapped property '" + name +
                              "', exception - " + t);
        }
        return (value);

    }


    /**
     * Return the <code>DynaClass</code> instance that describes the set of
     * properties available for this DynaBean.
     * @return The associated DynaClass
     */
    public DynaClass getDynaClass() {

        if (dynaClass == null) {
            dynaClass = WrapDynaClass.createDynaClass(instance.getClass());
        }

        return (this.dynaClass);

    }


    /**
     * Remove any existing value for the specified key on the
     * specified mapped property.
     *
     * @param name Name of the property for which a value is to
     *  be removed
     * @param key Key of the value to be removed
     *
     * @exception IllegalArgumentException if there is no property
     *  of the specified name
     */
    public void remove(String name, String key) {


        throw new UnsupportedOperationException
                ("WrapDynaBean does not support remove()");

    }


    /**
     * Set the value of a simple property with the specified name.
     *
     * @param name Name of the property whose value is to be set
     * @param value Value to which this property is to be set
     *
     * @exception ConversionException if the specified value cannot be
     *  converted to the type required for this property
     * @exception IllegalArgumentException if there is no property
     *  of the specified name
     * @exception NullPointerException if an attempt is made to set a
     *  primitive property to null
     */
    public void set(String name, Object value) {

        try {
            PropertyUtils.setSimpleProperty(instance, name, value);
        } catch (InvocationTargetException ite) {
            Throwable cause = ite.getTargetException();
            throw new IllegalArgumentException
                    ("Error setting property '" + name +
                              "' nested exception -" + cause);
        } catch (Throwable t) {
            throw new IllegalArgumentException
                    ("Error setting property '" + name +
                              "', exception - " + t);
        }

    }


    /**
     * Set the value of an indexed property with the specified name.
     *
     * @param name Name of the property whose value is to be set
     * @param index Index of the property to be set
     * @param value Value to which this property is to be set
     *
     * @exception ConversionException if the specified value cannot be
     *  converted to the type required for this property
     * @exception IllegalArgumentException if there is no property
     *  of the specified name
     * @exception IllegalArgumentException if the specified property
     *  exists, but is not indexed
     * @exception IndexOutOfBoundsException if the specified index
     *  is outside the range of the underlying property
     */
    public void set(String name, int index, Object value) {

        try {
            PropertyUtils.setIndexedProperty(instance, name, index, value);
        } catch (IndexOutOfBoundsException e) {
            throw e;
        } catch (InvocationTargetException ite) {
            Throwable cause = ite.getTargetException();
            throw new IllegalArgumentException
                    ("Error setting indexed property '" + name +
                              "' nested exception - " + cause);
        } catch (Throwable t) {
            throw new IllegalArgumentException
                    ("Error setting indexed property '" + name +
                              "', exception - " + t);
        }

    }


    /**
     * Set the value of a mapped property with the specified name.
     *
     * @param name Name of the property whose value is to be set
     * @param key Key of the property to be set
     * @param value Value to which this property is to be set
     *
     * @exception ConversionException if the specified value cannot be
     *  converted to the type required for this property
     * @exception IllegalArgumentException if there is no property
     *  of the specified name
     * @exception IllegalArgumentException if the specified property
     *  exists, but is not mapped
     */
    public void set(String name, String key, Object value) {

        try {
            PropertyUtils.setMappedProperty(instance, name, key, value);
        } catch (InvocationTargetException ite) {
            Throwable cause = ite.getTargetException();
            throw new IllegalArgumentException
                    ("Error setting mapped property '" + name +
                              "' nested exception - " + cause);
        } catch (Throwable t) {
            throw new IllegalArgumentException
                    ("Error setting mapped property '" + name +
                              "', exception - " + t);
        }

    }

    /** 
     * Gets the bean instance wrapped by this DynaBean.
     * For most common use cases, 
     * this object should already be known 
     * and this method safely be ignored.
     * But some creators of frameworks using <code>DynaBean</code>'s may 
     * find this useful.
     *
     * @return the java bean Object wrapped by this <code>DynaBean</code>
     */
    public Object getInstance() {
        return instance;
    }


    // ------------------------------------------------------ Protected Methods


    /**
     * Return the property descriptor for the specified property name.
     *
     * @param name Name of the property for which to retrieve the descriptor
     * @return The descriptor for the specified property
     *
     * @exception IllegalArgumentException if this is not a valid property
     *  name for our DynaClass
     */
    protected DynaProperty getDynaProperty(String name) {

        DynaProperty descriptor = getDynaClass().getDynaProperty(name);
        if (descriptor == null) {
            throw new IllegalArgumentException
                    ("Invalid property name '" + name + "'");
        }
        return (descriptor);

    }


}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲小少妇裸体bbw| 99久久99久久精品免费看蜜桃| 成人午夜激情在线| 麻豆成人综合网| 88在线观看91蜜桃国自产| 亚洲人成人一区二区在线观看| 奇米亚洲午夜久久精品| 久久亚洲影视婷婷| 毛片av一区二区三区| 欧洲国内综合视频| 一区二区激情视频| 青娱乐精品视频| 久久婷婷综合激情| 国产真实乱子伦精品视频| 精品免费日韩av| 成人激情午夜影院| 日本一二三四高清不卡| 91在线播放网址| 亚洲永久精品国产| 91精品在线一区二区| 麻豆精品国产91久久久久久| 在线不卡免费av| 免费久久精品视频| 国产主播一区二区| 蜜桃视频在线一区| 欧美在线一区二区三区| 日本不卡一区二区三区| 久久久青草青青国产亚洲免观| 乱中年女人伦av一区二区| 日韩精品自拍偷拍| 99re6这里只有精品视频在线观看| 国产精品无人区| 一本色道久久综合亚洲aⅴ蜜桃| 亚洲综合一区二区三区| 久久日韩粉嫩一区二区三区 | 欧美亚洲一区二区在线观看| 天天免费综合色| 91精品综合久久久久久| 韩国女主播成人在线观看| 亚洲综合一区二区三区| 欧美精品一区二区三区高清aⅴ| 色综合久久久久久久| 国产乱一区二区| 午夜av区久久| 亚洲日本中文字幕区| 精品国产髙清在线看国产毛片| 欧洲精品一区二区| 在线观看免费成人| 99久久伊人网影院| 粉嫩高潮美女一区二区三区| 日韩激情视频网站| 午夜精品视频在线观看| 丝袜美腿一区二区三区| 国产精品日韩精品欧美在线| 久久久久久久久久久电影| 久久久久久97三级| 亚洲国产经典视频| 国产亚洲综合在线| 久久久亚洲欧洲日产国码αv| 精品欧美乱码久久久久久1区2区| 精品视频免费在线| 欧美区一区二区三区| 欧美日本免费一区二区三区| 在线播放欧美女士性生活| 欧美性生活一区| 91福利精品视频| 欧美成人a∨高清免费观看| 日韩欧美精品在线| 精品成人私密视频| 国产精品国产a级| 五月综合激情网| 国产资源在线一区| 久久精品av麻豆的观看方式| 一区二区成人在线| 五月天丁香久久| 日韩和的一区二区| 成人动漫视频在线| 欧美日本一道本在线视频| 欧美高清视频www夜色资源网| 色婷婷av久久久久久久| 国产精品久久毛片| 亚洲国产成人tv| 成人精品视频一区二区三区| 亚洲国产精品久久艾草纯爱| 亚洲视频免费在线观看| 国产精品久久久久久亚洲毛片 | 成人免费视频国产在线观看| 99这里只有精品| 理论电影国产精品| va亚洲va日韩不卡在线观看| 99久久免费国产| 91精品中文字幕一区二区三区| 国产精品美女久久久久久久久久久| 亚洲色图欧洲色图婷婷| 亚洲在线视频网站| 久久99久久99小草精品免视看| av不卡免费电影| 国产日本欧洲亚洲| 老司机精品视频线观看86| 色哟哟一区二区三区| 欧美在线视频你懂得| 精品成人私密视频| 五月天亚洲婷婷| 国产成人免费视频网站高清观看视频| 极品少妇xxxx精品少妇偷拍| 国产一区二区在线影院| 欧美一区二区在线免费播放| 国产色婷婷亚洲99精品小说| 欧美精品久久一区二区三区| 亚洲成人免费电影| 99精品在线免费| 色欧美片视频在线观看| 制服丝袜亚洲精品中文字幕| 日韩欧美国产三级电影视频| 亚洲国产精品久久久久秋霞影院| 欧美日韩国产中文| 久久成人av少妇免费| 91久久精品日日躁夜夜躁欧美| 91蝌蚪porny成人天涯| 亚洲综合色网站| 日韩欧美高清在线| 岛国一区二区在线观看| 亚洲天堂av一区| 国产精品久久久久久久午夜片| 成人永久aaa| 欧美国产一区视频在线观看| 亚洲精品菠萝久久久久久久| 97aⅴ精品视频一二三区| 一区二区在线看| 日韩一区二区高清| 国产精品1区2区| 亚洲日本在线看| 91原创在线视频| 伊人夜夜躁av伊人久久| 欧美年轻男男videosbes| 视频精品一区二区| 国产精品污网站| 国产精品你懂的在线| 色综合久久88色综合天天6| 亚洲国产aⅴ天堂久久| 91视频91自| 国产精品盗摄一区二区三区| 在线观看一区二区视频| 韩国成人精品a∨在线观看| 国产精品不卡一区二区三区| 欧美影院一区二区三区| 成人免费看片app下载| 奇米色一区二区三区四区| 欧美福利一区二区| 久久综合九色综合97_久久久| 国产九色精品成人porny| 中文字幕在线不卡| 精品剧情v国产在线观看在线| 亚洲综合丝袜美腿| 国产精品网站一区| 欧美性生活久久| 夜夜精品浪潮av一区二区三区| 日韩一区二区三区免费看| 国产精品1区2区| 免费人成网站在线观看欧美高清| 欧美日韩国产小视频在线观看| www.色精品| 欧美高清视频在线高清观看mv色露露十八| 99re66热这里只有精品3直播| 天天影视网天天综合色在线播放| 欧美日本高清视频在线观看| 国产在线视视频有精品| 色猫猫国产区一区二在线视频| 97久久超碰国产精品电影| 成人av电影在线播放| 久久99九九99精品| 亚洲成av人片一区二区| 一区二区在线观看免费| 18欧美乱大交hd1984| 欧美国产欧美亚州国产日韩mv天天看完整 | 中文字幕成人网| 欧美一区日本一区韩国一区| 国内精品视频一区二区三区八戒| 亚洲一本大道在线| 午夜国产精品一区| 天堂久久一区二区三区| 日韩精品一二三四| 国产午夜精品久久| 国产精品国产三级国产普通话蜜臀| 久久精品亚洲麻豆av一区二区| 国产性做久久久久久| 亚洲人成网站精品片在线观看| 国产日韩欧美一区二区三区乱码| 中文字幕一区二区三区乱码在线| 久久久蜜桃精品| 精品福利一二区| 自拍偷在线精品自拍偷无码专区| 亚洲精品乱码久久久久| 亚洲精品午夜久久久| 日本不卡一区二区| 丝袜美腿亚洲一区二区图片| 国产精品1区二区.| 国产精品一区二区三区99| 免费成人在线观看视频| 成人午夜精品在线|