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

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

本文整理了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

/**
 * 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
 */
public String getText() {
  String ret = text;
  if ((ret == null) && (body != null)) {
  StringBuilder buf = new StringBuilder();
  for (int i=0; i<body.size(); i++) {
    buf.append(body.getNode(i).getText());
  }
  ret = buf.toString();
  }
  return ret;
}

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

/**
 * 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
 */
public String getText() {
  String ret = text;
  if ((ret == null) && (body != null)) {
  StringBuilder buf = new StringBuilder();
  for (int i=0; i<body.size(); i++) {
    buf.append(body.getNode(i).getText());
  }
  ret = buf.toString();
  }
  return ret;
}

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

/**
 * 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
 */
public String getText() {
  String ret = text;
  if ((ret == null) && (body != null)) {
  StringBuilder buf = new StringBuilder();
  for (int i=0; i<body.size(); i++) {
    buf.append(body.getNode(i).getText());
  }
  ret = buf.toString();
  }
  return ret;
}

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

/**
 * 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
 */
public String getText() {
  String ret = text;
  if ((ret == null) && (body != null)) {
  StringBuffer buf = new StringBuffer();
  for (int i=0; i<body.size(); i++) {
    buf.append(body.getNode(i).getText());
  }
  ret = buf.toString();
  }
  return ret;
}

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

/**
 * 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
 */
public String getText() {
  String ret = text;
  if ((ret == null) && (body != null)) {
  StringBuffer buf = new StringBuffer();
  for (int i=0; i<body.size(); i++) {
    buf.append(body.getNode(i).getText());
  }
  ret = buf.toString();
  }
  return ret;
}

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

/**
 * 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
 */
public String getText() {
  String ret = text;
  if ((ret == null) && (body != null)) {
  StringBuilder buf = new StringBuilder();
  for (int i=0; i<body.size(); i++) {
    buf.append(body.getNode(i).getText());
  }
  ret = buf.toString();
  }
  return ret;
}

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

/**
 * 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
 */
public String getText() {
  String ret = text;
  if ((ret == null) && (body != null)) {
  StringBuilder buf = new StringBuilder();
  for (int i=0; i<body.size(); i++) {
    buf.append(body.getNode(i).getText());
  }
  ret = buf.toString();
  }
  return ret;
}

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

/**
 * 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
 */
public String getText() {
  String ret = text;
  if (ret == null) {
    if (body != null) {
      StringBuilder buf = new StringBuilder();
      for (int i = 0; i < body.size(); i++) {
        buf.append(body.getNode(i).getText());
      }
      ret = buf.toString();
    } else {
      // Nulls cause NPEs further down the line
      ret = "";
    }
  }
  return ret;
}

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

/**
 * 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
 */
public String getText() {
  String ret = text;
  if (ret == null) {
    if (body != null) {
      StringBuilder buf = new StringBuilder();
      for (int i = 0; i < body.size(); i++) {
        buf.append(body.getNode(i).getText());
      }
      ret = buf.toString();
    } else {
      // Nulls cause NPEs further down the line
      ret = "";
    }
  }
  return ret;
}

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

/**
 * 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
 */
@Override
public String getText() {
  String ret = text;
  if (ret == null) {
    if (body != null) {
      StringBuilder buf = new StringBuilder();
      for (int i = 0; i < body.size(); i++) {
        buf.append(body.getNode(i).getText());
      }
      ret = buf.toString();
    } else {
      // Nulls cause NPEs further down the line
      ret = "";
    }
  }
  return ret;
}

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

/**
 * 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
 */
@Override
public String getText() {
  String ret = text;
  if (ret == null) {
    if (body != null) {
      StringBuilder buf = new StringBuilder();
      for (int i = 0; i < body.size(); i++) {
        buf.append(body.getNode(i).getText());
      }
      ret = buf.toString();
    } else {
      // Nulls cause NPEs further down the line
      ret = "";
    }
  }
  return ret;
}

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

/**
 * 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
 */
@Override
public String getText() {
  String ret = text;
  if (ret == null) {
    if (body != null) {
      StringBuilder buf = new StringBuilder();
      for (int i = 0; i < body.size(); i++) {
        buf.append(body.getNode(i).getText());
      }
      ret = buf.toString();
    } else {
      // Nulls cause NPEs further down the line
      ret = "";
    }
  }
  return ret;
}

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

/**
 * 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
 */
@Override
public String getText() {
  String ret = text;
  if (ret == null) {
    if (body != null) {
      StringBuilder buf = new StringBuilder();
      for (int i = 0; i < body.size(); i++) {
        buf.append(body.getNode(i).getText());
      }
      ret = buf.toString();
    } else {
      // Nulls cause NPEs further down the line
      ret = "";
    }
  }
  return ret;
}

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

/**
 * 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
 */
@Override
public String getText() {
  String ret = text;
  if (ret == null) {
    if (body != null) {
      StringBuilder buf = new StringBuilder();
      for (int i = 0; i < body.size(); i++) {
        buf.append(body.getNode(i).getText());
      }
      ret = buf.toString();
    } else {
      // Nulls cause NPEs further down the line
      ret = "";
    }
  }
  return ret;
}

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

