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

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

?? propertyresolverimpl.java

?? struts的源代碼
?? JAVA
字號:
/*
 * Copyright 2002,2004 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 org.apache.struts.faces.application;


import java.util.Map;

import javax.faces.el.PropertyNotFoundException;
import javax.faces.el.PropertyResolver;

import org.apache.commons.beanutils.DynaBean;
import org.apache.commons.beanutils.DynaProperty;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.DynaActionForm;



/**
 * <p>Custom <code>PropertyResolver</code> implementation that adds support
 * for <code>DynaBean</code> property access to the facilities of the default
 * <code>PropertyResolver</code> provided by JavaServer Faces.</p>
 *
 * <p>This class implements the following specific rules:</p>
 * <ul>
 * <li>Indexed variants of each call are directly passed through to the
 *     <code>PropertyResolver</code> instance that we are wrapping.</li>
 * <li>If the specified base object is an instance of
 *     <code>DynaActionForm</code>, and the requested property name is
 *     <code>map</code>, maintain compatibility with the way that JSP and
 *     JSTL expressions can access this property:
 *     <ul>
 *     <li><code>getValue()</code> will return the result of calling
 *         <code>getMap()</code> on the base object.</li>
 *     <li><code>setValue()</code> will throw an exception, because the
 *         map of property values is a read-only property of the
 *         <code>DynaActionForm</code> class.</li>
 *     <li><code>isReadOnly()</code> returns <code>true</code>.</li>
 *     <li><code>getType()</code> returns the <code>Class</code> object
 *         for <code>java.util.Map</code>.</li>
 *     </ul></li>
 * <li>If the specified base object is an instance of
 *     <code>DynaBean</code>, provide access to its named properties
 *     as follows:
 *     <ul>
 *     <li><code>getValue()</code> will return the result of calling
 *         <code>get()</code> on the base object.</li>
 *     <li><code>setValue()</code> will call <code>set()</code>
 *         on the base object.</li>
 *     <li><code>isReadOnly()</code> returns <code>false</code> (because
 *         the DynaBean APIs provide no mechanism to make this determination,
 *         but most implementations will provide mutable properties).</li>
 *     <li><code>getType()</code> returns the <code>Class</code> object
 *         for the underlying dynamic property.</li>
 *     </ul></li>
 * <li>Named variant calls with any other type of base object are
 *     passed through to the <code>PropertyResolver</code> that we
 *     are wrapping.</li>
 * </ul>
 *
 * @version $Rev: 54934 $ $Date: 2004-10-16 18:07:50 +0100 (Sat, 16 Oct 2004) $
 */

public class PropertyResolverImpl extends PropertyResolver {


    // ------------------------------------------------------------ Constructor


    /**
     * <p>Construct a new <code>PropertyResolver</code> instance, wrapping the
     * specified instance using the Decorator pattern such that this class need
     * implement only the new functionality it supports, and not need to
     * re-implement the basic facilities.
     *
     * @param resolver The original resolver to be wrapped
     *
     * @exception NullPointerException if <code>resolver</code>
     *  is <code>null</code>
     */
    public PropertyResolverImpl(PropertyResolver resolver) {

        if (resolver == null) {
            throw new NullPointerException();
        }
        if (log.isDebugEnabled()) {
            log.debug("Creating new instance, wrapping resolver " +
                      resolver);
        }
        this.resolver = resolver;

    }


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


    /**
     * <p>The <code>Log</code> instance for this class.</p>
     */
    private static final Log log =
        LogFactory.getLog(PropertyResolverImpl.class);


    /**
     * <p>The <code>PropertyResolver</code> instance that we are wrapping,
     * which will be used to perform operations on beans that are not
     * recognized by this class.</p>
     */
    private PropertyResolver resolver = null;


    // ----------------------------------------------- PropertyResolver Methods


    /**
     * <p>Return the value of the property with the specified name from
     * the specified base object.</p>
     *
     * @param base The base object whose property value is to be returned
     * @param name Name of the property to be returned
     *
     * @exception NullPointerException if <code>base</code> or
     *  <code>name</code> is <code>null</code>
     * @exception PropertyNotFoundException if the specified property name
     *  does not exist, or is not readable
     */
    public Object getValue(Object base, Object name)
        throws PropertyNotFoundException {

        if ((base == null) || (name == null)) {
            throw new NullPointerException();
        } else if ((base instanceof DynaActionForm) &&
                   ("map".equals(name))) {
            if (log.isTraceEnabled()) {
                log.trace("Returning property map for DynaActionForm " + base
                          + "'");
            }
            return (((DynaActionForm) base).getMap());
        } else if (base instanceof DynaBean) {
            if (getDynaProperty((DynaBean) base, name.toString()) == null) {
                throw new PropertyNotFoundException(name.toString());
            }
            Object value = ((DynaBean) base).get(name.toString());
            if (log.isTraceEnabled()) {
                log.trace("Returning dynamic property '" + name +
                          "' for DynaBean '" + base + "' value '" +
                          value + "'");
            }
            return (value);
        } else {
            Object value = resolver.getValue(base, name);
            if (log.isTraceEnabled()) {
                log.trace("Delegating get of property '" + name +
                          "' for bean '" + base + "' value '" +
                          value + "'");
            }
            return (value);
        }

    }


