⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 formutils.java

📁 OPIAM stands for Open Identity and Access Management. This Suite will provide modules for user & rig
💻 JAVA
字号:
/*
 * OPIAM Suite
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */

package opiam.admin.faare.struts.utils;

import java.util.ArrayList;
import java.util.StringTokenizer;

/**
 * This class contains utility methods for HTML forms processing.
 */

public final class FormUtils
{
    /** Utility class. */
    private FormUtils()
    {
    }

    /**
     * This method must be called by an edition FormBean to get the values of
     * a multivalued attribute filled by the MultiEdit tag.
     *
     * @param desc value gor from the form
     * @return list of values of the attribute
     */
    public static ArrayList getMultiVal(String desc)
    {
        if (desc.trim().equals(""))
        {
            return null;
        }

        desc = desc.substring(1);

        StringTokenizer tok = new StringTokenizer(desc, "#");
        ArrayList vals = new ArrayList();

        while (tok.hasMoreTokens())
        {
            String aval = tok.nextToken();

            if (!aval.trim().equals(""))
            {
                vals.add(aval);
            }
        }

        if (vals.size() == 0)
        {
            vals = null;
        }

        return vals;
    }
}

⌨️ 快捷键说明

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