use of javax.servlet.jsp.tagext.TagFileInfo in project sling by apache.
the class JspDocumentParser method parseCustomAction.
/*
* Checks if the XML element with the given tag name is a custom action,
* and returns the corresponding Node object.
*/
private Node parseCustomAction(String qName, String localName, String uri, Attributes nonTaglibAttrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent) throws SAXException {
// Check if this is a user-defined (custom) tag
TagLibraryInfo tagLibInfo = pageInfo.getTaglib(uri);
if (tagLibInfo == null) {
return null;
}
TagInfo tagInfo = tagLibInfo.getTag(localName);
TagFileInfo tagFileInfo = tagLibInfo.getTagFile(localName);
if (tagInfo == null && tagFileInfo == null) {
throw new SAXException(Localizer.getMessage("jsp.error.xml.bad_tag", localName, uri));
}
Class tagHandlerClass = null;
if (tagInfo != null) {
String handlerClassName = tagInfo.getTagClassName();
try {
tagHandlerClass = ctxt.getClassLoader().loadClass(handlerClassName);
} catch (Exception e) {
throw new SAXException(Localizer.getMessage("jsp.error.loadclass.taghandler", handlerClassName, qName), e);
}
}
String prefix = "";
int colon = qName.indexOf(':');
if (colon != -1) {
prefix = qName.substring(0, colon);
}
Node.CustomTag ret = null;
if (tagInfo != null) {
ret = new Node.CustomTag(qName, prefix, localName, uri, nonTaglibAttrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent, tagInfo, tagHandlerClass);
} else {
ret = new Node.CustomTag(qName, prefix, localName, uri, nonTaglibAttrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent, tagFileInfo);
}
return ret;
}
Aggregations