    /**
     * <p>Return the value at the specified index of the specified
     * base object.</p>
     *
     * @param base The base object whose property value is to be returned
     * @param index Index of the value to return
     *
     * @exception IndexOutOfBoundsException if thrown by the underlying
     *  access to the base object
     * @exception NullPointerException if <code>base</code>
     *  is <code>null</code>
     * @exception PropertyNotFoundException if some other exception occurs 
     */
    public Object getValue(Object base, int index)
        throws PropertyNotFoundException {

        return (resolver.getValue(base, index));

    }


    /**
     * <p>Set the specified value of the property with the specified name on
     * the specified base object.</p>
     *
     * @param base The base object whose property value is to be set
     * @param name Name of the property to be set
     * @param value Value of the property to be set
     *
     * @exception NullPointerException if <code>base</code> or
     *  <code>name</code> is <code>null</code>
     * @exception PropertyNotFoundException if the specified property name
     *  does not exist, or is not writeable
     */
    public void setValue(Object base, Object name, Object value)
        throws PropertyNotFoundException {

        if ((base == null) || (name == null)) {
            throw new NullPointerException();
        } else if ((base instanceof DynaActionForm) &&
                   ("map".equals(name))) {
            throw new PropertyNotFoundException(name.toString());
        } else if (base instanceof DynaBean) {
            if (log.isTraceEnabled()) {
                log.trace("setting dynamic property '" + name +
                          "' for DynaBean '" + base +
                          "' to '" + value + "'");
            }
            if (getDynaProperty((DynaBean) base, name.toString()) == null) {
                throw new PropertyNotFoundException(name.toString());
            }
            ((DynaBean) base).set(name.toString(), value);
        } else {
            if (log.isTraceEnabled()) {
                log.trace("Delegating set of property '" + name +
                          "' for bean '" + base + "' to value '" +
                          value + "'");
            }
            resolver.setValue(base, name, value);
        }

    }


    /**
     * <p>Set the value at the specified index of the specified
     * base object.</p>
     *
     * @param base The base object whose property value is to be set
     * @param index Index of the value to set
     * @param value Value to be set
     *
     * @exception IndexOutOfBoundsException if thrown by the underlying
     *  access to the base object
     * @exception NullPointerException if <code>base</code>
     *  is <code>null</code>
     * @exception PropertyNotFoundException if some other exception occurs
     */
    public void setValue(Object base, int index, Object value)
        throws PropertyNotFoundException {

        resolver.setValue(base, index, value);

    }


    /**
     * <p>Return <code>true</code> if the specified property of the specified
     * base object is known to be immutable; otherwise, return
     * <code>false</code>.</p>
     *
     * @param base The base object whose property is to analyzed
     * @param name Name of the property to be analyzed
     *
     * @exception NullPointerException if <code>base</code> or
     *  <code>name</code> is <code>null</code>
     * @exception PropertyNotFoundException if the specified property name
     *  does not exist
     */
    public boolean isReadOnly(Object base, Object name)
        throws PropertyNotFoundException {

        if ((base == null) || (name == null)) {
            throw new NullPointerException();
        } else if ((base instanceof DynaActionForm) &&
                   ("map".equals(name))) {
            return (true);
        } else if (base instanceof DynaBean) {
            if (getDynaProperty((DynaBean) base, name.toString()) == null) {
                throw new PropertyNotFoundException(name.toString());
            }
            return (false);
        } else {
            return (resolver.isReadOnly(base, name.toString()));
        }

    }


    /**
     * <p>Return <code>true</code> if the value at the specified index of
     * the specified base object is known to be immutable; otherwise,
     * return <code>false</code>.</p>
     *
     * @param base The base object whose property is to analyzed
     * @param index Index of the value whose type is to be returned
     *
     * @exception IndexOutOfBoundsException if thrown by the underlying
     *  accessed to the indexed property
     * @exception NullPointerException if <code>base</code>
     *  is <code>null</code>
     * @exception PropertyNotFoundException if some other exception occurs
     */
    public boolean isReadOnly(Object base, int index)
        throws PropertyNotFoundException {

        return (resolver.isReadOnly(base, index));

    }


