本文整理了Java中org.apache.tomcat.util.descriptor.web.WebXml.merge()
方法的一些代码示例,展示了WebXml.merge()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebXml.merge()
方法的具体详情如下:
包路径:org.apache.tomcat.util.descriptor.web.WebXml
类名称:WebXml
方法名:merge
[英]Merge the supplied web fragments into this main web.xml.
[中]将提供的web片段合并到此主web中。xml。
代码示例来源:origin: org.apache.meecrowave/meecrowave-core
@Override
protected void processClasses(final WebXml webXml, final Set<WebXml> orderedFragments) {
final ClassLoader loader = context.getLoader().getClassLoader();
orderedFragments.forEach(fragment -> {
final WebXml annotations = new WebXml();
annotations.setDistributable(true);
final URL url = fragment.getURL();
final Collection<Class<?>> classes = webClasses.get(url.toExternalForm());
if (classes == null) {
return;
}
classes.forEach(clazz -> {
try (final InputStream stream = loader.getResourceAsStream(clazz.getName().replace('.', '/') + ".class")) {
processClass(annotations, new ClassParser(stream).parse());
} catch (final IOException e) {
new LogFacade(MeecrowaveContextConfig.class.getName()).error("Can't parse " + clazz);
}
});
fragment.merge(singleton(annotations));
});
}
代码示例来源:origin: apache/meecrowave
@Override
protected void processClasses(final WebXml webXml, final Set<WebXml> orderedFragments) {
final ClassLoader loader = context.getLoader().getClassLoader();
orderedFragments.forEach(fragment -> {
final WebXml annotations = new WebXml();
annotations.setDistributable(true);
final URL url = fragment.getURL();
final Collection<Class<?>> classes = webClasses.get(url.toExternalForm());
if (classes == null) {
return;
}
classes.forEach(clazz -> {
try (final InputStream stream = loader.getResourceAsStream(clazz.getName().replace('.', '/') + ".class")) {
processClass(annotations, new ClassParser(stream).parse());
} catch (final IOException e) {
new LogFacade(MeecrowaveContextConfig.class.getName()).error("Can't parse " + clazz);
}
});
fragment.merge(singleton(annotations));
});
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
protected void processAnnotations(Set<WebXml> fragments,
boolean handlesTypesOnly, Map<String,JavaClassCacheEntry> javaClassCache) {
for(WebXml fragment : fragments) {
// Only need to scan for @HandlesTypes matches if any of the
// following are true:
// - it has already been determined only @HandlesTypes is required
// (e.g. main web.xml has metadata-complete="true"
// - this fragment is for a container JAR (Servlet 3.1 section 8.1)
// - this fragment has metadata-complete="true"
boolean htOnly = handlesTypesOnly || !fragment.getWebappJar() ||
fragment.isMetadataComplete();
WebXml annotations = new WebXml();
// no impact on distributable
annotations.setDistributable(true);
URL url = fragment.getURL();
processAnnotationsUrl(url, annotations, htOnly, javaClassCache);
Set<WebXml> set = new HashSet<>();
set.add(annotations);
// Merge annotations into fragment - fragment takes priority
fragment.merge(set);
}
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
protected void processAnnotations(Set<WebXml> fragments,
boolean handlesTypesOnly, Map<String,JavaClassCacheEntry> javaClassCache) {
for(WebXml fragment : fragments) {
// Only need to scan for @HandlesTypes matches if any of the
// following are true:
// - it has already been determined only @HandlesTypes is required
// (e.g. main web.xml has metadata-complete="true"
// - this fragment is for a container JAR (Servlet 3.1 section 8.1)
// - this fragment has metadata-complete="true"
boolean htOnly = handlesTypesOnly || !fragment.getWebappJar() ||
fragment.isMetadataComplete();
WebXml annotations = new WebXml();
// no impact on distributable
annotations.setDistributable(true);
URL url = fragment.getURL();
processAnnotationsUrl(url, annotations, htOnly, javaClassCache);
Set<WebXml> set = new HashSet<>();
set.add(annotations);
// Merge annotations into fragment - fragment takes priority
fragment.merge(set);
}
}
代码示例来源:origin: codefollower/Tomcat-Research
protected void processAnnotations(Set<WebXml> fragments,
boolean handlesTypesOnly) {
for(WebXml fragment : fragments) {
// Only need to scan for @HandlesTypes matches if any of the
// following are true:
// - it has already been determined only @HandlesTypes is required
// (e.g. main web.xml has metadata-complete="true"
// - this fragment is for a container JAR (Servlet 3.1 section 8.1)
// - this fragment has metadata-complete="true"
boolean htOnly = handlesTypesOnly || !fragment.getWebappJar() ||
fragment.isMetadataComplete();
WebXml annotations = new WebXml();
// no impact on distributable
annotations.setDistributable(true);
URL url = fragment.getURL();
processAnnotationsUrl(url, annotations, htOnly);
Set<WebXml> set = new HashSet<>();
set.add(annotations);
// Merge annotations into fragment - fragment takes priority
fragment.merge(set);
}
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
ok = webXml.merge(orderedFragments);
webXml.merge(tomcatWebXml);
webXml.merge(defaults);
webXml.merge(tomcatWebXml);
webXml.merge(defaults);
convertJsps(webXml);
configureContext(webXml);
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
ok = webXml.merge(orderedFragments);
webXml.merge(tomcatWebXml);
webXml.merge(defaults);
webXml.merge(tomcatWebXml);
webXml.merge(defaults);
convertJsps(webXml);
configureContext(webXml);
代码示例来源:origin: codefollower/Tomcat-Research
ok = webXml.merge(orderedFragments);
webXml.merge(defaults);
webXml.merge(defaults);
convertJsps(webXml);
configureContext(webXml);
代码示例来源:origin: org.apache.tomcat/tomcat-jasper
webXml.merge(orderedFragments);
return webXml;
代码示例来源:origin: codefollower/Tomcat-Research
webXml.merge(orderedFragments);
return webXml;
内容来源于网络,如有侵权,请联系作者删除!