Package org.zkoss.zk.ui.sys
Class ConfigParser
java.lang.Object
org.zkoss.zk.ui.sys.ConfigParser
Used to parse WEB-INF/zk.xml, metainfo/zk/zk.xml
and metainfo/zk/config.xml into
Configuration.- Author:
- tomyeh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckVersion(URL url, org.zkoss.idom.Document doc) Checks and returns whether the loaded document's version is correct.static booleancheckVersion(URL url, org.zkoss.idom.Document doc, boolean zk5required) Checks and returns whether the loaded document's version is correct.voidparse(InputStream is, Configuration config, org.zkoss.util.resource.Locator locator) Parses zk.xml from an input stream into the configuration.voidparse(URL url, Configuration config, org.zkoss.util.resource.Locator locator) Parses zk.xml, specified by url, into the configuration.voidparse(org.zkoss.idom.Element root, Configuration config, org.zkoss.util.resource.Locator locator) Parses zk.xml, specified by the root element.voidparseConfigXml(Configuration config) Parses metainfo/zk/config.xml placed in class-path.static voidparseLibProperty(org.zkoss.idom.Element el) Internal use only
-
Constructor Details
-
ConfigParser
public ConfigParser()
-
-
Method Details
-
checkVersion
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
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
-