    /**
     * <p>Return the <code>java.lang.Class</code> representing the type of
     * the specified property of the specified base object, if it can be
     * determined; otherwise return <code>null</code>.</p>
     *
     * @param base The base object whose property is to analyzed
     * @param name Name of the property to be analyzed
     *
     * @exception NullPointerException if <code>base</code> or
     *  <code>name</code> is <code>null</code>
     * @exception PropertyNotFoundException if the specified property name
     *  does not exist
     */
    public Class getType(Object base, Object name)
        throws PropertyNotFoundException {

        if ((base == null) || (name == null)) {
            throw new NullPointerException();
        } else if ((base instanceof DynaActionForm) &&
                   ("map".equals(name))) {
            return (Map.class);
        } else if (base instanceof DynaBean) {
            DynaProperty dynaProperty =
                getDynaProperty((DynaBean) base, name.toString());
            if (dynaProperty != null) {
                return (dynaProperty.getType());
            } else {
                throw new PropertyNotFoundException(name.toString());
            }
        } else {
            return (resolver.getType(base, name));
        }
    }


    /**
     * <p>Return the <code>java.lang.Class</code> representing the type of
     * value at the specified index of the specified base object, or
     * <code>null</code> if this value is <code>null</code>.</p>
     *
     * @param base The base object whose property is to analyzed
     * @param index Index of the value whose type is to be returned
     *
     * @exception IndexOutOfBoundsException if thrown by the underlying
     *  accessed to the indexed property
     * @exception NullPointerException if <code>base</code>
     *  is <code>null</code>
     * @exception PropertyNotFoundException if some other exception occurs
     */
    public Class getType(Object base, int index)
        throws PropertyNotFoundException {

        return (resolver.getType(base, index));

    }


    // -------------------------------------------------------- Private Methods


