org.apache.jasper.compiler.Node.getText()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(13.0k)|赞(0)|评价(0)|浏览(220)

本文整理了Java中org.apache.jasper.compiler.Node.getText()方法的一些代码示例,展示了Node.getText()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getText()方法的具体详情如下:
包路径:org.apache.jasper.compiler.Node
类名称:Node
方法名:getText

Node.getText介绍

[英]Get the attribute that is non request time expression, either from the attribute of the node, or from a jsp:attrbute
[中]从节点的属性或jsp:attrbute获取非请求时表达式的属性

代码示例

代码示例来源:origin: org.glassfish.web/jakarta.servlet.jsp

  1. /**
  2. * When this node was created from a JSP page in JSP syntax, its text
  3. * was stored as a String in the "text" field, whereas when this node
  4. * was created from a JSP document, its text was stored as one or more
  5. * TemplateText nodes in its body. This method handles either case.
  6. * @return The text string
  7. */
  8. public String getText() {
  9. String ret = text;
  10. if ((ret == null) && (body != null)) {
  11. StringBuilder buf = new StringBuilder();
  12. for (int i=0; i<body.size(); i++) {
  13. buf.append(body.getNode(i).getText());
  14. }
  15. ret = buf.toString();
  16. }
  17. return ret;
  18. }

代码示例来源:origin: org.eclipse.jetty.toolchain/jetty-jsp-fragment

  1. /**
  2. * When this node was created from a JSP page in JSP syntax, its text
  3. * was stored as a String in the "text" field, whereas when this node
  4. * was created from a JSP document, its text was stored as one or more
  5. * TemplateText nodes in its body. This method handles either case.
  6. * @return The text string
  7. */
  8. public String getText() {
  9. String ret = text;
  10. if ((ret == null) && (body != null)) {
  11. StringBuilder buf = new StringBuilder();
  12. for (int i=0; i<body.size(); i++) {
  13. buf.append(body.getNode(i).getText());
  14. }
  15. ret = buf.toString();
  16. }
  17. return ret;
  18. }

代码示例来源:origin: org.eclipse.jetty.orbit/org.apache.jasper.glassfish

  1. /**
  2. * When this node was created from a JSP page in JSP syntax, its text
  3. * was stored as a String in the "text" field, whereas when this node
  4. * was created from a JSP document, its text was stored as one or more
  5. * TemplateText nodes in its body. This method handles either case.
  6. * @return The text string
  7. */
  8. public String getText() {
  9. String ret = text;
  10. if ((ret == null) && (body != null)) {
  11. StringBuilder buf = new StringBuilder();
  12. for (int i=0; i<body.size(); i++) {
  13. buf.append(body.getNode(i).getText());
  14. }
  15. ret = buf.toString();
  16. }
  17. return ret;
  18. }

代码示例来源:origin: org.glassfish.web/jsp-impl

  1. /**
  2. * When this node was created from a JSP page in JSP syntax, its text
  3. * was stored as a String in the "text" field, whereas when this node
  4. * was created from a JSP document, its text was stored as one or more
  5. * TemplateText nodes in its body. This method handles either case.
  6. * @return The text string
  7. */
  8. public String getText() {
  9. String ret = text;
  10. if ((ret == null) && (body != null)) {
  11. StringBuffer buf = new StringBuffer();
  12. for (int i=0; i<body.size(); i++) {
  13. buf.append(body.getNode(i).getText());
  14. }
  15. ret = buf.toString();
  16. }
  17. return ret;
  18. }

代码示例来源:origin: org.bluestemsoftware.open.maven.tparty/jsp-2.1

  1. /**
  2. * When this node was created from a JSP page in JSP syntax, its text
  3. * was stored as a String in the "text" field, whereas when this node
  4. * was created from a JSP document, its text was stored as one or more
  5. * TemplateText nodes in its body. This method handles either case.
  6. * @return The text string
  7. */
  8. public String getText() {
  9. String ret = text;
  10. if ((ret == null) && (body != null)) {
  11. StringBuffer buf = new StringBuffer();
  12. for (int i=0; i<body.size(); i++) {
  13. buf.append(body.getNode(i).getText());
  14. }
  15. ret = buf.toString();
  16. }
  17. return ret;
  18. }

