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 Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    checkVersion(URL url, org.zkoss.idom.Document doc)
    Checks and returns whether the loaded document's version is correct.
    static boolean
    checkVersion(URL url, org.zkoss.idom.Document doc, boolean zk5required)
    Checks and returns whether the loaded document's version is correct.
    void
    parse(InputStream is, Configuration config, org.zkoss.util.resource.Locator locator)
    Parses zk.xml from an input stream into the configuration.
    void
    parse(URL url, Configuration config, org.zkoss.util.resource.Locator locator)
    Parses zk.xml, specified by url, into the configuration.
    void
    parse(org.zkoss.idom.Element root, Configuration config, org.zkoss.util.resource.Locator locator)
    Parses zk.xml, specified by the root element.
    void
    Parses metainfo/zk/config.xml placed in class-path.
    static void
    parseLibProperty(org.zkoss.idom.Element el)
    Internal use only

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ConfigParser

      public ConfigParser()
  • Method Details

    • checkVersion

      public static boolean checkVersion(URL url, org.zkoss.idom.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, org.zkoss.idom.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, org.zkoss.util.resource.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, org.zkoss.util.resource.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(org.zkoss.idom.Element root, Configuration config, org.zkoss.util.resource.Locator locator) throws Exception
      Parses zk.xml, specified by the root element.
      Throws:
      Exception
      Since:
      3.0.1
    • parseLibProperty

      public static void parseLibProperty(org.zkoss.idom.Element el)
      Internal use only