private void appendTag(Node n, boolean addDefaultNS)
    throws JasperException {
  Node.Nodes body = n.getBody();
  String text = n.getText();
  buf.append("<").append(n.getQName());
  buf.append("\n");
  printAttributes(n, addDefaultNS);
  buf.append("  ").append(jspIdPrefix).append(":id").append("=\"");
  buf.append(jspId++).append("\"\n");
  if (ROOT_ACTION.equals(n.getLocalName()) || body != null
        || text != null) {
    buf.append(">\n");
    if (ROOT_ACTION.equals(n.getLocalName())) {
      if (compiler.getCompilationContext().isTagFile()) {
        appendTagDirective();
      } else {
        appendPageDirective();
      }
    }
    if (body != null) {
      body.visit(this);
    } else {
      appendText(text, false);
    }
    buf.append("</" + n.getQName() + ">\n");
  } else {
    buf.append("/>\n");
  }
}

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

private void appendTag(Node n, boolean addDefaultNS)
    throws JasperException {
  Node.Nodes body = n.getBody();
  String text = n.getText();
  buf.append("<").append(n.getQName());
  buf.append("\n");
  printAttributes(n, addDefaultNS);
  buf.append("  ").append(jspIdPrefix).append(":id").append("=\"");
  buf.append(jspId++).append("\"\n");
  if (ROOT_ACTION.equals(n.getLocalName()) || body != null
        || text != null) {
    buf.append(">\n");
    if (ROOT_ACTION.equals(n.getLocalName())) {
      if (compiler.getCompilationContext().isTagFile()) {
        appendTagDirective();
      } else {
        appendPageDirective();
      }
    }
    if (body != null) {
      body.visit(this);
    } else {
      appendText(text, false);
    }
    buf.append("</" + n.getQName() + ">\n");
  } else {
    buf.append("/>\n");
  }
}

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

private void appendTag(Node n, boolean addDefaultNS)
  throws JasperException {
  Node.Nodes body = n.getBody();
  String text = n.getText();
  buf.append("<").append(n.getQName());
  buf.append("\n");
  printAttributes(n, addDefaultNS);
  buf.append("  ").append(jspIdPrefix).append(":id").append("=\"");
  buf.append(jspId++).append("\"\n");
  if (ROOT_ACTION.equals(n.getLocalName()) || body != null
      || text != null) {
  buf.append(">\n");
  if (ROOT_ACTION.equals(n.getLocalName())) {
    if (compiler.getCompilationContext().isTagFile()) {
    appendTagDirective();
    } else {
    appendPageDirective();
    }
  }
  if (body != null) {
    body.visit(this);
  } else {
    appendText(text, false);
  }
  buf.append("</" + n.getQName() + ">\n");
  } else {
  buf.append("/>\n");
  }
}

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

private void appendTag(Node n, boolean addDefaultNS)
  throws JasperException {
  Node.Nodes body = n.getBody();
  String text = n.getText();
  buf.append("<").append(n.getQName());
  buf.append("\n");
  printAttributes(n, addDefaultNS);
  buf.append("  ").append(jspIdPrefix).append(":id").append("=\"");
  buf.append(jspId++).append("\"\n");
  if (ROOT_ACTION.equals(n.getLocalName()) || body != null
      || text != null) {
  buf.append(">\n");
  if (ROOT_ACTION.equals(n.getLocalName())) {
    if (compiler.getCompilationContext().isTagFile()) {
    appendTagDirective();
    } else {
    appendPageDirective();
    }
  }
  if (body != null) {
    body.visit(this);
  } else {
    appendText(text, false);
  }
  buf.append("</" + n.getQName() + ">\n");
  } else {
  buf.append("/>\n");
  }
}

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

private void appendTag(Node n, boolean addDefaultNS)
  throws JasperException {
  Node.Nodes body = n.getBody();
  String text = n.getText();
  buf.append("<").append(n.getQName());
  buf.append("\n");
  printAttributes(n, addDefaultNS);
  buf.append("  ").append(jspIdPrefix).append(":id").append("=\"");
  buf.append(jspId++).append("\"\n");
  if (ROOT_ACTION.equals(n.getLocalName()) || body != null
      || text != null) {
  buf.append(">\n");
  if (ROOT_ACTION.equals(n.getLocalName())) {
    if (compiler.getCompilationContext().isTagFile()) {
    appendTagDirective();
    } else {
    appendPageDirective();
    }
  }
  if (body != null) {
    body.visit(this);
  } else {
    appendText(text, false);
  }
  buf.append("</" + n.getQName() + ">\n");
  } else {
  buf.append("/>\n");
  }
}

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

private void appendTag(Node n, boolean addDefaultNS)
  throws JasperException {
  Node.Nodes body = n.getBody();
  String text = n.getText();
  buf.append("<").append(n.getQName());
  buf.append("\n");
  printAttributes(n, addDefaultNS);
  buf.append("  ").append(jspIdPrefix).append(":id").append("=\"");
  buf.append(jspId++).append("\"\n");
  if (ROOT_ACTION.equals(n.getLocalName()) || body != null
      || text != null) {
  buf.append(">\n");
  if (ROOT_ACTION.equals(n.getLocalName())) {
    if (compiler.getCompilationContext().isTagFile()) {
    appendTagDirective();
    } else {
    appendPageDirective();
    }
  }
  if (body != null) {
    body.visit(this);
  } else {
    appendText(text, false);
  }
  buf.append("</" + n.getQName() + ">\n");
  } else {
  buf.append("/>\n");
  }
}

相关文章