代码示例来源:origin: org.glassfish.web/javax.servlet.jsp

  1. /**
  2. * When this node was created from a JSP page in JSP syntax, its text
  3. * was stored as a String in the "text" field, whereas when this node
  4. * was created from a JSP document, its text was stored as one or more
  5. * TemplateText nodes in its body. This method handles either case.
  6. * @return The text string
  7. */
  8. public String getText() {
  9. String ret = text;
  10. if ((ret == null) && (body != null)) {
  11. StringBuilder buf = new StringBuilder();
  12. for (int i=0; i<body.size(); i++) {
  13. buf.append(body.getNode(i).getText());
  14. }
  15. ret = buf.toString();
  16. }
  17. return ret;
  18. }

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.jasper.glassfish

  1. /**
  2. * When this node was created from a JSP page in JSP syntax, its text
  3. * was stored as a String in the "text" field, whereas when this node
  4. * was created from a JSP document, its text was stored as one or more
  5. * TemplateText nodes in its body. This method handles either case.
  6. * @return The text string
  7. */
  8. public String getText() {
  9. String ret = text;
  10. if ((ret == null) && (body != null)) {
  11. StringBuilder buf = new StringBuilder();
  12. for (int i=0; i<body.size(); i++) {
  13. buf.append(body.getNode(i).getText());
  14. }
  15. ret = buf.toString();
  16. }
  17. return ret;
  18. }

代码示例来源:origin: org.jboss.web/jbossweb

  1. /**
  2. * When this node was created from a JSP page in JSP syntax, its text
  3. * was stored as a String in the "text" field, whereas when this node
  4. * was created from a JSP document, its text was stored as one or more
  5. * TemplateText nodes in its body. This method handles either case.
  6. *
  7. * @return The text string
  8. */
  9. public String getText() {
  10. String ret = text;
  11. if (ret == null) {
  12. if (body != null) {
  13. StringBuilder buf = new StringBuilder();
  14. for (int i = 0; i < body.size(); i++) {
  15. buf.append(body.getNode(i).getText());
  16. }
  17. ret = buf.toString();
  18. } else {
  19. // Nulls cause NPEs further down the line
  20. ret = "";
  21. }
  22. }
  23. return ret;
  24. }

代码示例来源:origin: jboss.web/jbossweb

  1. /**
  2. * When this node was created from a JSP page in JSP syntax, its text
  3. * was stored as a String in the "text" field, whereas when this node
  4. * was created from a JSP document, its text was stored as one or more
  5. * TemplateText nodes in its body. This method handles either case.
  6. *
  7. * @return The text string
  8. */
  9. public String getText() {
  10. String ret = text;
  11. if (ret == null) {
  12. if (body != null) {
  13. StringBuilder buf = new StringBuilder();
  14. for (int i = 0; i < body.size(); i++) {
  15. buf.append(body.getNode(i).getText());
  16. }
  17. ret = buf.toString();
  18. } else {
  19. // Nulls cause NPEs further down the line
  20. ret = "";
  21. }
  22. }
  23. return ret;
  24. }

代码示例来源:origin: io.undertow.jastow/jastow

  1. /**
  2. * When this node was created from a JSP page in JSP syntax, its text
  3. * was stored as a String in the "text" field, whereas when this node
  4. * was created from a JSP document, its text was stored as one or more
  5. * TemplateText nodes in its body. This method handles either case.
  6. *
  7. * @return The text string
  8. */
  9. @Override
  10. public String getText() {
  11. String ret = text;
  12. if (ret == null) {
  13. if (body != null) {
  14. StringBuilder buf = new StringBuilder();
  15. for (int i = 0; i < body.size(); i++) {
  16. buf.append(body.getNode(i).getText());
  17. }
  18. ret = buf.toString();
  19. } else {
  20. // Nulls cause NPEs further down the line
  21. ret = "";
  22. }
  23. }
  24. return ret;
  25. }

代码示例来源:origin: org.apache.tomcat/tomcat-jasper

  1. /**
  2. * When this node was created from a JSP page in JSP syntax, its text
  3. * was stored as a String in the "text" field, whereas when this node
  4. * was created from a JSP document, its text was stored as one or more
  5. * TemplateText nodes in its body. This method handles either case.
  6. *
  7. * @return The text string
  8. */
  9. @Override
  10. public String getText() {
  11. String ret = text;
  12. if (ret == null) {
  13. if (body != null) {
  14. StringBuilder buf = new StringBuilder();
  15. for (int i = 0; i < body.size(); i++) {
  16. buf.append(body.getNode(i).getText());
  17. }
  18. ret = buf.toString();
  19. } else {
  20. // Nulls cause NPEs further down the line
  21. ret = "";
  22. }
  23. }
  24. return ret;
  25. }

