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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? beanelresolver.java

?? java屬性邦定的(JSR-295)的一個(gè)實(shí)現(xiàn)
?? JAVA
?? 第 1 頁 / 共 2 頁
字號(hào):
/*
 * Copyright (C) 2007 Sun Microsystems, Inc. All rights reserved. Use is
 * subject to license terms.
 */

package org.jdesktop.el;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.beans.FeatureDescriptor;
import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.beans.IntrospectionException;
import java.util.Iterator;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;

/**
 * Defines property resolution behavior on objects using the JavaBeans
 * component architecture.
 *
 * <p>This resolver handles base objects of any type, as long as the
 * base is not <code>null</code>. It accepts any object as a property, and
 * coerces it to a string. That string is then used to find a JavaBeans
 * compliant property on the base object. The value is accessed using
 * JavaBeans getters and setters.</p>
 * 
 * <p>This resolver can be constructed in read-only mode, which means that
 * {@link #isReadOnly} will always return <code>true</code> and 
 * {@link #setValue} will always throw
 * <code>PropertyNotWritableException</code>.</p>
 *
 * <p><code>ELResolver</code>s are combined together using 
 * {@link CompositeELResolver}s, to define rich semantics for evaluating 
 * an expression. See the javadocs for {@link ELResolver} for details.</p>
 *
 * <p>Because this resolver handles base objects of any type, it should
 * be placed near the end of a composite resolver. Otherwise, it will
 * claim to have resolved a property before any resolvers that come after
 * it get a chance to test if they can do so as well.</p>
 *
 * @see CompositeELResolver
 * @see ELResolver
 * @since JSP 2.1
 */
public class BeanELResolver extends ELResolver {

    private boolean isReadOnly;

    // Set a limit for the number of beans in the cache.
    private final static int SIZE = 2000;
    // Two maps are used here, to facilitate discarding the older cache
    // when cache size reaches the limit.
    private static final Map<Class, BeanProperties> properties =
        new ConcurrentHashMap<Class, BeanProperties>(SIZE);
    private static final Map<Class, BeanProperties> properties2 =
        new ConcurrentHashMap<Class, BeanProperties>(SIZE);
                                                                                
    /*
     * Defines a property for a bean.
     */
    protected final static class BeanProperty {

        private Method readMethod;
        private Method writeMethod;
        private Class baseClass;
        private PropertyDescriptor descriptor;
                                                                                
        public BeanProperty(Class<?> baseClass,
                            PropertyDescriptor descriptor) {
            this.baseClass = baseClass;
            this.descriptor = descriptor;
        }
                                                                                
        public Class getPropertyType() {
            return descriptor.getPropertyType();
        }
                                                                                
        public boolean isReadOnly() {
            return getWriteMethod() == null;
        }
                                                                                
        public Method getReadMethod() {
            if (readMethod == null) {
                readMethod = getMethod(baseClass, descriptor.getReadMethod());
            }
            return readMethod;
        }
                                                                                
        public Method getWriteMethod() {
            if (writeMethod == null) {
                writeMethod = getMethod(baseClass, descriptor.getWriteMethod());
            }
            return writeMethod;
        }
    }
                                                                                
    /*
     * Defines the properties for a bean.
     */
    protected final static class BeanProperties {

        private final Class baseClass;
        private final Map<String, BeanProperty> propertyMap =
            new HashMap<String, BeanProperty>();
                                                                                
        public BeanProperties(Class<?> baseClass) {
            this.baseClass = baseClass;
            PropertyDescriptor[] descriptors;
            try {
                BeanInfo info = Introspector.getBeanInfo(baseClass);
                descriptors = info.getPropertyDescriptors();
            } catch (IntrospectionException ie) {
                throw new ELException(ie);
            }
            for (PropertyDescriptor pd: descriptors) {
                propertyMap.put(pd.getName(),
                                new BeanProperty(baseClass, pd));
            }
        }
                                                                                
        public BeanProperty getBeanProperty(String property) {
            return propertyMap.get(property);
        }
    }

    /**
     * Creates a new read/write <code>BeanELResolver</code>.
     */
    public BeanELResolver() {
        this.isReadOnly = false;
    }

    /**
     * Creates a new <code>BeanELResolver</code> whose read-only status is
     * determined by the given parameter.
     *
     * @param isReadOnly <code>true</code> if this resolver cannot modify
     *     beans; <code>false</code> otherwise.
     */
    public BeanELResolver(boolean isReadOnly) {
        this.isReadOnly = isReadOnly;
    }

