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

Method getAttributeBodyType

java/org/apache/jasper/compiler/Parser.java:1539–1582  ·  view source on GitHub ↗

Determine the body type of <jsp:attribute> from the enclosing node

(Node n, String name)

Source from the content-addressed store, hash-verified

1537 * Determine the body type of <jsp:attribute> from the enclosing node
1538 */
1539 private String getAttributeBodyType(Node n, String name) {
1540
1541 if (n instanceof Node.CustomTag) {
1542 TagInfo tagInfo = ((Node.CustomTag) n).getTagInfo();
1543 TagAttributeInfo[] tldAttrs = tagInfo.getAttributes();
1544 for (TagAttributeInfo tldAttr : tldAttrs) {
1545 if (name.equals(tldAttr.getName())) {
1546 if (tldAttr.isFragment()) {
1547 return TagInfo.BODY_CONTENT_SCRIPTLESS;
1548 }
1549 if (tldAttr.canBeRequestTime()) {
1550 return TagInfo.BODY_CONTENT_JSP;
1551 }
1552 }
1553 }
1554 if (tagInfo.hasDynamicAttributes()) {
1555 return TagInfo.BODY_CONTENT_JSP;
1556 }
1557 } else if (n instanceof Node.IncludeAction) {
1558 if ("page".equals(name)) {
1559 return TagInfo.BODY_CONTENT_JSP;
1560 }
1561 } else if (n instanceof Node.ForwardAction) {
1562 if ("page".equals(name)) {
1563 return TagInfo.BODY_CONTENT_JSP;
1564 }
1565 } else if (n instanceof Node.SetProperty) {
1566 if ("value".equals(name)) {
1567 return TagInfo.BODY_CONTENT_JSP;
1568 }
1569 } else if (n instanceof Node.UseBean) {
1570 if ("beanName".equals(name)) {
1571 return TagInfo.BODY_CONTENT_JSP;
1572 }
1573 } else if (n instanceof Node.ParamAction) {
1574 if ("value".equals(name)) {
1575 return TagInfo.BODY_CONTENT_JSP;
1576 }
1577 } else if (n instanceof Node.JspElement) {
1578 return TagInfo.BODY_CONTENT_JSP;
1579 }
1580
1581 return JAVAX_BODY_CONTENT_TEMPLATE_TEXT;
1582 }
1583
1584 private void parseFileDirectives(Node parent) throws JasperException {
1585 reader.skipUntil("<");

Callers 1

parseNamedAttributesMethod · 0.95

Calls 7

getAttributesMethod · 0.95
hasDynamicAttributesMethod · 0.95
isFragmentMethod · 0.80
canBeRequestTimeMethod · 0.80
equalsMethod · 0.65
getNameMethod · 0.65
getTagInfoMethod · 0.45

Tested by

no test coverage detected