(Node parent)
| 434 | * AttributeDirective | 'variable VariableDirective S? '%>' |
| 435 | */ |
| 436 | private void parseDirective(Node parent) throws JasperException { |
| 437 | reader.skipSpaces(); |
| 438 | |
| 439 | String directive = null; |
| 440 | if (reader.matches("page")) { |
| 441 | directive = "<%@ page"; |
| 442 | if (isTagFile) { |
| 443 | err.jspError(reader.mark(), "jsp.error.directive.istagfile", directive); |
| 444 | } |
| 445 | parsePageDirective(parent); |
| 446 | } else if (reader.matches("include")) { |
| 447 | directive = "<%@ include"; |
| 448 | parseIncludeDirective(parent); |
| 449 | } else if (reader.matches("taglib")) { |
| 450 | if (directivesOnly) { |
| 451 | // No need to get the tagLibInfo objects. This also suppresses |
| 452 | // parsing of any tag files used in this tag file. |
| 453 | return; |
| 454 | } |
| 455 | directive = "<%@ taglib"; |
| 456 | parseTaglibDirective(parent); |
| 457 | } else if (reader.matches("tag")) { |
| 458 | directive = "<%@ tag"; |
| 459 | if (!isTagFile) { |
| 460 | err.jspError(reader.mark(), "jsp.error.directive.isnottagfile", directive); |
| 461 | } |
| 462 | parseTagDirective(parent); |
| 463 | } else if (reader.matches("attribute")) { |
| 464 | directive = "<%@ attribute"; |
| 465 | if (!isTagFile) { |
| 466 | err.jspError(reader.mark(), "jsp.error.directive.isnottagfile", directive); |
| 467 | } |
| 468 | parseAttributeDirective(parent); |
| 469 | } else if (reader.matches("variable")) { |
| 470 | directive = "<%@ variable"; |
| 471 | if (!isTagFile) { |
| 472 | err.jspError(reader.mark(), "jsp.error.directive.isnottagfile", directive); |
| 473 | } |
| 474 | parseVariableDirective(parent); |
| 475 | } else { |
| 476 | err.jspError(reader.mark(), "jsp.error.invalid.directive"); |
| 477 | } |
| 478 | |
| 479 | reader.skipSpaces(); |
| 480 | if (!reader.matches("%>")) { |
| 481 | err.jspError(start, "jsp.error.unterminated", directive); |
| 482 | } |
| 483 | } |
| 484 | |
| 485 | /* |
| 486 | * Parses a directive with the following syntax: |
no test coverage detected