Package org.zkoss.zk.scripting
Class Interpreters
java.lang.Object
org.zkoss.zk.scripting.Interpreters
The utilities to access interpreters (
Interpreter).
Application developers and deployers rarely need to access this class directly. Rather, they can declare the interpreter class in either zk/config.xml or WEB-INF/zk.xml.
- Author:
- tomyeh
-
Method Summary
Modifier and TypeMethodDescriptionstatic final StringAdds an interpreter class.static final Stringadd(org.zkoss.idom.Element config) Adds an interpreter based on the XML declaration.static final booleanTests whether the interpreter for the specified language name exists.Returns a set of names of the scripting languages supported by this installation.static booleanisLegalName(char cc) Tests whether a character is legal to be used as part of the scripting language name.static final InterpreternewInterpreter(String zslang, Page owner) Returns the interpreter for the specified language name.
-
Method Details
-
newInterpreter
Returns the interpreter for the specified language name.- Parameters:
zslang- the name of the scripting language, say, Java.- Throws:
InterpreterNotFoundException- if not found.
-
exists
Tests whether the interpreter for the specified language name exists.- Parameters:
zslang- the name of the scripting language, say, Java.
-
getZScriptLanguages
Returns a set of names of the scripting languages supported by this installation. -
add
Adds an interpreter class.- Parameters:
zslang- the name of the scripting language, say, Java. It is case insensitive.ipcls- the class name of interpreter (Interpreter).- Returns:
- the previous class name, or null if not defined yet
-
add
Adds an interpreter based on the XML declaration.<zscript-config> <language-name>SuperJava</language-name><!-- case insensitive --!> <interpreter-class>my.MySuperJavaInterpreter</interpreter-class> </zscript-config>- Parameters:
config- the XML element called zscript-config- Returns:
- the previous class, or null if not defined yet
-
isLegalName
public static boolean isLegalName(char cc) Tests whether a character is legal to be used as part of the scripting language name.
-