resourcetype.java

来自「OBPM是一个开源」· Java 代码 · 共 52 行

JAVA
52
字号
package cn.myapps.core.resource.ejb;

public class ResourceType {
	
	
	public static final String ACTION_TYPE_NONE = "00";
	public static final String ACTION_TYPE_VIEW = "01";
	public static final String ACTION_TYPE_ACTIONCLASS = "02";
	public static final String ACTION_TYPE_OTHERURL = "03";
	
	public static final String RESOURCE_TYPE_MENU = "00";
	public static final String RESOURCE_TYPE_PAGE = "01";
	
	public static final String ISPROTECTED_YES = "yes";
	public static final String ISPROTECTED_NO = "no";
	
	public static final String[] TYPES = { "", "00", "01" };

	public static final String[] NAMES = { "", "menu", "page" };

	/**
	 * Get the type name.
	 * @param type The type.
	 * @return The type name.
	 */
	public static String getName(String type) {
		if (type == null)
			return null;

		for (int i = 0; i < TYPES.length; i++)
			if (type.equals(TYPES[i]))
				return NAMES[i];

		return "";
	}

	/**
	 * Get the type code.
	 * @param name The type name.
	 * @return The type code.
	 */
	public static String getType(String name) {
		if (name == null)
			return null;

		for (int i = 0; i < NAMES.length; i++)
			if (name.equals(TYPES[i]))
				return TYPES[i];

		return "";
	}
}

⌨️ 快捷键说明

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