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

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

?? beanutilsbean.java

?? 這是一個有關common beanutils 的源碼
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
                if ("class".equals(name)) {
                    continue; // No point in trying to set an object's class
                }
                if (getPropertyUtils().isReadable(orig, name) &&
                    getPropertyUtils().isWriteable(dest, name)) {
                    try {
                        Object value =
                            getPropertyUtils().getSimpleProperty(orig, name);
                        copyProperty(dest, name, value);
                    } catch (NoSuchMethodException e) {
                        // Should not happen
                    }
                }
            }
        }

    }


    /**
     * <p>Copy the specified property value to the specified destination bean,
     * performing any type conversion that is required.  If the specified
     * bean does not have a property of the specified name, or the property
     * is read only on the destination bean, return without
     * doing anything.  If you have custom destination property types, register
     * {@link Converter}s for them by calling the <code>register()</code>
     * method of {@link ConvertUtils}.</p>
     *
     * <p><strong>IMPLEMENTATION RESTRICTIONS</strong>:</p>
     * <ul>
     * <li>Does not support destination properties that are indexed,
     *     but only an indexed setter (as opposed to an array setter)
     *     is available.</li>
     * <li>Does not support destination properties that are mapped,
     *     but only a keyed setter (as opposed to a Map setter)
     *     is available.</li>
     * <li>The desired property type of a mapped setter cannot be
     *     determined (since Maps support any data type), so no conversion
     *     will be performed.</li>
     * </ul>
     *
     * @param bean Bean on which setting is to be performed
     * @param name Property name (can be nested/indexed/mapped/combo)
     * @param value Value to be set
     *
     * @exception IllegalAccessException if the caller does not have
     *  access to the property accessor method
     * @exception InvocationTargetException if the property accessor method
     *  throws an exception
     */
    public void copyProperty(Object bean, String name, Object value)
        throws IllegalAccessException, InvocationTargetException {

        // Trace logging (if enabled)
        if (log.isTraceEnabled()) {
            StringBuffer sb = new StringBuffer("  copyProperty(");
            sb.append(bean);
            sb.append(", ");
            sb.append(name);
            sb.append(", ");
            if (value == null) {
                sb.append("<NULL>");
            } else if (value instanceof String) {
                sb.append((String) value);
            } else if (value instanceof String[]) {
                String[] values = (String[]) value;
                sb.append('[');
                for (int i = 0; i < values.length; i++) {
                    if (i > 0) {
                        sb.append(',');
                    }
                    sb.append(values[i]);
                }
                sb.append(']');
            } else {
                sb.append(value.toString());
            }
            sb.append(')');
            log.trace(sb.toString());
        }

        // Resolve any nested expression to get the actual target bean
        Object target = bean;
        Resolver resolver = getPropertyUtils().getResolver();
        while (resolver.hasNested(name)) {
            try {
                target = getPropertyUtils().getProperty(target, resolver.next(name));
                name = resolver.remove(name);
            } catch (NoSuchMethodException e) {
                return; // Skip this property setter
            }
        }
        if (log.isTraceEnabled()) {
            log.trace("    Target bean = " + target);
            log.trace("    Target name = " + name);
        }

        // Declare local variables we will require
        String propName = resolver.getProperty(name); // Simple name of target property
        Class type = null;                            // Java type of target property
        int index  = resolver.getIndex(name);         // Indexed subscript value (if any)
        String key = resolver.getKey(name);           // Mapped key value (if any)

        // Calculate the target property type
        if (target instanceof DynaBean) {
            DynaClass dynaClass = ((DynaBean) target).getDynaClass();
            DynaProperty dynaProperty = dynaClass.getDynaProperty(propName);
            if (dynaProperty == null) {
                return; // Skip this property setter
            }
            type = dynaProperty.getType();
        } else {
            PropertyDescriptor descriptor = null;
            try {
                descriptor =
                    getPropertyUtils().getPropertyDescriptor(target, name);
                if (descriptor == null) {
                    return; // Skip this property setter
                }
            } catch (NoSuchMethodException e) {
                return; // Skip this property setter
            }
            type = descriptor.getPropertyType();
            if (type == null) {
                // Most likely an indexed setter on a POJB only
                if (log.isTraceEnabled()) {
                    log.trace("    target type for property '" +
                              propName + "' is null, so skipping ths setter");
                }
                return;
            }
        }
        if (log.isTraceEnabled()) {
            log.trace("    target propName=" + propName + ", type=" +
                      type + ", index=" + index + ", key=" + key);
        }

        // Convert the specified value to the required type and store it
        if (index >= 0) {                    // Destination must be indexed
            value = convert(value, type.getComponentType());
            try {
                getPropertyUtils().setIndexedProperty(target, propName,
                                                 index, value);
            } catch (NoSuchMethodException e) {
                throw new InvocationTargetException
                    (e, "Cannot set " + propName);
            }
        } else if (key != null) {            // Destination must be mapped
            // Maps do not know what the preferred data type is,
            // so perform no conversions at all
            // FIXME - should we create or support a TypedMap?
            try {
                getPropertyUtils().setMappedProperty(target, propName,
                                                key, value);
            } catch (NoSuchMethodException e) {
                throw new InvocationTargetException
                    (e, "Cannot set " + propName);
            }
        } else {                             // Destination must be simple
            value = convert(value, type);
            try {
                getPropertyUtils().setSimpleProperty(target, propName, value);
            } catch (NoSuchMethodException e) {
                throw new InvocationTargetException
                    (e, "Cannot set " + propName);
            }
        }

    }


    /**
     * <p>Return the entire set of properties for which the specified bean
     * provides a read method. This map contains the to <code>String</code>
     * converted property values for all properties for which a read method
     * is provided (i.e. where the getReadMethod() returns non-null).</p>
     *
     * <p>This map can be fed back to a call to
     * <code>BeanUtils.populate()</code> to reconsitute the same set of
     * properties, modulo differences for read-only and write-only
     * properties, but only if there are no indexed properties.</p>
     *
     * <p><strong>Warning:</strong> if any of the bean property implementations
     * contain (directly or indirectly) a call to this method then 
     * a stack overflow may result. For example:
     * <code><pre>
     * class MyBean
     * {
     *    public Map getParameterMap()
     *    {
     *         BeanUtils.describe(this);
     *    }
     * }
     * </pre></code>
     * will result in an infinite regression when <code>getParametersMap</code>
     * is called. It is recommended that such methods are given alternative
     * names (for example, <code>parametersMap</code>).
     * </p>
     * @param bean Bean whose properties are to be extracted
     * @return Map of property descriptors
     *
     * @exception IllegalAccessException if the caller does not have
     *  access to the property accessor method
     * @exception InvocationTargetException if the property accessor method
     *  throws an exception
     * @exception NoSuchMethodException if an accessor method for this
     *  property cannot be found
     */
    public Map describe(Object bean)
            throws IllegalAccessException, InvocationTargetException,
            NoSuchMethodException {

        if (bean == null) {
        //            return (Collections.EMPTY_MAP);
            return (new java.util.HashMap());
        }
        
        if (log.isDebugEnabled()) {
            log.debug("Describing bean: " + bean.getClass().getName());
        }
            
        Map description = new HashMap();
        if (bean instanceof DynaBean) {
            DynaProperty[] descriptors =
                ((DynaBean) bean).getDynaClass().getDynaProperties();
            for (int i = 0; i < descriptors.length; i++) {
                String name = descriptors[i].getName();
                description.put(name, getProperty(bean, name));
            }
        } else {
            PropertyDescriptor[] descriptors =
                getPropertyUtils().getPropertyDescriptors(bean);
            Class clazz = bean.getClass();
            for (int i = 0; i < descriptors.length; i++) {
                String name = descriptors[i].getName();
                if (getPropertyUtils().getReadMethod(clazz, descriptors[i]) != null) {
                    description.put(name, getProperty(bean, name));
                }
            }
        }
        return (description);

    }


    /**
     * Return the value of the specified array property of the specified
     * bean, as a String array.
     *
     * @param bean Bean whose property is to be extracted
     * @param name Name of the property to be extracted
     * @return The array property value
     *
     * @exception IllegalAccessException if the caller does not have
     *  access to the property accessor method
     * @exception InvocationTargetException if the property accessor method
     *  throws an exception
     * @exception NoSuchMethodException if an accessor method for this
     *  property cannot be found
     */
    public String[] getArrayProperty(Object bean, String name)
            throws IllegalAccessException, InvocationTargetException,
            NoSuchMethodException {

        Object value = getPropertyUtils().getProperty(bean, name);
        if (value == null) {
            return (null);
        } else if (value instanceof Collection) {
            ArrayList values = new ArrayList();
            Iterator items = ((Collection) value).iterator();
            while (items.hasNext()) {
                Object item = items.next();
                if (item == null) {
                    values.add((String) null);
                } else {
                    // convert to string using convert utils
                    values.add(getConvertUtils().convert(item));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产成人精品| 国产精品资源网站| 欧美日韩黄色一区二区| 亚洲自拍都市欧美小说| 欧美性xxxxxxxx| 午夜成人免费视频| 久久亚洲一区二区三区四区| 久久精品国产成人一区二区三区| 欧美一区二区三区喷汁尤物| 国产乱国产乱300精品| 国产精品久久三区| 制服丝袜激情欧洲亚洲| 国产精品资源在线观看| 久久久99精品免费观看不卡| 国产一区二区三区在线观看免费 | 日韩avvvv在线播放| 欧美xxxx在线观看| 不卡一卡二卡三乱码免费网站| 亚洲影视资源网| www一区二区| 欧美精品99久久久**| www.亚洲激情.com| 精品伊人久久久久7777人| 中文字幕亚洲一区二区av在线| 欧美一个色资源| 欧美日韩精品一区二区天天拍小说| 风间由美一区二区av101| 视频一区欧美精品| 一级特黄大欧美久久久| 国产精品沙发午睡系列990531| 欧美一二三区精品| 99精品1区2区| 99久久精品情趣| 高清国产午夜精品久久久久久| 日韩av中文字幕一区二区三区| 国产精品二三区| 亚洲国产高清在线观看视频| 欧美一区二区三区在| 欧美精品久久久久久久多人混战 | 亚洲一区日韩精品中文字幕| 国产女人18毛片水真多成人如厕| 精品va天堂亚洲国产| 日韩美女天天操| 久久久久久久久久久黄色| 精品盗摄一区二区三区| 久久精品一级爱片| 国产精品久久看| 亚洲国产精品久久艾草纯爱| 亚洲一区二区av在线| 五月婷婷综合在线| 午夜电影网亚洲视频| 久久精品国产一区二区| 激情五月婷婷综合网| 国产婷婷色一区二区三区 | 九九精品一区二区| 成人午夜电影久久影院| 91成人国产精品| 91年精品国产| 91成人网在线| 欧美本精品男人aⅴ天堂| 中文字幕成人av| 亚洲电影在线免费观看| 久久精品99久久久| 国产91精品精华液一区二区三区| 国产91丝袜在线观看| 99国产精品一区| 欧美日韩精品一区二区在线播放| 精品久久久久久最新网址| 国产欧美一区二区精品忘忧草| 一区二区三区日韩在线观看| 蜜桃精品在线观看| av爱爱亚洲一区| 欧美xxxx老人做受| 亚洲特级片在线| 久久国产精品72免费观看| av亚洲精华国产精华| 日韩欧美成人午夜| 亚洲一区二区三区四区五区中文| 久久国产夜色精品鲁鲁99| 色综合久久九月婷婷色综合| 日韩欧美在线综合网| 亚洲二区视频在线| 一本久道久久综合中文字幕| 欧美mv日韩mv| 五月天欧美精品| 色噜噜狠狠成人中文综合| 亚洲国产精品黑人久久久| 美日韩一区二区| 欧美日韩1234| 青青草伊人久久| 日韩三级精品电影久久久| 久久精品二区亚洲w码| 日韩精品一区二区三区中文精品| 亚洲福利一二三区| 在线观看免费亚洲| 蜜臂av日日欢夜夜爽一区| 欧美老女人在线| 久久成人免费网站| 亚洲精品一区二区三区精华液| 免费观看在线综合色| 精品国产伦理网| 风间由美一区二区三区在线观看 | 777午夜精品免费视频| 亚洲最新视频在线观看| 91网上在线视频| 亚洲一区二区三区三| 色爱区综合激月婷婷| 亚洲激情成人在线| 欧美精品 国产精品| 日本91福利区| 一区视频在线播放| 欧美吞精做爰啪啪高潮| 国产一区二区三区在线观看免费视频| 国产精品国产自产拍高清av | 国产成人啪免费观看软件| 婷婷国产v国产偷v亚洲高清| 欧美一区二区三区视频| 成人永久免费视频| 日韩主播视频在线| 国产精品美女一区二区在线观看| 欧洲一区二区三区免费视频| 国产一区二区三区最好精华液| 专区另类欧美日韩| 久久综合九色综合97婷婷| 欧美亚洲免费在线一区| 成人av资源站| 国产一区二区导航在线播放| 首页综合国产亚洲丝袜| 亚洲婷婷在线视频| 国产欧美日韩不卡免费| 欧美精品一区二| 欧美精品久久久久久久久老牛影院| 日韩午夜在线观看| 激情综合一区二区三区| 偷拍与自拍一区| 亚洲午夜精品久久久久久久久| 中文成人av在线| 国产精品午夜免费| 久久久久成人黄色影片| 91麻豆精品国产91久久久久久久久 | 久久久久久久网| 国产午夜精品一区二区三区嫩草| 制服.丝袜.亚洲.中文.综合| 欧美四级电影在线观看| 一本大道av伊人久久综合| 一本色道综合亚洲| 欧美亚洲动漫另类| 欧美狂野另类xxxxoooo| 欧美日韩一区二区电影| 欧美日韩精品高清| 宅男噜噜噜66一区二区66| 欧美疯狂做受xxxx富婆| 欧美人与z0zoxxxx视频| 日韩午夜av一区| xfplay精品久久| 国产精品免费看片| 亚洲高清免费在线| 麻豆免费看一区二区三区| 国产盗摄一区二区| 91视频精品在这里| 日韩亚洲欧美中文三级| 夜夜亚洲天天久久| av不卡免费电影| 久久久久久免费网| 日韩精彩视频在线观看| 豆国产96在线|亚洲| 这里是久久伊人| 亚洲一区二区三区小说| 国产剧情一区二区| 欧美一区二区免费视频| 中文字幕一区二区在线播放| 日本免费新一区视频| 欧美视频一区二区在线观看| 亚洲人成在线播放网站岛国| 欧美无砖砖区免费| 国产欧美日韩在线| 久久99蜜桃精品| 精品污污网站免费看| 免费亚洲电影在线| 欧美日韩国产另类不卡| 亚洲卡通欧美制服中文| 成人综合在线观看| 久久久久久久久久久久电影 | 国产精品视频在线看| 国产剧情一区在线| 国产午夜精品一区二区三区视频| 国产精品一区一区三区| 日韩美女一区二区三区四区| 精品影院一区二区久久久| 久久亚洲免费视频| 成人免费黄色大片| 一级精品视频在线观看宜春院| 国产精品996| 亚洲一二三区不卡| 在线观看免费亚洲| 日本伊人午夜精品| 久久这里都是精品| 国产99久久久精品| 亚洲黄色免费网站| 这里只有精品99re|