代码示例来源:origin: org.apache.geronimo.ext.tomcat/jasper

  1. /**
  2. * When this node was created from a JSP page in JSP syntax, its text
  3. * was stored as a String in the "text" field, whereas when this node
  4. * was created from a JSP document, its text was stored as one or more
  5. * TemplateText nodes in its body. This method handles either case.
  6. *
  7. * @return The text string
  8. */
  9. @Override
  10. public String getText() {
  11. String ret = text;
  12. if (ret == null) {
  13. if (body != null) {
  14. StringBuilder buf = new StringBuilder();
  15. for (int i = 0; i < body.size(); i++) {
  16. buf.append(body.getNode(i).getText());
  17. }
  18. ret = buf.toString();
  19. } else {
  20. // Nulls cause NPEs further down the line
  21. ret = "";
  22. }
  23. }
  24. return ret;
  25. }

代码示例来源:origin: codefollower/Tomcat-Research

  1. /**
  2. * When this node was created from a JSP page in JSP syntax, its text
  3. * was stored as a String in the "text" field, whereas when this node
  4. * was created from a JSP document, its text was stored as one or more
  5. * TemplateText nodes in its body. This method handles either case.
  6. *
  7. * @return The text string
  8. */
  9. @Override
  10. public String getText() {
  11. String ret = text;
  12. if (ret == null) {
  13. if (body != null) {
  14. StringBuilder buf = new StringBuilder();
  15. for (int i = 0; i < body.size(); i++) {
  16. buf.append(body.getNode(i).getText());
  17. }
  18. ret = buf.toString();
  19. } else {
  20. // Nulls cause NPEs further down the line
  21. ret = "";
  22. }
  23. }
  24. return ret;
  25. }

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

  1. /**
  2. * When this node was created from a JSP page in JSP syntax, its text
  3. * was stored as a String in the "text" field, whereas when this node
  4. * was created from a JSP document, its text was stored as one or more
  5. * TemplateText nodes in its body. This method handles either case.
  6. *
  7. * @return The text string
  8. */
  9. @Override
  10. public String getText() {
  11. String ret = text;
  12. if (ret == null) {
  13. if (body != null) {
  14. StringBuilder buf = new StringBuilder();
  15. for (int i = 0; i < body.size(); i++) {
  16. buf.append(body.getNode(i).getText());
  17. }
  18. ret = buf.toString();
  19. } else {
  20. // Nulls cause NPEs further down the line
  21. ret = "";
  22. }
  23. }
  24. return ret;
  25. }

代码示例来源:origin: codefollower/Tomcat-Research

  1. private void appendTag(Node n, boolean addDefaultNS)
  2. throws JasperException {
  3. Node.Nodes body = n.getBody();
  4. String text = n.getText();
  5. buf.append("<").append(n.getQName());
  6. buf.append("\n");
  7. printAttributes(n, addDefaultNS);
  8. buf.append(" ").append(jspIdPrefix).append(":id").append("=\"");
  9. buf.append(jspId++).append("\"\n");
  10. if (ROOT_ACTION.equals(n.getLocalName()) || body != null
  11. || text != null) {
  12. buf.append(">\n");
  13. if (ROOT_ACTION.equals(n.getLocalName())) {
  14. if (compiler.getCompilationContext().isTagFile()) {
  15. appendTagDirective();
  16. } else {
  17. appendPageDirective();
  18. }
  19. }
  20. if (body != null) {
  21. body.visit(this);
  22. } else {
  23. appendText(text, false);
  24. }
  25. buf.append("</" + n.getQName() + ">\n");
  26. } else {
  27. buf.append("/>\n");
  28. }
  29. }

