📄 variables.java
字号:
/* 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -