Package org.zkoss.zk.ui.sys
Class ConfigParser
- java.lang.Object
-
- org.zkoss.zk.ui.sys.ConfigParser
-
public class ConfigParser extends java.lang.Object
Used to parse WEB-INF/zk.xml, metainfo/zk/zk.xml and metainfo/zk/config.xml intoConfiguration
.- Author:
- tomyeh
-
-
Constructor Summary
Constructors Constructor Description ConfigParser()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
checkVersion(java.net.URL url, Document doc)
Checks and returns whether the loaded document's version is correct.static boolean
checkVersion(java.net.URL url, Document doc, boolean zk5required)
Checks and returns whether the loaded document's version is correct.void
parse(java.io.InputStream is, Configuration config, Locator locator)
Parses zk.xml from an input stream into the configuration.void
parse(java.net.URL url, Configuration config, Locator locator)
Parses zk.xml, specified by url, into the configuration.void
parse(Element root, Configuration config, Locator locator)
Parses zk.xml, specified by the root element.void
parseConfigXml(Configuration config)
Parses metainfo/zk/config.xml placed in class-path.static void
parseLibProperty(Element el)
Internal use only
-
-
-
Method Detail
-
checkVersion
public static boolean checkVersion(java.net.URL url, Document doc) throws java.lang.Exception
Checks and returns whether the loaded document's version is correct. It is the same as checkVersion(url, doc, false).- Throws:
java.lang.Exception
- Since:
- 3.5.0
-
checkVersion
public static boolean checkVersion(java.net.URL url, Document doc, boolean zk5required) throws java.lang.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:
java.lang.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(java.net.URL url, Configuration config, Locator locator) throws java.lang.Exception
Parses zk.xml, specified by url, into the configuration.- Parameters:
url
- the URL of zk.xml.- Throws:
java.lang.Exception
-
parse
public void parse(java.io.InputStream is, Configuration config, Locator locator) throws java.lang.Exception
Parses zk.xml from an input stream into the configuration.- Parameters:
is
- the input stream of zk.xml- Throws:
java.lang.Exception
- Since:
- 5.0.7
-
parse
public void parse(Element root, Configuration config, Locator locator) throws java.lang.Exception
Parses zk.xml, specified by the root element.- Throws:
java.lang.Exception
- Since:
- 3.0.1
-
parseLibProperty
public static void parseLibProperty(Element el)
Internal use only
-
-