Class Interpreters

java.lang.Object
org.zkoss.zk.scripting.Interpreters

public class Interpreters extends Object
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 Details

    • newInterpreter

      public static final Interpreter newInterpreter(String zslang, Page owner)
      Returns the interpreter for the specified language name.
      Parameters:
      zslang - the name of the scripting language, say, Java.
      Throws:
      InterpreterNotFoundException - if not found.
    • exists

      public static final boolean exists(String zslang)
      Tests whether the interpreter for the specified language name exists.
      Parameters:
      zslang - the name of the scripting language, say, Java.
    • getZScriptLanguages

      public static final Set<String> getZScriptLanguages()
      Returns a set of names of the scripting languages supported by this installation.
    • add

      public static final String add(String zslang, String ipcls)
      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

      public static final String add(org.zkoss.idom.Element config)
      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.