org.zkoss.zk.ui.metainfo.page.Loader.class

From Documentation
Revision as of 08:54, 3 December 2010 by Char (talk | contribs) (Created page with ' {{ZKConfigurationReferencePageHeader}} Default: <i>none</i> [since 5.0.4] It specifies the name of the class used to load the page definitions. The class must implement the …')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


org.zkoss.zk.ui.metainfo.page.Loader.class


Default: none
[since 5.0.4]

It specifies the name of the class used to load the page definitions. The class must implement the Loader interface and it must have a constructor as follows.

public FooLoader(org.zkoss.zk.ui.WebApp wapp) { //assume FooLoader is the implementation class
     ...

The default iimplementation is straightforward:

private static class MyLoader extends org.zkoss.web.util.resource.ResourceLoader {
	private final WebApp _wapp;
	private MyLoader(WebApp wapp) {
		_wapp = wapp;
	}

	//-- super --//
	protected Object parse(String path, File file, Object extra)
	throws Exception {
		final Locator locator =
			extra != null ? (Locator)extra: getLocator(_wapp, path);
		return new Parser(_wapp, locator).parse(file, path);
	}
	protected Object parse(String path, URL url, Object extra)
	throws Exception {
		final Locator locator =
			extra != null ? (Locator)extra: getLocator(_wapp, path);
		return new Parser(_wapp, locator).parse(url, path);
	}
}



Last Update : 2010/12/03

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.