MCPcopy Index your code
hub / github.com/apache/tomcat / parseXMLDirective

Method parseXMLDirective

java/org/apache/jasper/compiler/Parser.java:495–539  ·  view source on GitHub ↗
(Node parent)

Source from the content-addressed store, hash-verified

493 * '>' S? ETag ) ) | ( 'variable' VariableDirectiveAttrList S? ( '/>' | ( '>' S? ETag ) ) ) | <TRANSLATION_ERROR>
494 */
495 private void parseXMLDirective(Node parent) throws JasperException {
496 reader.skipSpaces();
497
498 String eTag = null;
499 if (reader.matches("page")) {
500 eTag = "jsp:directive.page";
501 if (isTagFile) {
502 err.jspError(reader.mark(), "jsp.error.directive.istagfile", "&lt;" + eTag);
503 }
504 parsePageDirective(parent);
505 } else if (reader.matches("include")) {
506 eTag = "jsp:directive.include";
507 parseIncludeDirective(parent);
508 } else if (reader.matches("tag")) {
509 eTag = "jsp:directive.tag";
510 if (!isTagFile) {
511 err.jspError(reader.mark(), "jsp.error.directive.isnottagfile", "&lt;" + eTag);
512 }
513 parseTagDirective(parent);
514 } else if (reader.matches("attribute")) {
515 eTag = "jsp:directive.attribute";
516 if (!isTagFile) {
517 err.jspError(reader.mark(), "jsp.error.directive.isnottagfile", "&lt;" + eTag);
518 }
519 parseAttributeDirective(parent);
520 } else if (reader.matches("variable")) {
521 eTag = "jsp:directive.variable";
522 if (!isTagFile) {
523 err.jspError(reader.mark(), "jsp.error.directive.isnottagfile", "&lt;" + eTag);
524 }
525 parseVariableDirective(parent);
526 } else {
527 err.jspError(reader.mark(), "jsp.error.invalid.directive");
528 }
529
530 reader.skipSpaces();
531 if (reader.matches(">")) {
532 reader.skipSpaces();
533 if (!reader.matchesETag(eTag)) {
534 err.jspError(start, "jsp.error.unterminated", "&lt;" + eTag);
535 }
536 } else if (!reader.matches("/>")) {
537 err.jspError(start, "jsp.error.unterminated", "&lt;" + eTag);
538 }
539 }
540
541 /*
542 * Parses a tag directive with the following syntax: PageDirective ::= ( S Attribute)*

Callers 4

parseElementsMethod · 0.95
parseFileDirectivesMethod · 0.95

Calls 10

parsePageDirectiveMethod · 0.95
parseIncludeDirectiveMethod · 0.95
parseTagDirectiveMethod · 0.95
matchesETagMethod · 0.80
matchesMethod · 0.65
jspErrorMethod · 0.65
skipSpacesMethod · 0.45
markMethod · 0.45

Tested by

no test coverage detected