variables.java
来自「非常接近C/S操作方式的Java Ajax框架-ZK 用ZK框架使你的B/S应」· Java 代码 · 共 71 行
JAVA
71 行
/* Variables.java{{IS_NOTE Purpose: Description: History: Tue Aug 2 15:03:50 2005, Created by tomyeh}}IS_NOTECopyright (C) 2005 Potix Corporation. All Rights Reserved.{{IS_RIGHT This program is distributed under GPL Version 2.0 in the hope that it will be useful, but WITHOUT ANY WARRANTY.}}IS_RIGHT*/package org.zkoss.zk.ui.sys;import java.util.Set;import java.util.HashSet;import java.util.Collections;/** * variables utilities. * * @author tomyeh */public class Variables { private Variables() {} private static final Set _reves; static { Set reves = new HashSet(); final String[] rs = new String[] { "arg", "desktop", "event", "page", "self", "session", "spaceOwner" }; for (int j = rs.length; --j >=0;) reves.add(rs[j]); _reves = Collections.unmodifiableSet(reves); } /** Returns a set of readonly reserved words. */ public static final Set getReservedNames() { return _reves; } /** Returns whether the specified is valid. * It also invokes {@link #isReserved}. */ public static final boolean isValid(String name) { if (ComponentsCtrl.isAutoId(name) || isReserved(name)) return false; for (int j = name.length(); --j >= 0;) { final char cc = name.charAt(j); if ((cc < '0' || cc > '9') && (cc < 'a' || cc > 'z') && (cc < 'A' || cc > 'Z') && cc != '_') return false; } return true; } /** Returns whether the specified name is reserved. * If true, you cannot use it in BSH (and EL). */ public static final boolean isReserved(String name) { return _reves.contains(name); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?