form.java

来自「欢迎使用 FastJsp 开发框架! 编译说明: * 若要生成Api J」· Java 代码 · 共 86 行

JAVA
86
字号
// Copyright 2005-2007 onetsoft.com
//
// 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 com.onetsoft.fastjsp;

import com.onetsoft.fastjsp.valid.FieldValidator;

/**
 * 表单配置类接口
 * 注:现对于同一页面,表单是由状态的。
 *
 * @author <a href="mailto:hgw@onetsoft.com">hgw</a>
 */
public interface Form {

    /**
     * 取得本表单名称
     * 此名称应与客户表单隐藏域form传入的名称完全相同
     * 注意区分大小写
     *
     * @return
     */
    String getName();

    /**
     * 取得本表单域验证
     * 警告:此验证配置运行时将有状态保存,不能静态化此配置
     * 注:
     * 1.此验证配置可通过方法{@link AbstractFormAction#isBypassFormFieldValidation()} 忽略
     * 2.页面以此生成js验证。若要实现自定义验证,建议实现{@link AbstractFormAction#validate()}方法或在action中为表单执行结果生成验证
     * 3.Action执行过程中的验证顺序:a:顺序执行此验证数组 b:执行{@link com.onetsoft.fastjsp.AbstractFormAction#validate()}自定义验证
     * 4.此数组可包含null元素
     * @return
     */
    FieldValidator[] getFieldValidators();

    /**
     * 是否开启客户端表单域Javascript验证
     *
     * @return
     */
    boolean isClientValidationEnabled();

    /**
     * 在页码呈现时是否"focus"表单域
     *
     * @return
     */
    boolean isFocus();

    /**
     * 获取当前页面
     *
     * @return
     * @since 3.0
     */
    Page getPage();

    /**
     * 是否缺省action优先执行
     * 若配置为true,则将首先尝试执行缺省action ,若不存在则再尝试执行指定action
     * 注:每次表单请求仅Action执行一次
     * @since 3.0
     * @return   default:false
     * @see #getDefaultAction()
     */
    boolean isDefaultActionPreferred();

    /**
     * 取得本表单缺省action
     * @return
     * @since 3.0
     */
    String getDefaultAction();
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?