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

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

?? formbeanconfig.java

?? struts的源代碼
?? JAVA
字號:
/*
 * $Id: FormBeanConfig.java 54929 2004-10-16 16:38:42Z germuska $ 
 *
 * Copyright 1999-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.config;


import java.io.Serializable;
import java.util.HashMap;
import org.apache.commons.beanutils.DynaBean;
import org.apache.commons.beanutils.MutableDynaClass;
import org.apache.struts.action.DynaActionForm;
import org.apache.struts.action.DynaActionFormClass;
import org.apache.struts.action.ActionServlet;
import org.apache.struts.action.ActionForm;
import org.apache.struts.validator.BeanValidatorForm;


/**
 * <p>A JavaBean representing the configuration information of a
 * <code>&lt;form-bean&gt;</code> element in a Struts
 * configuration file.<p>
 *
 * @version $Rev: 54929 $ $Date: 2004-10-16 17:38:42 +0100 (Sat, 16 Oct 2004) $
 * @since Struts 1.1
 */

public class FormBeanConfig implements Serializable {


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


    /**
     * Has this component been completely configured?
     */
    protected boolean configured = false;


    /**
     * The set of FormProperty elements defining dynamic form properties for
     * this form bean, keyed by property name.
     */
    protected HashMap formProperties = new HashMap();


    /**
     * <p>The lockable object we can synchronize on when creating DynaActionFormClass.</p>
     */
    protected String lock = "";


    // ------------------------------------------------------------- Properties


    /**
     * The DynaActionFormClass associated with a DynaActionForm.
     */
    protected transient DynaActionFormClass dynaActionFormClass;

    /**
     * <p>Return the DynaActionFormClass associated with a DynaActionForm.</p>
     *
     * @exception IllegalArgumentException if the ActionForm is not dynamic
     */
    public DynaActionFormClass getDynaActionFormClass() {

        if (dynamic == false) {
            throw new IllegalArgumentException("ActionForm is not dynamic");
        }
        synchronized (lock) {
            if (dynaActionFormClass == null) {
                dynaActionFormClass = new DynaActionFormClass(this);
            }
        }
        return dynaActionFormClass;
    }


    /**
     * Is the form bean class an instance of DynaActionForm with dynamic
     * properties?
     */
    protected boolean dynamic = false;

    public boolean getDynamic() {
        return (this.dynamic);
    }

    /**
     * @deprecated The value to be returned by <code>getDynamic()</code>
     * is now computed automatically in <code>setType()</code>
     */
    public void setDynamic(boolean dynamic) {
        if (configured) {
            throw new IllegalStateException("Configuration is frozen"); 
        }
        ; // No action required
    }

    /**
     * The unique identifier of this form bean, which is used to reference this
     * bean in <code>ActionMapping</code> instances as well as for the name of
     * the request or session attribute under which the corresponding form bean
     * instance is created or accessed.
     */
    protected String name = null;

    public String getName() {
        return (this.name);
    }

    public void setName(String name) {
        if (configured) {
            throw new IllegalStateException("Configuration is frozen");
        }
        this.name = name;
    }


    /**
     * The fully qualified Java class name of the implementation class
     * to be used or generated.
     */
    protected String type = null;

    public String getType() {
        return (this.type);
    }

    public void setType(String type) {
        if (configured) {
            throw new IllegalStateException("Configuration is frozen");
        }
        this.type = type;
        Class dynaBeanClass = DynaActionForm.class;
        Class formBeanClass = formBeanClass();
        if (formBeanClass != null) {
            if (dynaBeanClass.isAssignableFrom(formBeanClass)) {
                this.dynamic = true;
            } else {
                this.dynamic = false;
            }
        } else {
            this.dynamic = false;
        }
    }

    /**
     * Is this DynaClass currently restricted (for DynaBeans with a MutableDynaClass).
     */
    protected boolean restricted = false;