    /**
     * <p>Return the <code>DynaProperty</code> describing the specified
     * property of the specified <code>DynaBean</code>, or <code>null</code>
     * if there is no such property defined on the underlying
     * <code>DynaClass</code>.</p>
     *
     * @param bean <code>DynaBean</code> to be checked
     * @param name Name of the property to be checked
     */
    private DynaProperty getDynaProperty(DynaBean bean, String name)
        throws PropertyNotFoundException {

        DynaProperty dynaProperty = null;
        try {
            dynaProperty = bean.getDynaClass().getDynaProperty(name);
        } catch (IllegalArgumentException e) {
            ;
        }
        return (dynaProperty);

    }




}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产很黄免费观看久久| 日韩欧美中文一区| 日韩欧美亚洲国产另类| 欧美激情艳妇裸体舞| 亚洲图片欧美视频| www.av精品| 欧美xxxx老人做受| 奇米影视在线99精品| 91在线小视频| 国产精品的网站| 蜜臀av性久久久久蜜臀aⅴ流畅| 色综合久久综合| 久久久精品人体av艺术| 久久99精品久久久| 91精品在线观看入口| 日韩综合在线视频| 欧美色男人天堂| 亚洲妇熟xx妇色黄| 欧洲视频一区二区| 亚洲自拍偷拍av| 色狠狠一区二区| 亚洲综合一区在线| 91网站黄www| 亚洲婷婷国产精品电影人久久| 成人免费高清视频在线观看| 精品久久久久久久久久久久包黑料 | 欧美日韩一区二区三区四区 | 91在线观看视频| 国产精品嫩草99a| 成人综合在线网站| 国产精品视频一区二区三区不卡| 国产另类ts人妖一区二区| 日韩精品中文字幕一区二区三区| 美国精品在线观看| 精品国产乱码久久久久久夜甘婷婷| 日韩成人精品在线观看| 欧美一区二区三区在线看| 天天综合色天天综合| 日韩欧美一级在线播放| 久久99精品国产麻豆婷婷| 久久蜜桃av一区二区天堂| 成人黄色777网| 亚洲欧洲一区二区在线播放| 91美女福利视频| 天天色天天爱天天射综合| 欧美一级午夜免费电影| 国产裸体歌舞团一区二区| 中文字幕va一区二区三区| 99精品久久只有精品| 亚洲一区二区三区美女| 日韩免费视频一区二区| 大胆欧美人体老妇| 亚洲女女做受ⅹxx高潮| 欧美高清你懂得| 精品一区二区在线视频| 国产精品毛片久久久久久久| 欧美日韩在线播放三区四区| 男女性色大片免费观看一区二区 | 免费av成人在线| 欧美激情一二三区| 日本韩国一区二区| 久久99国内精品| 国产精品久久久久久久久果冻传媒| 99精品视频在线观看免费| 三级精品在线观看| 国产精品入口麻豆原神| 欧美日韩你懂得| 成人app网站| 久久精品国产99国产| 中文字幕一区二区三区av| 欧美一区二区三区在线观看| 大尺度一区二区| 男女男精品网站| 一区二区三区高清不卡| 欧美精品一区二区不卡| 日本久久电影网| 福利一区福利二区| 日本不卡视频一二三区| 亚洲精品免费视频| 国产亚洲成av人在线观看导航 | 日本vs亚洲vs韩国一区三区 | 久久久欧美精品sm网站| 欧美日韩视频在线第一区| 成人高清视频在线| 久久精品国产亚洲一区二区三区| 亚洲精品视频在线观看免费 | 91麻豆精品国产91久久久资源速度| 粉嫩aⅴ一区二区三区四区| 美女www一区二区| 亚洲精品免费在线| 国产精品不卡一区| 国产亚洲精品免费| ww久久中文字幕| 欧美成人激情免费网| 欧美视频一区二区在线观看| 91麻豆6部合集magnet| 国产不卡在线视频| 国产一区欧美一区| 极品少妇xxxx精品少妇偷拍| 青青草国产成人99久久| 日韩精品亚洲一区| 午夜欧美在线一二页| 亚洲免费观看高清完整版在线观看熊| 久久久高清一区二区三区| 91精品国产乱| 日韩一区二区视频| 777亚洲妇女| 欧美精品18+| 9191精品国产综合久久久久久 | 91原创在线视频| 91污在线观看| 色一情一伦一子一伦一区| 91亚洲精华国产精华精华液| 不卡av在线免费观看| 粉嫩13p一区二区三区| 丁香婷婷综合网| caoporen国产精品视频| jvid福利写真一区二区三区| 波多野结衣中文字幕一区二区三区| 高清beeg欧美| 日本高清无吗v一区| 91国偷自产一区二区使用方法| 91丨九色丨国产丨porny| 在线精品视频免费播放| 欧美色图一区二区三区| 这里只有精品免费| 91麻豆精品国产91久久久资源速度| 欧美一区二区三区四区视频| 久久亚洲精品国产精品紫薇| 国产日韩欧美电影| 亚洲欧美激情小说另类| 日韩av网站免费在线| 裸体在线国模精品偷拍| 粉嫩在线一区二区三区视频| 色嗨嗨av一区二区三区| 日韩视频不卡中文| 国产欧美视频在线观看| 亚洲美女电影在线| 免费人成在线不卡| 成人短视频下载| 6080国产精品一区二区| 久久精品欧美日韩| 亚洲综合一区二区精品导航| 精品一区二区免费在线观看| 成人性生交大合| 欧美日韩成人激情| 久久久久国产精品免费免费搜索| 亚洲欧美日韩国产手机在线 | 日韩影院在线观看| 国产一区福利在线| 欧美在线观看18| 26uuu另类欧美| 亚洲午夜精品在线| 国产精品白丝av| 欧美日韩三级视频| 国产日韩欧美一区二区三区综合| 亚洲国产你懂的| 成人av在线影院| 日韩一区二区三区在线观看 | 色综合久久天天| 日韩欧美高清dvd碟片| 日韩美女精品在线| 国产一区二区三区四区在线观看| 欧美亚洲国产一区二区三区| 国产午夜精品久久久久久久| 亚洲成a人在线观看| 99久久免费精品高清特色大片| 精品国产一区久久| 亚洲电影你懂得| 93久久精品日日躁夜夜躁欧美| 精品电影一区二区三区 | 成人黄色网址在线观看| 欧美一区二区三区免费| 一区二区三区四区不卡在线| 国产精品亚洲一区二区三区妖精| 8x福利精品第一导航| 一区二区三区高清| 91在线视频网址| 国产精品久久网站| 狠狠色综合日日| 91精品国产91久久综合桃花 | 亚洲欧美一区二区三区国产精品 | 久久亚洲春色中文字幕久久久| 亚洲成av人片在线观看| 91免费国产在线观看| 国产精品天美传媒沈樵| 国产白丝网站精品污在线入口| 日韩一区二区电影网| 五月综合激情网| 欧美日韩成人激情| 婷婷丁香激情综合| 欧美精品18+| 强制捆绑调教一区二区| 欧美精品 国产精品| 日韩av电影免费观看高清完整版 | 国产一区二三区| 久久综合久久综合久久综合| 蜜臀99久久精品久久久久久软件| 这里只有精品视频在线观看| 午夜精品福利视频网站|