代码示例来源:origin: io.undertow.jastow/jastow

  1. private void appendTag(Node n, boolean addDefaultNS)
  2. throws JasperException {
  3. Node.Nodes body = n.getBody();
  4. String text = n.getText();
  5. buf.append("<").append(n.getQName());
  6. buf.append("\n");
  7. printAttributes(n, addDefaultNS);
  8. buf.append(" ").append(jspIdPrefix).append(":id").append("=\"");
  9. buf.append(jspId++).append("\"\n");
  10. if (ROOT_ACTION.equals(n.getLocalName()) || body != null
  11. || text != null) {
  12. buf.append(">\n");
  13. if (ROOT_ACTION.equals(n.getLocalName())) {
  14. if (compiler.getCompilationContext().isTagFile()) {
  15. appendTagDirective();
  16. } else {
  17. appendPageDirective();
  18. }
  19. }
  20. if (body != null) {
  21. body.visit(this);
  22. } else {
  23. appendText(text, false);
  24. }
  25. buf.append("</" + n.getQName() + ">\n");
  26. } else {
  27. buf.append("/>\n");
  28. }
  29. }

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.jasper.glassfish

  1. private void appendTag(Node n, boolean addDefaultNS)
  2. throws JasperException {
  3. Node.Nodes body = n.getBody();
  4. String text = n.getText();
  5. buf.append("<").append(n.getQName());
  6. buf.append("\n");
  7. printAttributes(n, addDefaultNS);
  8. buf.append(" ").append(jspIdPrefix).append(":id").append("=\"");
  9. buf.append(jspId++).append("\"\n");
  10. if (ROOT_ACTION.equals(n.getLocalName()) || body != null
  11. || text != null) {
  12. buf.append(">\n");
  13. if (ROOT_ACTION.equals(n.getLocalName())) {
  14. if (compiler.getCompilationContext().isTagFile()) {
  15. appendTagDirective();
  16. } else {
  17. appendPageDirective();
  18. }
  19. }
  20. if (body != null) {
  21. body.visit(this);
  22. } else {
  23. appendText(text, false);
  24. }
  25. buf.append("</" + n.getQName() + ">\n");
  26. } else {
  27. buf.append("/>\n");
  28. }
  29. }

代码示例来源:origin: org.bluestemsoftware.open.maven.tparty/jsp-2.1

  1. private void appendTag(Node n, boolean addDefaultNS)
  2. throws JasperException {
  3. Node.Nodes body = n.getBody();
  4. String text = n.getText();
  5. buf.append("<").append(n.getQName());
  6. buf.append("\n");
  7. printAttributes(n, addDefaultNS);
  8. buf.append(" ").append(jspIdPrefix).append(":id").append("=\"");
  9. buf.append(jspId++).append("\"\n");
  10. if (ROOT_ACTION.equals(n.getLocalName()) || body != null
  11. || text != null) {
  12. buf.append(">\n");
  13. if (ROOT_ACTION.equals(n.getLocalName())) {
  14. if (compiler.getCompilationContext().isTagFile()) {
  15. appendTagDirective();
  16. } else {
  17. appendPageDirective();
  18. }
  19. }
  20. if (body != null) {
  21. body.visit(this);
  22. } else {
  23. appendText(text, false);
  24. }
  25. buf.append("</" + n.getQName() + ">\n");
  26. } else {
  27. buf.append("/>\n");
  28. }
  29. }

代码示例来源:origin: org.jboss.web/jbossweb

  1. private void appendTag(Node n, boolean addDefaultNS)
  2. throws JasperException {
  3. Node.Nodes body = n.getBody();
  4. String text = n.getText();
  5. buf.append("<").append(n.getQName());
  6. buf.append("\n");
  7. printAttributes(n, addDefaultNS);
  8. buf.append(" ").append(jspIdPrefix).append(":id").append("=\"");
  9. buf.append(jspId++).append("\"\n");
  10. if (ROOT_ACTION.equals(n.getLocalName()) || body != null
  11. || text != null) {
  12. buf.append(">\n");
  13. if (ROOT_ACTION.equals(n.getLocalName())) {
  14. if (compiler.getCompilationContext().isTagFile()) {
  15. appendTagDirective();
  16. } else {
  17. appendPageDirective();
  18. }
  19. }
  20. if (body != null) {
  21. body.visit(this);
  22. } else {
  23. appendText(text, false);
  24. }
  25. buf.append("</" + n.getQName() + ">\n");
  26. } else {
  27. buf.append("/>\n");
  28. }
  29. }

代码示例来源:origin: jboss.web/jbossweb

  1. private void appendTag(Node n, boolean addDefaultNS)
  2. throws JasperException {
  3. Node.Nodes body = n.getBody();
  4. String text = n.getText();
  5. buf.append("<").append(n.getQName());
  6. buf.append("\n");
  7. printAttributes(n, addDefaultNS);
  8. buf.append(" ").append(jspIdPrefix).append(":id").append("=\"");
  9. buf.append(jspId++).append("\"\n");
  10. if (ROOT_ACTION.equals(n.getLocalName()) || body != null
  11. || text != null) {
  12. buf.append(">\n");
  13. if (ROOT_ACTION.equals(n.getLocalName())) {
  14. if (compiler.getCompilationContext().isTagFile()) {
  15. appendTagDirective();
  16. } else {
  17. appendPageDirective();
  18. }
  19. }
  20. if (body != null) {
  21. body.visit(this);
  22. } else {
  23. appendText(text, false);
  24. }
  25. buf.append("</" + n.getQName() + ">\n");
  26. } else {
  27. buf.append("/>\n");
  28. }
  29. }

相关文章