    /**
     * <p>Indicates whether a MutableDynaClass is currently restricted.</p>
     * <p>If so, no changes to the existing registration of property names, 
     *    data types, readability, or writeability are allowed.</p>
     */
    public boolean isRestricted() {
        return restricted;
    }

    /**
     * <p>Set whether a MutableDynaClass is currently restricted.</p>
     * <p>If so, no changes to the existing registration of property names, 
     *    data types, readability, or writeability are allowed.</p>
     */
    public void setRestricted(boolean restricted) {
        this.restricted = restricted;
    }


    // --------------------------------------------------------- Public Methods


    /**
     * <p>Create and return an <code>ActionForm</code> instance appropriate
     * to the information in this <code>FormBeanConfig</code>.</p>
     *
     * @param servlet The action servlet
     * @return ActionForm instance
     * @exception IllegalAccessException if the Class or the appropriate
     *  constructor is not accessible
     * @exception InstantiationException if this Class represents an abstract
     *  class, an array class, a primitive type, or void; or if instantiation
     *  fails for some other reason
     */
    public ActionForm createActionForm(ActionServlet servlet)
        throws IllegalAccessException, InstantiationException {

        Object obj = null;

        // Create a new form bean instance
        if (getDynamic()) {
            obj = getDynaActionFormClass().newInstance();
        } else {
            obj = formBeanClass().newInstance();
        }

        ActionForm form = null;
        if (obj instanceof ActionForm) {
            form = (ActionForm)obj;
        } else  {
            form = new BeanValidatorForm(obj);
        }

        form.setServlet(servlet);

        if (form instanceof DynaBean && 
            ((DynaBean)form).getDynaClass() instanceof MutableDynaClass) {
            DynaBean         dynaBean  = (DynaBean)form;
            MutableDynaClass dynaClass = (MutableDynaClass)dynaBean.getDynaClass();

            // Add properties
            dynaClass.setRestricted(false);
            FormPropertyConfig props[] = findFormPropertyConfigs();
            for (int i = 0; i < props.length; i++) {
                dynaClass.add(props[i].getName(), props[i].getTypeClass());
                dynaBean.set(props[i].getName(), props[i].initial());
            }
            dynaClass.setRestricted(isRestricted());

        }

        return form;

    }


    /**
     * Add a new <code>FormPropertyConfig</code> instance to the set associated
     * with this module.
     *
     * @param config The new configuration instance to be added
     *
     * @exception IllegalArgumentException if this property name has already
     *  been defined
     */
    public void addFormPropertyConfig(FormPropertyConfig config) {

        if (configured) {
            throw new IllegalStateException("Configuration is frozen");
        }
        if (formProperties.containsKey(config.getName())) {
            throw new IllegalArgumentException("Property " +
                                               config.getName() +
                                               " already defined");
        }
        formProperties.put(config.getName(), config);

    }


    /**
     * Return the form property configuration for the specified property
     * name, if any; otherwise return <code>null</code>.
     *
     * @param name Form property name to find a configuration for
     */
    public FormPropertyConfig findFormPropertyConfig(String name) {

        return ((FormPropertyConfig) formProperties.get(name));

    }


    /**
     * Return the form property configurations for this module.  If there
     * are none, a zero-length array is returned.
     */
    public FormPropertyConfig[] findFormPropertyConfigs() {

        FormPropertyConfig results[] =
            new FormPropertyConfig[formProperties.size()];
        return ((FormPropertyConfig[]) formProperties.values().toArray(results));

    }


    /**
     * Freeze the configuration of this component.
     */
    public void freeze() {

        configured = true;

        FormPropertyConfig[] fpconfigs = findFormPropertyConfigs();
        for (int i = 0; i < fpconfigs.length; i++) {
            fpconfigs[i].freeze();
        }

    }


    /**
     * Remove the specified form property configuration instance.
     *
     * @param config FormPropertyConfig instance to be removed
     */
    public void removeFormPropertyConfig(FormPropertyConfig config) {

        if (configured) {
            throw new IllegalStateException("Configuration is frozen");
        }
        formProperties.remove(config.getName());

    }


