Class ConfigParser

java.lang.Object
org.zkoss.zk.ui.sys.ConfigParser

public class ConfigParser extends Object
Used to parse WEB-INF/zk.xml, metainfo/zk/zk.xml and metainfo/zk/config.xml into Configuration.
Author:
tomyeh
  • Constructor Details

    • ConfigParser

      public ConfigParser()
  • Method Details

    • checkVersion

      public static boolean checkVersion(URL url, Document doc) throws Exception
      Checks and returns whether the loaded document's version is correct. It is the same as checkVersion(url, doc, false).
      Throws:
      Exception
      Since:
      3.5.0
    • checkVersion

      public static boolean checkVersion(URL url, Document doc, boolean zk5required) throws Exception
      Checks and returns whether the loaded document's version is correct.
      Parameters:
      zk5required - whether ZK 5 or later is required. If true and zk-version is earlier than 5, doc will be ignored (and false is returned).
      Throws:
      Exception
      Since:
      5.0.0
    • parseConfigXml

      public void parseConfigXml(Configuration config)
      Parses metainfo/zk/config.xml placed in class-path.

      Note: the application-independent configurations (a.k.a., the system default configurations) are loaded only once, no matter how many times this method is called.

      Parameters:
      config - the object to store configurations. If null, only the application-independent configurations are parsed.
      Since:
      3.5.0
    • parse

      public void parse(URL url, Configuration config, Locator locator) throws Exception
      Parses zk.xml, specified by url, into the configuration.
      Parameters:
      url - the URL of zk.xml.
      Throws:
      Exception
    • parse

      public void parse(InputStream is, Configuration config, Locator locator) throws Exception
      Parses zk.xml from an input stream into the configuration.
      Parameters:
      is - the input stream of zk.xml
      Throws:
      Exception
      Since:
      5.0.7
    • parse

      public void parse(Element root, Configuration config, Locator locator) throws Exception
      Parses zk.xml, specified by the root element.
      Throws:
      Exception
      Since:
      3.0.1
    • parseLibProperty

      public static void parseLibProperty(Element el)
      Internal use only