component.java

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

JAVA
109
字号
// 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.request.PageData;
import com.onetsoft.fastjsp.valid.ValidationDelegate;

/**
 * 定义组件接口
 * 同一组件在同一页面中只能实际使用一次
 *
 * @author <a href="mailto:hgw@onetsoft.com">hgw</a>
 */
public interface Component {

    /**
     * 取得表单JavaScript支持
     * 应在需要js支持的表单后调用此方法
     *
     * @param formName
     * @return
     */
    String getScriptSupport(String formName);

    /**
     * 取得页面i18n国际化字符串资源
     *
     * @return
     */
    Messages getMessages();


    /**
     * 取得页面内的某组件
     * 注:若没有,则返回null
     *
     * @param clazz
     * @return
     */
    Component getComponent(Class clazz);

    /**
     * 取得验证代理
     * 通过此取得表单验证错误信息
     *
     * @return
     */
    ValidationDelegate getValidationDelegate();

    /**
     * 取得当前页面
     *
     * @return
     */
    Page getPage();

    /**
     * 取得页面数据
     *
     * @return
     */
    PageData getData();

    /**
     * 取得 page cycle
     *
     * @return
     */
    PageCycle getCycle();

    /**
     * 取得当前页面的url link
     *
     * @return
     */
    Link getLink();

    /**
     * 当前布局范围内的页面链接
     *
     * @param pageName e.g:"index"    注:不包括页面扩展名
     * @return
     */
    Link getLink(String pageName);

    /**
     * 指定布局范围内的链接
     *
     * @param layoutModule
     * @param pageName
     * @return
     */
    Link getLink(PageModule layoutModule, String pageName);

 
    
}

⌨️ 快捷键说明

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