    /**
     * Return a String representation of this object.
     */
    public String toString() {

        StringBuffer sb = new StringBuffer("FormBeanConfig[");
        sb.append("name=");
        sb.append(this.name);
        sb.append(",type=");
        sb.append(this.type);
        sb.append("]");
        return (sb.toString());

    }


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


    /**
     * Return the <code>Class</code> instance for the form bean implementation
     * configured by this <code>FormBeanConfig</code> instance.  This method
     * uses the same algorithm as <code>RequestUtils.applicationClass()</code>
     * but is reproduced to avoid a runtime dependence.
     */
    protected Class formBeanClass() {

        ClassLoader classLoader =
            Thread.currentThread().getContextClassLoader();
        if (classLoader == null) {
            classLoader = this.getClass().getClassLoader();
        }
        try {
            return (classLoader.loadClass(getType()));
        } catch (Exception e) {
            return (null);
        }

    }


}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧亚洲嫩模精品一区三区| 91香蕉视频黄| 久久一区二区视频| 国产传媒久久文化传媒| 国产欧美日韩三区| av亚洲精华国产精华精华| 国产精品高潮呻吟| 99国产精品久久久久久久久久久| 亚洲精品国产精品乱码不99| 日本久久电影网| 天天爽夜夜爽夜夜爽精品视频| 欧美一区三区四区| 蜜臀av性久久久久蜜臀aⅴ| 精品国产一区久久| 成人黄动漫网站免费app| 亚洲精品中文字幕在线观看| 欧美人妇做爰xxxⅹ性高电影| 蜜桃视频在线一区| 亚洲国产精品二十页| 久久er99热精品一区二区| 欧美激情一区二区在线| 色欧美片视频在线观看| 视频一区欧美精品| 久久日韩精品一区二区五区| www.99精品| 日韩国产欧美一区二区三区| 久久久精品免费网站| 色综合一区二区| 日韩高清一级片| 亚洲国产精品成人久久综合一区| 色婷婷精品久久二区二区蜜臀av | 一区视频在线播放| 欧美视频中文一区二区三区在线观看| 欧美aaaaa成人免费观看视频| 国产午夜精品一区二区| 在线观看一区不卡| 精久久久久久久久久久| 亚洲精品中文在线| 日韩欧美电影一区| 99久久99精品久久久久久| 午夜精品久久久| 国产欧美一区二区在线观看| 欧美自拍偷拍一区| 国产美女视频91| 亚洲午夜久久久久久久久久久| 久久综合99re88久久爱| 欧美色综合天天久久综合精品| 极品美女销魂一区二区三区 | 国产精品 欧美精品| 一区二区免费看| 久久综合狠狠综合久久综合88| 色噜噜狠狠色综合欧洲selulu| 久久成人综合网| 亚洲尤物视频在线| 国产亚洲va综合人人澡精品| 欧美亚洲综合一区| 国产91综合网| 免费亚洲电影在线| 亚洲美女免费在线| 国产亚洲综合av| 日韩无一区二区| 91黄色在线观看| 国产成人在线影院| 美女一区二区久久| 一区二区三区成人在线视频| 久久久久久久av麻豆果冻| 欧美日韩国产首页| 99久久国产综合精品麻豆 | 麻豆91精品91久久久的内涵| 亚洲三级在线播放| 久久久精品国产免费观看同学| 欧美电影影音先锋| 在线观看一区二区精品视频| 成人精品gif动图一区| 久久免费精品国产久精品久久久久| 欧美日韩一区二区在线观看视频| 成人免费黄色在线| 国产一区二区三区日韩| 日本欧美在线看| 亚洲成人av资源| 亚洲欧美激情视频在线观看一区二区三区| 色综合久久综合网欧美综合网| 一区二区三区四区高清精品免费观看| 日本一区二区三区在线观看| 精品国产欧美一区二区| 91精品国产福利在线观看| 欧美亚洲尤物久久| 91麻豆免费在线观看| 成人激情校园春色| 成人妖精视频yjsp地址| 国内精品久久久久影院薰衣草 | 国产大片一区二区| 精油按摩中文字幕久久| 日本麻豆一区二区三区视频| 午夜av区久久| 无码av中文一区二区三区桃花岛| 一区二区三区在线看| 亚洲视频你懂的| 一区在线观看视频| 亚洲天堂福利av| 亚洲素人一区二区| 综合自拍亚洲综合图不卡区| 国产精品精品国产色婷婷| 欧美激情一区二区三区全黄| 国产日韩欧美不卡在线| 久久综合给合久久狠狠狠97色69| 精品电影一区二区| 精品免费国产一区二区三区四区| 日韩视频在线你懂得| 这里只有精品电影| 欧美一区二区精品在线| 欧美一区二区三区免费在线看| 91精品国产乱码| 日韩三级av在线播放| 日韩欧美一区二区在线视频| 日韩欧美国产精品一区| 日韩免费成人网| 欧美精品一区二区三区久久久| 欧美精品一区男女天堂| 国产夜色精品一区二区av| 久久久久久麻豆| 2023国产精品视频| 国产三级一区二区三区| 久久精品亚洲麻豆av一区二区| 国产免费久久精品| 国产精品福利在线播放| 1024亚洲合集| 亚洲一区二区三区四区不卡| 日日夜夜免费精品视频| 九九九精品视频| 国产激情视频一区二区三区欧美| 国产成人在线免费| 91亚洲国产成人精品一区二区三| 91蜜桃婷婷狠狠久久综合9色| 色婷婷久久久综合中文字幕 | 欧洲精品一区二区| 欧美日韩综合在线| 91麻豆精品国产自产在线观看一区 | 欧美成人激情免费网| 久久久国产精华| 日韩一区在线看| 亚洲线精品一区二区三区| 亚洲大片精品永久免费| 亚洲电影你懂得| 日韩综合小视频| 日韩电影在线一区| 国产伦精品一区二区三区在线观看| 粉嫩嫩av羞羞动漫久久久| 91丝袜呻吟高潮美腿白嫩在线观看| 91免费观看在线| 日韩你懂的电影在线观看| 国产拍揄自揄精品视频麻豆| 亚洲精品老司机| 久久激五月天综合精品| av中文字幕亚洲| 欧美精品在线一区二区| 久久久99精品久久| 亚洲一区中文在线| 久久99精品视频| 91丝袜高跟美女视频| 欧美一区二区在线观看| 日本一区二区成人| 图片区小说区区亚洲影院| 久久aⅴ国产欧美74aaa| 99热这里都是精品| 日韩西西人体444www| 国产精品高清亚洲| 麻豆视频观看网址久久| 成人听书哪个软件好| 欧美男女性生活在线直播观看| 国产亚洲成年网址在线观看| 香蕉久久一区二区不卡无毒影院| 国产一区二三区| 欧美色图免费看| 日本一区二区三区四区| 天堂一区二区在线免费观看| 粉嫩蜜臀av国产精品网站| 9191成人精品久久| 最新不卡av在线| 国产一区二区成人久久免费影院| 欧美影片第一页| 国产人久久人人人人爽| 日韩av一区二区三区| 99久久精品国产导航| 26uuu久久综合| 午夜精品一区二区三区免费视频| 丁香天五香天堂综合| 欧美一级欧美一级在线播放| 中文字幕色av一区二区三区| 蜜桃久久av一区| 色国产综合视频| 中文字幕乱码日本亚洲一区二区 | 久久99国产精品久久99果冻传媒| 91福利小视频| 国产午夜精品一区二区三区四区| 无吗不卡中文字幕| 91麻豆免费观看| 欧美激情中文字幕一区二区| 久久99精品国产麻豆婷婷洗澡| 欧美老肥妇做.爰bbww视频|