    /**
     * If the base object is not <code>null</code>, returns the most 
     * general acceptable type that can be set on this bean property.
     *
     * <p>If the base is not <code>null</code>, the 
     * <code>propertyResolved</code> property of the <code>ELContext</code>
     * object must be set to <code>true</code> by this resolver, before
     * returning. If this property is not <code>true</code> after this 
     * method is called, the caller should ignore the return value.</p>
     *
     * <p>The provided property will first be coerced to a <code>String</code>.
     * If there is a <code>BeanInfoProperty</code> for this property and
     * there were no errors retrieving it, the <code>propertyType</code> of
     * the <code>propertyDescriptor</code> is returned. Otherwise, a
     * <code>PropertyNotFoundException</code> is thrown.</p>
     *
     * @param context The context of this evaluation.
     * @param base The bean to analyze.
     * @param property The name of the property to analyze. Will be coerced to
     *     a <code>String</code>.
     * @return If the <code>propertyResolved</code> property of 
     *     <code>ELContext</code> was set to <code>true</code>, then
     *     the most general acceptable type; otherwise undefined.
     * @throws NullPointerException if context is <code>null</code>
     * @throws PropertyNotFoundException if <code>base</code> is not
     *     <code>null</code> and the specified property does not exist
     *     or is not readable.
     * @throws ELException if an exception was thrown while performing
     *     the property or variable resolution. The thrown exception
     *     must be included as the cause property of this exception, if
     *     available.
     */
    public Class<?> getType(ELContext context,
                         Object base,
                         Object property) {

        if (context == null) {
            throw new NullPointerException();
        }

        if (base == null || property == null){
            return null;
        }

        BeanProperty bp = getBeanProperty(context, base, property);
        context.setPropertyResolved(true);
        return bp.getPropertyType();
    }

    /**
     * If the base object is not <code>null</code>, returns the current
     * value of the given property on this bean.
     *
     * <p>If the base is not <code>null</code>, the 
     * <code>propertyResolved</code> property of the <code>ELContext</code>
     * object must be set to <code>true</code> by this resolver, before
     * returning. If this property is not <code>true</code> after this 
     * method is called, the caller should ignore the return value.</p>
     *
     * <p>The provided property name will first be coerced to a
     * <code>String</code>. If the property is a readable property of the 
     * base object, as per the JavaBeans specification, then return the 
     * result of the getter call. If the getter throws an exception, 
     * it is propagated to the caller. If the property is not found or is 
     * not readable, a <code>PropertyNotFoundException</code> is thrown.</p>
     *
     * @param context The context of this evaluation.
     * @param base The bean on which to get the property.
     * @param property The name of the property to get. Will be coerced to
     *     a <code>String</code>.
     * @return If the <code>propertyResolved</code> property of 
     *     <code>ELContext</code> was set to <code>true</code>, then
     *     the value of the given property. Otherwise, undefined.
     * @throws NullPointerException if context is <code>null</code>.
     * @throws PropertyNotFoundException if <code>base</code> is not
     *     <code>null</code> and the specified property does not exist
     *     or is not readable.
     * @throws ELException if an exception was thrown while performing
     *     the property or variable resolution. The thrown exception
     *     must be included as the cause property of this exception, if
     *     available.
     */
    public Object getValue(ELContext context,
                           Object base,
                           Object property) {

        if (context == null) {
            throw new NullPointerException();
        }

        if (base == null || property == null) {
            return null;
        }

        Method method;
        BeanProperty bp = getBeanProperty(context, base, property);
        if (bp == null || (method = bp.getReadMethod()) == null) {
            return null;
        }

        Object value;
        try {
            value = method.invoke(base, new Object[0]);
            context.setPropertyResolved(true);
        } catch (ELException ex) {
            throw ex;
        } catch (InvocationTargetException ite) {
            throw new ELException(ite.getCause());
        } catch (Exception ex) {
            throw new ELException(ex);
        }
        return value;
    }

