/** Parses from the specified reader. * * @param extension the default extension if doc (of reader) doesn't specify * an language. Ignored if null. * If extension is null and the content doesn't specify a language, * the language called "xul/html" is assumed. */ public PageDefinition parse(Reader reader, String extension) throws Exception { //if (log.isDebugEnabled()) log.debug("Parsing "+reader); return parse(TreeBuilderFactory.makeBuilder(extension).parse(reader), extension); }
/** Parses the specified file. * * @param path the request path. * It is used as {@link org.zkoss.zk.ui.Page#getRequestPath}, or null * if not available. */ public PageDefinition parse(File file, String path) throws Exception { //if (log.isDebugEnabled()) log.debug("Parsing "+file); String extension = Servlets.getExtension(file.getName()); final PageDefinition pgdef = parse(TreeBuilderFactory.makeBuilder(extension).parse(file), extension); pgdef.setRequestPath(path); return pgdef; }
/** Parses the specified URL. * * @param path the request path. * It is used as {@link org.zkoss.zk.ui.Page#getRequestPath}, or null * if not available. */ public PageDefinition parse(URL url, String path) throws Exception { //if (log.isDebugEnabled()) log.debug("Parsing "+url); String extension = Servlets.getExtension(url.toExternalForm()); final PageDefinition pgdef = parse(TreeBuilderFactory.makeBuilder(extension).parse(url), extension); pgdef.setRequestPath(path); return pgdef; }