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

Method getText

java/org/apache/jasper/compiler/Node.java:955–971  ·  view source on GitHub ↗

When this node was created from a JSP page in JSP syntax, its text was stored as a String in the "text" field, whereas when this node was created from a JSP document, its text was stored as one or more TemplateText nodes in its body. This method handles either case. @return The text string

()

Source from the content-addressed store, hash-verified

953 * @return The text string
954 */
955 @Override
956 public String getText() {
957 String ret = text;
958 if (ret == null) {
959 if (body != null) {
960 StringBuilder buf = new StringBuilder();
961 for (int i = 0; i < body.size(); i++) {
962 buf.append(body.getNode(i).getText());
963 }
964 ret = buf.toString();
965 } else {
966 // Nulls cause NPEs further down the line
967 ret = "";
968 }
969 }
970 return ret;
971 }
972
973 /**
974 * For the same reason as above, the source line information in the contained TemplateText node should be used.

Callers

nothing calls this directly

Calls 5

toStringMethod · 0.65
sizeMethod · 0.45
appendMethod · 0.45
getTextMethod · 0.45
getNodeMethod · 0.45

Tested by

no test coverage detected