    /**
     * If the base object is not <code>null</code>, attempts to set the
     * value of the given property on this bean.
     *
     * <p>If the base is not <code>null</code>, the 
     * <code>propertyResolved</code> property of the <code>ELContext</code>
     * object must be set to <code>true</code> by this resolver, before
     * returning. If this property is not <code>true</code> after this 
     * method is called, the caller can safely assume no value was set.</p>
     *

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品99精品久久免费| 国产精品久久久久久久岛一牛影视 | 久久综合综合久久综合| 在线观看国产一区二区| 国产精品久久99| 国产成人h网站| 久久精品欧美日韩精品| 精品一区二区三区在线观看国产 | 成人精品免费看| 欧美大胆人体bbbb| 久久99最新地址| 宅男在线国产精品| 午夜电影一区二区| 777亚洲妇女| 亚洲电影中文字幕在线观看| 欧美亚洲日本一区| 一区二区三区日韩在线观看| 在线日韩av片| 亚洲aaa精品| 3d动漫精品啪啪一区二区竹菊| 亚洲第一二三四区| 欧美日韩国产大片| 久久不见久久见免费视频7| 欧美精品一区二区三区在线播放| 激情综合亚洲精品| 国产亚洲欧美日韩日本| 懂色中文一区二区在线播放| 精品国产免费人成在线观看| 国产精品亚洲成人| 亚洲人快播电影网| 欧美日韩一区二区在线观看视频| 五月天精品一区二区三区| 欧美一二三四在线| 国产精品香蕉一区二区三区| 国产精品国产三级国产有无不卡| 色婷婷综合久久久久中文| 国产精品少妇自拍| 欧美日韩在线精品一区二区三区激情 | 亚洲精品国产无天堂网2021| 欧美日韩国产综合久久| 久久不见久久见中文字幕免费| 久久精品人人做人人爽人人| 色综合天天天天做夜夜夜夜做| 亚洲欧美另类综合偷拍| 欧美日本一区二区三区四区 | 欧美经典一区二区| 欧美一区二区三区系列电影| 色悠悠久久综合| 国产成人午夜视频| 免费日韩伦理电影| 亚洲一区免费观看| 亚洲色图欧美激情| 国产色婷婷亚洲99精品小说| 日韩一区二区三区电影| 99精品一区二区| 久久99精品国产麻豆婷婷| 国产精品动漫网站| 欧美国产成人精品| 欧美一级片免费看| 91美女蜜桃在线| 精品一区二区三区视频在线观看| 亚洲三级在线播放| 久久久久久久国产精品影院| 欧美色精品在线视频| 国产裸体歌舞团一区二区| 一区二区三区四区视频精品免费| 久久午夜国产精品| 一本大道av伊人久久综合| 亚洲午夜在线电影| 国产精品久久久久久久久图文区 | 欧美一级二级三级蜜桃| 在线视频亚洲一区| 成人开心网精品视频| 久久精品国产精品青草| 亚洲影院在线观看| 国产精品夫妻自拍| 中文字幕精品一区| 日韩天堂在线观看| 日韩一区二区三区高清免费看看| 欧美在线视频不卡| 色综合咪咪久久| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 99视频有精品| 国产在线国偷精品产拍免费yy| 爽好久久久欧美精品| 一区二区不卡在线视频 午夜欧美不卡在| 精品国产第一区二区三区观看体验| 欧美日韩一区视频| 欧美亚洲图片小说| 欧美视频完全免费看| 91黄色免费版| 一本一道久久a久久精品| 国产美女一区二区三区| 亚洲精品国产第一综合99久久| 一区二区三区在线免费视频| 综合久久久久综合| 亚洲三级久久久| 亚洲品质自拍视频| 亚洲美女视频一区| 亚洲综合在线免费观看| 亚洲第一电影网| 日韩精品亚洲一区| 亚洲第一成年网| 国产一级精品在线| 国产suv精品一区二区三区| 国产在线播放一区| 国产成人在线色| www.亚洲激情.com| 色呦呦国产精品| 欧美无砖砖区免费| 欧美一区二视频| 亚洲精品在线三区| 久久蜜桃av一区二区天堂 | 成人a级免费电影| eeuss鲁片一区二区三区在线看| 91免费在线看| 日韩久久免费av| 亚洲精品福利视频网站| 国产在线视频精品一区| 欧美在线free| 国产亚洲一区字幕| 久久久久久97三级| 午夜影院久久久| 六月丁香婷婷久久| 成人av午夜电影| 欧美午夜精品久久久| 日韩欧美久久久| 国产视频在线观看一区二区三区| 国产精品免费丝袜| 美日韩黄色大片| 懂色av一区二区在线播放| 91视频免费播放| 欧美日韩国产区一| 亚洲国产精品v| 午夜伊人狠狠久久| 国产成人免费av在线| 91在线观看下载| 国产色产综合产在线视频| 亚洲免费在线视频| 久久精品久久99精品久久| caoporn国产精品| 欧美一区永久视频免费观看| 欧美国产日韩亚洲一区| 亚洲成人动漫在线免费观看| 经典三级视频一区| 欧美理论在线播放| 欧美激情一区二区三区在线| 亚洲国产综合人成综合网站| 国产在线视频一区二区| 欧美日韩和欧美的一区二区| 国产精品久久久久四虎| 久久97超碰色| 91视频一区二区三区| 日韩欧美一级特黄在线播放| 国产午夜亚洲精品午夜鲁丝片| 天天影视色香欲综合网老头| 成人网页在线观看| 精品免费99久久| 久久www免费人成看片高清| 日韩小视频在线观看专区| 99久久久国产精品免费蜜臀| √…a在线天堂一区| 成人不卡免费av| 亚洲欧美色一区| 成人av免费在线观看| 日韩一区二区三区视频在线| 天天色天天爱天天射综合| 欧美一区二区三区色| 天天综合天天综合色| 成人教育av在线| 欧美极品美女视频| 久久精品国产色蜜蜜麻豆| 欧美一区二区三区免费| 亚洲欧美日韩国产手机在线| 91亚洲大成网污www| 日韩无一区二区| 国产一区二区电影| 欧美高清hd18日本| 男女视频一区二区| 欧美日韩高清影院| 亚洲动漫第一页| 日韩女优电影在线观看| 亚洲mv在线观看| 欧美日韩国产精品成人| 香蕉久久夜色精品国产使用方法| 在线观看不卡一区| 亚洲欧洲成人精品av97| 91色综合久久久久婷婷| 一区二区三区不卡在线观看| 欧美日韩黄色影视| 日本午夜精品一区二区三区电影| 欧美日韩久久久一区| 午夜视频一区在线观看| 日韩网站在线看片你懂的| 蜜桃免费网站一区二区三区| 日韩欧美久久一区| 国产精品亚洲专一区二区三区| 国产欧美一区二区三区鸳鸯浴 | 天天操天天干天天综合网| 欧美日韩在线亚洲一区蜜芽|