本文整理汇总了Java中org.apache.jasper.xmlparser.TreeNode.findChildren方法的典型用法代码示例。如果您正苦于以下问题:Java TreeNode.findChildren方法的具体用法?Java TreeNode.findChildren怎么用?Java TreeNode.findChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.jasper.xmlparser.TreeNode
的用法示例。
在下文中一共展示了TreeNode.findChildren方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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;
}
示例5: 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);
}
示例6: 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);
}
示例7: 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);
}
示例8: 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);
}
示例9: 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);
}
示例10: 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();
}
}
}
示例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);
}
示例12: 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);
}
示例13: 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();
}
}
}
示例14: processWebDotXml
import org.apache.jasper.xmlparser.TreeNode; //导入方法依赖的package包/类
private void processWebDotXml() throws Exception {
InputStream is = null;
try {
// Acquire input stream to web application deployment descriptor
String altDDName = (String)ctxt.getAttribute(Constants.ALT_DD_ATTR);
URL uri = null;
if (altDDName != null) {
try {
uri = new URL(FILE_PROTOCOL+altDDName.replace('\\', '/'));
} catch (MalformedURLException e) {
if (logger.isWarnEnabled()) {
logger.warn(Localizer.getMessage(
"jsp.error.internal.filenotfound",
altDDName));
}
}
} else {
uri = ctxt.getResource(WEB_XML);
if (uri == null && logger.isWarnEnabled()) {
logger.warn(Localizer.getMessage(
"jsp.error.internal.filenotfound",
WEB_XML));
}
}
if (uri == null) {
return;
}
is = uri.openStream();
InputSource ip = new InputSource(is);
ip.setSystemId(uri.toExternalForm());
// Parse the web application deployment descriptor
TreeNode webtld = null;
// altDDName is the absolute path of the DD
if (altDDName != null) {
webtld = new ParserUtils().parseXMLDocument(altDDName, ip);
} else {
webtld = new ParserUtils().parseXMLDocument(WEB_XML, ip);
}
// 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<?> taglibs = webtld.findChildren("taglib");
while (taglibs.hasNext()) {
// Parse the next <taglib> element
TreeNode taglib = (TreeNode) 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;
String tagLoc2 = null;
if (tagLoc.endsWith(JAR_FILE_SUFFIX)) {
tagLoc = ctxt.getResource(tagLoc).toString();
tagLoc2 = "META-INF/taglib.tld";
}
mappings.put(tagUri, new String[] { tagLoc, tagLoc2 });
}
} finally {
if (is != null) {
try {
is.close();
} catch (Throwable t) {}
}
}
}
示例15: processPluginWebDotXml
import org.apache.jasper.xmlparser.TreeNode; //导入方法依赖的package包/类
private void processPluginWebDotXml(PluginContext ctx) throws Exception{
InputStream is = null;
try {
URL urlDefault = ctx.findLocalResource("WEB-INF/web.xml");
if (urlDefault == null) {
return;
}
is = urlDefault.openStream();
InputSource ip = new InputSource(is);
ip.setSystemId(urlDefault.toExternalForm());
// Parse the web application deployment descriptor
TreeNode webtld = null;
webtld = new ParserUtils().parseXMLDocument(WEB_XML, ip);
// 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<?> taglibs = webtld.findChildren("taglib");
while (taglibs.hasNext()) {
// Parse the next <taglib> element
TreeNode taglib = (TreeNode) 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();
String resourcePath ="/"+ctx.getName()+tagLoc;
Map<String,String[]> tldMapping= (Map<String,String[]>)ctx.getAttribute("tld-mapping");
tldMapping.put(tagUri, new String[] {resourcePath, tagLoc});
if(logger.isDebugEnabled()){
logger.debug("完成解析组件"+ctx.getName()+"web.xml中的tld配置");
}
}
} finally {
if (is != null) {
try {
is.close();
} catch (Throwable t) {}
}
}
}