本文整理了Java中org.apache.shindig.gadgets.templates.XmlTemplateLibrary.createTagHandler()
方法的一些代码示例,展示了XmlTemplateLibrary.createTagHandler()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlTemplateLibrary.createTagHandler()
方法的具体详情如下:
包路径:org.apache.shindig.gadgets.templates.XmlTemplateLibrary
类名称:XmlTemplateLibrary
方法名:createTagHandler
[英]Creates a tag handler wrapping an element. By default, creates a TemplateBasedTagHandler. Override this to create custom tag handlers.
[中]创建包装元素的标记处理程序。默认情况下,创建TemplateBasedTagHandler。重写此选项以创建自定义标记处理程序。
代码示例来源:origin: com.lmco.shindig/shindig-gadgets
private TagHandler createHandler(String tagName, Element template,
Set<TemplateResource> resources)
throws TemplateParserException {
String [] nameParts = StringUtils.splitPreserveAllTokens(tagName, ':');
// At this time, we only support namespaced tags
if (nameParts.length != 2) {
return null;
}
String namespaceUri = template.lookupNamespaceURI(nameParts[0]);
if (!nsPrefix.equals(nameParts[0]) || !nsUri.equals(namespaceUri)) {
throw new TemplateParserException(
"Can't create tags in undeclared namespace: " + nameParts[0]);
}
if (isSafe()) {
bypassTemplateSanitization(template);
}
return new LibraryTagHandler(
createTagHandler(template, namespaceUri, nameParts[1]),
resources);
}
代码示例来源:origin: org.gatein.shindig/shindig-gadgets
private TagHandler createHandler(String tagName, Element template,
Set<TemplateResource> resources)
throws TemplateParserException {
String [] nameParts = StringUtils.splitPreserveAllTokens(tagName, ':');
// At this time, we only support namespaced tags
if (nameParts.length != 2) {
return null;
}
String namespaceUri = template.lookupNamespaceURI(nameParts[0]);
if (!nsPrefix.equals(nameParts[0]) || !nsUri.equals(namespaceUri)) {
throw new TemplateParserException(
"Can't create tags in undeclared namespace: " + nameParts[0]);
}
if (isSafe()) {
bypassTemplateSanitization(template);
}
return new LibraryTagHandler(
createTagHandler(template, namespaceUri, nameParts[1]),
resources);
}
代码示例来源:origin: org.apache.shindig/shindig-gadgets
private TagHandler createHandler(String tagName, Element template,
Set<TemplateResource> resources)
throws TemplateParserException {
String [] nameParts = StringUtils.splitPreserveAllTokens(tagName, ':');
// At this time, we only support namespaced tags
if (nameParts.length != 2) {
return null;
}
String namespaceUri = "";
synchronized (template) {
namespaceUri = template.lookupNamespaceURI(nameParts[0]);
}
if (!nsPrefix.equals(nameParts[0]) || !nsUri.equals(namespaceUri)) {
throw new TemplateParserException(
"Can't create tags in undeclared namespace: " + nameParts[0]);
}
if (isSafe()) {
bypassTemplateSanitization(template);
}
return new LibraryTagHandler(
createTagHandler(template, namespaceUri, nameParts[1]),
resources);
}
内容来源于网络,如有侵权,请联系作者删除!