}
else
throw error(L.l("Expected jsp directive name at '{0}'. JSP directive syntax is <%@ name attr1='value1' ... %>",
badChar(ch)));
QName qname;
if (directive.equals("page"))
qname = JSP_DIRECTIVE_PAGE;
else if (directive.equals("include"))
qname = JSP_DIRECTIVE_INCLUDE;
else if (directive.equals("taglib"))
qname = JSP_DIRECTIVE_TAGLIB;
else if (directive.equals("cache"))
qname = JSP_DIRECTIVE_CACHE;
else if (directive.equals("attribute"))
qname = JSP_DIRECTIVE_ATTRIBUTE;
else if (directive.equals("variable"))
qname = JSP_DIRECTIVE_VARIABLE;
else if (directive.equals("tag"))
qname = JSP_DIRECTIVE_TAG;
else
throw error(L.l("'{0}' is an unknown jsp directive. Only <%@ page ... %>, <%@ include ... %>, <%@ taglib ... %>, and <%@ cache ... %> are known.", directive));
unread(ch);
ArrayList<QName> keys = new ArrayList<QName>();
ArrayList<String> values = new ArrayList<String>();
ArrayList<String> prefixes = new ArrayList<String>();
ArrayList<String> uris = new ArrayList<String>();
parseAttributes(keys, values, prefixes, uris);
ch = skipWhitespace(read());
if (ch != '%' || (ch = read()) != '>') {
throw error(L.l("expected '%>' at {0}. JSP directive syntax is '<%@ name attr1='value1' ... %>'. (Started at line {1})",
badChar(ch), _lineStart));
}
setLocation(_jspPath, _filename, _lineStart);
_lineStart = _line;
_jspBuilder.startElement(qname);
for (int i = 0; i < keys.size(); i++) {
_jspBuilder.attribute(keys.get(i), values.get(i));
}
_jspBuilder.endAttributes();
if (qname.equals(JSP_DIRECTIVE_TAGLIB))
processTaglibDirective(keys, values);
setLocation();
_jspBuilder.endElement(qname.getName());
if (qname.equals(JSP_DIRECTIVE_PAGE)
|| qname.equals(JSP_DIRECTIVE_TAG)) {
String contentEncoding = _parseState.getPageEncoding();
if (contentEncoding == null)
contentEncoding = _parseState.getCharEncoding();
if (contentEncoding != null) {