• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TreeNode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.jasper.xmlparser.TreeNode的典型用法代码示例。如果您正苦于以下问题:Java TreeNode类的具体用法?Java TreeNode怎么用?Java TreeNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TreeNode类属于org.apache.jasper.xmlparser包,在下文中一共展示了TreeNode类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createInitParam

import org.apache.jasper.xmlparser.TreeNode; //导入依赖的package包/类
String[] createInitParam(TreeNode elem) {
    String[] initParam = new String[2];

    Iterator<TreeNode> list = elem.findChildren();
    while (list.hasNext()) {
        TreeNode element = list.next();
        String tname = element.getName();
        if ("param-name".equals(tname)) {
            initParam[0] = element.getBody();
        } else if ("param-value".equals(tname)) {
            initParam[1] = element.getBody();
        } else if ("description".equals(tname)) {
             // Do nothing
        } else {
            if (log.isWarnEnabled()) {
                log.warn(Localizer.getMessage(
                        "jsp.warning.unknown.element.in.initParam", tname));
            }
        }
    }
    return initParam;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:23,代码来源:TagLibraryInfoImpl.java


示例2: createInitParam

import org.apache.jasper.xmlparser.TreeNode; //导入依赖的package包/类
String[] createInitParam(TreeNode elem) {
    String[] initParam = new String[2];

    Iterator list = elem.findChildren();
    while (list.hasNext()) {
        TreeNode element = (TreeNode) list.next();
        String tname = element.getName();
        if ("param-name".equals(tname)) {
            initParam[0] = element.getBody();
        } else if ("param-value".equals(tname)) {
            initParam[1] = element.getBody();
        } else if ("description".equals(tname)) {
            ; // Do nothing
        } else {
            log.warn(Localizer.getMessage(
                        "jsp.warning.unknown.element.in.initParam", tname));
        }
    }
    return initParam;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:TagLibraryInfoImpl.java


示例3: createInitParam

import org.apache.jasper.xmlparser.TreeNode; //导入依赖的package包/类
String[] createInitParam(TreeNode elem) {
	String[] initParam = new String[2];

	Iterator<TreeNode> list = elem.findChildren();
	while (list.hasNext()) {
		TreeNode element = list.next();
		String tname = element.getName();
		if ("param-name".equals(tname)) {
			initParam[0] = element.getBody();
		} else if ("param-value".equals(tname)) {
			initParam[1] = element.getBody();
		} else if ("description".equals(tname)) {
			// Do nothing
		} else {
			if (log.isWarnEnabled()) {
				log.warn(Localizer.getMessage("jsp.warning.unknown.element.in.initParam", tname));
			}
		}
	}
	return initParam;
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:22,代码来源:TagLibraryInfoImpl.java


示例4: createInitParam

import org.apache.jasper.xmlparser.TreeNode; //导入依赖的package包/类
private String[] createInitParam(TreeNode elem) throws JasperException {

        String[] initParam = new String[2];
        
        Iterator list = elem.findChildren();
        while (list.hasNext()) {
            TreeNode element = (TreeNode) list.next();
            String tname = element.getName();
            if ("param-name".equals(tname)) {
                initParam[0] = element.getBody();
            } else if ("param-value".equals(tname)) {
                initParam[1] = element.getBody();
            } else if ("description".equals(tname)) {
                ; // Do nothing
            } else {
                err.jspError("jsp.error.unknown.element.in.initParam",
                             tname);
	    }
        }
	return initParam;
    }
 
开发者ID:eclipse,项目名称:packagedrone,代码行数:22,代码来源:TagLibraryInfoImpl.java


示例5: getVersion

import org.apache.jasper.xmlparser.TreeNode; //导入依赖的package包/类
private double getVersion(TreeNode webApp) {
    String v = webApp.findAttribute("version");
    if (v != null) {
        try {
            return Double.parseDouble(v);
        } catch (NumberFormatException e) {
        }
    }
    return 2.3;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:11,代码来源:JspConfig.java


示例6: createFunctionInfo

import org.apache.jasper.xmlparser.TreeNode; //导入依赖的package包/类
FunctionInfo createFunctionInfo(TreeNode elem) {

        String name = null;
        String klass = null;
        String signature = null;

        Iterator<TreeNode> list = elem.findChildren();
        while (list.hasNext()) {
            TreeNode element = list.next();
            String tname = element.getName();

            if ("name".equals(tname)) {
                name = element.getBody();
            } else if ("function-class".equals(tname)) {
                klass = element.getBody();
            } else if ("function-signature".equals(tname)) {
                signature = element.getBody();
            } else if ("display-name".equals(tname) || // Ignored elements
                    "small-icon".equals(tname) || "large-icon".equals(tname)
                    || "description".equals(tname) || "example".equals(tname)) {
            } else {
                if (log.isWarnEnabled()) {
                    log.warn(Localizer.getMessage(
                            "jsp.warning.unknown.element.in.function", tname));
                }
            }
        }

        return new FunctionInfo(name, klass, signature);
    }
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:31,代码来源:TagLibraryInfoImpl.java


示例7: getUriFromTld

import org.apache.jasper.xmlparser.TreeNode; //导入依赖的package包/类
private String getUriFromTld(String resourcePath, InputStream in) 
    throws JasperException
{
    // Parse the tag library descriptor at the specified resource path
    TreeNode tld = new ParserUtils().parseXMLDocument(resourcePath, in);
    TreeNode uri = tld.findChild("uri");
    if (uri != null) {
        String body = uri.getBody();
        if (body != null)
            return body;
    }

    return null;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:TldLocationsCache.java


示例8: createFunctionInfo

import org.apache.jasper.xmlparser.TreeNode; //导入依赖的package包/类
FunctionInfo createFunctionInfo(TreeNode elem) {

        String name = null;
        String klass = null;
        String signature = null;

        Iterator list = elem.findChildren();
        while (list.hasNext()) {
            TreeNode element = (TreeNode) list.next();
            String tname = element.getName();

            if ("name".equals(tname)) {
                name = element.getBody();
            } else if ("function-class".equals(tname)) {
                klass = element.getBody();
            } else if ("function-signature".equals(tname)) {
                signature = element.getBody();
            } else if ("display-name".equals(tname) || // Ignored elements
                    "small-icon".equals(tname) || "large-icon".equals(tname)
                    || "description".equals(tname) || "example".equals(tname)) {
            } else {
                log.warn(Localizer.getMessage(
                            "jsp.warning.unknown.element.in.function", tname));
            }
        }

        return new FunctionInfo(name, klass, signature);
    }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:29,代码来源:TagLibraryInfoImpl.java


示例9: getVersion

import org.apache.jasper.xmlparser.TreeNode; //导入依赖的package包/类
private double getVersion(TreeNode webApp) {
	String v = webApp.findAttribute("version");
	if (v != null) {
		try {
			return Double.parseDouble(v);
		} catch (NumberFormatException e) {
		}
	}
	return 2.3;
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:11,代码来源:JspConfig.java


示例10: tldScanStream

import org.apache.jasper.xmlparser.TreeNode; //导入依赖的package包/类
private void tldScanStream(String resourcePath, String entryName, InputStream stream) throws IOException {
	try {
		// Parse the tag library descriptor at the specified resource path
		String uri = null;

		boolean validate = Boolean.parseBoolean(ctxt.getInitParameter(Constants.XML_VALIDATION_TLD_INIT_PARAM));
		String blockExternalString = ctxt.getInitParameter(Constants.XML_BLOCK_EXTERNAL_INIT_PARAM);
		boolean blockExternal;
		if (blockExternalString == null) {
			blockExternal = true;
		} else {
			blockExternal = Boolean.parseBoolean(blockExternalString);
		}

		ParserUtils pu = new ParserUtils(validate, blockExternal);
		TreeNode tld = pu.parseXMLDocument(resourcePath, stream);
		TreeNode uriNode = tld.findChild("uri");
		if (uriNode != null) {
			String body = uriNode.getBody();
			if (body != null)
				uri = body;
		}

		// Add implicit map entry only if its uri is not already
		// present in the map
		if (uri != null && mappings.get(uri) == null) {
			TldLocation location;
			if (entryName == null) {
				location = new TldLocation(resourcePath);
			} else {
				location = new TldLocation(entryName, resourcePath);
			}
			mappings.put(uri, location);
		}
	} catch (JasperException e) {
		// Hack - makes exception handling simpler
		throw new IOException(e);
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:40,代码来源:TldLocationsCache.java


示例11: createTagFileInfo

import org.apache.jasper.xmlparser.TreeNode; //导入依赖的package包/类
private TagFileInfo createTagFileInfo(TreeNode elem, JarResource jarResource) throws JasperException {

		String name = null;
		String path = null;

		Iterator<TreeNode> list = elem.findChildren();
		while (list.hasNext()) {
			TreeNode child = list.next();
			String tname = child.getName();
			if ("name".equals(tname)) {
				name = child.getBody();
			} else if ("path".equals(tname)) {
				path = child.getBody();
			} else if ("example".equals(tname)) {
				// Ignore <example> element: Bugzilla 33538
			} else if ("tag-extension".equals(tname)) {
				// Ignore <tag-extension> element: Bugzilla 33538
			} else if ("icon".equals(tname) || "display-name".equals(tname) || "description".equals(tname)) {
				// Ignore these elements: Bugzilla 38015
			} else {
				if (log.isWarnEnabled()) {
					log.warn(Localizer.getMessage("jsp.warning.unknown.element.in.tagfile", tname));
				}
			}
		}

		if (path.startsWith("/META-INF/tags")) {
			// Tag file packaged in JAR
			// See https://bz.apache.org/bugzilla/show_bug.cgi?id=46471
			// This needs to be removed once all the broken code that depends on
			// it has been removed
			ctxt.setTagFileJarResource(path, jarResource);
		} else if (!path.startsWith("/WEB-INF/tags")) {
			err.jspError("jsp.error.tagfile.illegalPath", path);
		}

		TagInfo tagInfo = TagFileProcessor.parseTagFileDirectives(parserController, name, path, jarResource, this);
		return new TagFileInfo(name, path, tagInfo);
	}
 
开发者ID:how2j,项目名称:lazycat,代码行数:40,代码来源:TagLibraryInfoImpl.java


示例12: createFunctionInfo

import org.apache.jasper.xmlparser.TreeNode; //导入依赖的package包/类
FunctionInfo createFunctionInfo(TreeNode elem) {

		String name = null;
		String klass = null;
		String signature = null;

		Iterator<TreeNode> list = elem.findChildren();
		while (list.hasNext()) {
			TreeNode element = list.next();
			String tname = element.getName();

			if ("name".equals(tname)) {
				name = element.getBody();
			} else if ("function-class".equals(tname)) {
				klass = element.getBody();
			} else if ("function-signature".equals(tname)) {
				signature = element.getBody();
			} else if ("display-name".equals(tname) || // Ignored elements
					"small-icon".equals(tname) || "large-icon".equals(tname) || "description".equals(tname)
					|| "example".equals(tname)) {
			} else {
				if (log.isWarnEnabled()) {
					log.warn(Localizer.getMessage("jsp.warning.unknown.element.in.function", tname));
				}
			}
		}

		return new FunctionInfo(name, klass, signature);
	}
 
开发者ID:how2j,项目名称:lazycat,代码行数:30,代码来源:TagLibraryInfoImpl.java


示例13: createFunctionInfo

import org.apache.jasper.xmlparser.TreeNode; //导入依赖的package包/类
private FunctionInfo createFunctionInfo(TreeNode elem)
        throws JasperException {

    String name = null;
    String klass = null;
    String signature = null;

    Iterator list = elem.findChildren();
    while (list.hasNext()) {
        TreeNode element = (TreeNode) list.next();
        String tname = element.getName();

        if ("name".equals(tname)) {
            name = element.getBody();
        } else if ("function-class".equals(tname)) {
            klass = element.getBody();
        } else if ("function-signature".equals(tname)) {
            signature = element.getBody();
        } else if ("display-name".equals(tname) ||    // Ignored elements
                 "small-icon".equals(tname) ||
                 "large-icon".equals(tname) ||
                 "description".equals(tname) || 
                 "example".equals(tname)) {
        } else {
            err.jspError("jsp.error.unknown.element.in.function",
                         tname);
 }
    }

    return new FunctionInfo(name, klass, signature);
}
 
开发者ID:eclipse,项目名称:packagedrone,代码行数:32,代码来源:TagLibraryInfoImpl.java


示例14: tldScanStream

import org.apache.jasper.xmlparser.TreeNode; //导入依赖的package包/类
private void tldScanStream(String resourcePath, String entryName,
        InputStream stream) throws IOException {
    try {
        // Parse the tag library descriptor at the specified resource path
        String uri = null;

        TreeNode tld =
            new ParserUtils().parseXMLDocument(resourcePath, stream);
        TreeNode uriNode = tld.findChild("uri");
        if (uriNode != null) {
            String body = uriNode.getBody();
            if (body != null)
                uri = body;
        }

        // Add implicit map entry only if its uri is not already
        // present in the map
        if (uri != null && mappings.get(uri) == null) {
            TldLocation location;
            if (entryName == null) {
                location = new TldLocation(resourcePath);
            } else {
                location = new TldLocation(entryName, resourcePath);
            }
            mappings.put(uri, location);
        }
    } catch (JasperException e) {
        // Hack - makes exception handling simpler
        throw new IOException(e);
    }
}
 
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:32,代码来源:TldLocationsCache.java


示例15: tldScanWebXml

import org.apache.jasper.xmlparser.TreeNode; //导入依赖的package包/类
private void tldScanWebXml() throws Exception {

        WebXml webXml = null;
        try {
            webXml = new WebXml(ctxt);
            if (webXml.getInputSource() == null) {
                return;
            }

            boolean validate = Boolean.parseBoolean(
                    ctxt.getInitParameter(
                            Constants.XML_VALIDATION_INIT_PARAM));
            String blockExternalString = ctxt.getInitParameter(
                    Constants.XML_BLOCK_EXTERNAL_INIT_PARAM);
            boolean blockExternal;
            if (blockExternalString == null) {
                blockExternal = true;
            } else {
                blockExternal = Boolean.parseBoolean(blockExternalString);
            }
            
            // Parse the web application deployment descriptor
            ParserUtils pu = new ParserUtils(validate, blockExternal);
            
            TreeNode webtld = null;
            webtld = pu.parseXMLDocument(webXml.getSystemId(),
                    webXml.getInputSource());

            // Allow taglib to be an element of the root or jsp-config (JSP2.0)
            TreeNode jspConfig = webtld.findChild("jsp-config");
            if (jspConfig != null) {
                webtld = jspConfig;
            }
            Iterator<TreeNode> taglibs = webtld.findChildren("taglib");
            while (taglibs.hasNext()) {

                // Parse the next <taglib> element
                TreeNode taglib = taglibs.next();
                String tagUri = null;
                String tagLoc = null;
                TreeNode child = taglib.findChild("taglib-uri");
                if (child != null)
                    tagUri = child.getBody();
                child = taglib.findChild("taglib-location");
                if (child != null)
                    tagLoc = child.getBody();

                // Save this location if appropriate
                if (tagLoc == null)
                    continue;
                if (uriType(tagLoc) == NOROOT_REL_URI)
                    tagLoc = "/WEB-INF/" + tagLoc;
                TldLocation location;
                if (tagLoc.endsWith(JAR_EXT)) {
                    location = new TldLocation("META-INF/taglib.tld", ctxt.getResource(tagLoc).toString());
                } else {
                    location = new TldLocation(tagLoc);
                }
                mappings.put(tagUri, location);
            }
        } finally {
            if (webXml != null) {
                webXml.close();
            }
        }
    }
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:67,代码来源:TldLocationsCache.java


示例16: tldScanStream

import org.apache.jasper.xmlparser.TreeNode; //导入依赖的package包/类
private void tldScanStream(String resourcePath, String entryName,
        InputStream stream) throws IOException {
    try {
        // Parse the tag library descriptor at the specified resource path
        String uri = null;

        boolean validate = Boolean.parseBoolean(
                ctxt.getInitParameter(
                        Constants.XML_VALIDATION_TLD_INIT_PARAM));
        String blockExternalString = ctxt.getInitParameter(
                Constants.XML_BLOCK_EXTERNAL_INIT_PARAM);
        boolean blockExternal;
        if (blockExternalString == null) {
            blockExternal = true;
        } else {
            blockExternal = Boolean.parseBoolean(blockExternalString);
        }
        
        ParserUtils pu = new ParserUtils(validate, blockExternal); 
        TreeNode tld = pu.parseXMLDocument(resourcePath, stream);
        TreeNode uriNode = tld.findChild("uri");
        if (uriNode != null) {
            String body = uriNode.getBody();
            if (body != null)
                uri = body;
        }

        // Add implicit map entry only if its uri is not already
        // present in the map
        if (uri != null && mappings.get(uri) == null) {
            TldLocation location;
            if (entryName == null) {
                location = new TldLocation(resourcePath);
            } else {
                location = new TldLocation(entryName, resourcePath);
            }
            mappings.put(uri, location);
        }
    } catch (JasperException e) {
        // Hack - makes exception handling simpler
        throw new IOException(e);
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:44,代码来源:TldLocationsCache.java


示例17: createTagFileInfo

import org.apache.jasper.xmlparser.TreeNode; //导入依赖的package包/类
private TagFileInfo createTagFileInfo(TreeNode elem, JarResource jarResource)
        throws JasperException {

    String name = null;
    String path = null;

    Iterator<TreeNode> list = elem.findChildren();
    while (list.hasNext()) {
        TreeNode child = list.next();
        String tname = child.getName();
        if ("name".equals(tname)) {
            name = child.getBody();
        } else if ("path".equals(tname)) {
            path = child.getBody();
        } else if ("example".equals(tname)) {
            // Ignore <example> element: Bugzilla 33538
        } else if ("tag-extension".equals(tname)) {
            // Ignore <tag-extension> element: Bugzilla 33538
        } else if ("icon".equals(tname) 
                || "display-name".equals(tname) 
                || "description".equals(tname)) {
            // Ignore these elements: Bugzilla 38015
        } else {
            if (log.isWarnEnabled()) {
                log.warn(Localizer.getMessage(
                        "jsp.warning.unknown.element.in.tagfile", tname));
            }
        }
    }

    if (path.startsWith("/META-INF/tags")) {
        // Tag file packaged in JAR
        // See https://bz.apache.org/bugzilla/show_bug.cgi?id=46471
        // This needs to be removed once all the broken code that depends on
        // it has been removed
        ctxt.setTagFileJarResource(path, jarResource);
    } else if (!path.startsWith("/WEB-INF/tags")) {
        err.jspError("jsp.error.tagfile.illegalPath", path);
    }

    TagInfo tagInfo = TagFileProcessor.parseTagFileDirectives(
            parserController, name, path, jarResource, this);
    return new TagFileInfo(name, path, tagInfo);
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:45,代码来源:TagLibraryInfoImpl.java


示例18: createTagFileInfo

import org.apache.jasper.xmlparser.TreeNode; //导入依赖的package包/类
private TagFileInfo createTagFileInfo(TreeNode elem, String uri,
        URL jarFileUrl) throws JasperException {

    String name = null;
    String path = null;

    Iterator list = elem.findChildren();
    while (list.hasNext()) {
        TreeNode child = (TreeNode) list.next();
        String tname = child.getName();
        if ("name".equals(tname)) {
            name = child.getBody();
        } else if ("path".equals(tname)) {
            path = child.getBody();
        } else if ("example".equals(tname)) {
            // Ignore <example> element: Bugzilla 33538
        } else if ("tag-extension".equals(tname)) {
            // Ignore <tag-extension> element: Bugzilla 33538
        } else if ("icon".equals(tname) 
                || "display-name".equals(tname) 
                || "description".equals(tname)) {
            // Ignore these elements: Bugzilla 38015
        } else {
            log.warn(Localizer.getMessage(
                        "jsp.warning.unknown.element.in.tagfile", tname));
        }
    }

    if (path.startsWith("/META-INF/tags")) {
        // Tag file packaged in JAR
        // See https://issues.apache.org/bugzilla/show_bug.cgi?id=46471
        // This needs to be removed once all the broken code that depends on
        // it has been removed
        ctxt.setTagFileJarUrl(path, jarFileUrl);
    } else if (!path.startsWith("/WEB-INF/tags")) {
        err.jspError("jsp.error.tagfile.illegalPath", path);
    }

    TagInfo tagInfo = TagFileProcessor.parseTagFileDirectives(
            parserController, name, path, jarFileUrl, this);
    return new TagFileInfo(name, path, tagInfo);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:43,代码来源:TagLibraryInfoImpl.java



注:本文中的org.apache.jasper.xmlparser.TreeNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AMLauncherEventType类代码示例发布时间:2022-05-22
下一篇:
Java RENAME3Response类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap