Package com.caucho.jsp.java

Examples of com.caucho.jsp.java.JspNode


      }
      else if (name.equals("elseif")) {
        addText();
        setLocation();

        JspNode node = _jspBuilder.getCurrentNode();
        if (! "resin-c:when".equals(node.getTagName()))
          throw error(L.l("#elseif is missing a corresponding #if.  Velocity-style #if syntax needs matching #if ... #elseif ... #else ... #end.  The #if statements must also nest properly with any tags."));

        _jspBuilder.endElement("resin-c:when");
        ch = parseVelocityIf("elseif");
      }
      else if (name.equals("else")) {
        addText();
        setLocation();
        _jspBuilder.endElement("resin-c:when");

        setLocation(_jspPath, _filename, _lineStart);
        _lineStart = _line;
        _jspBuilder.startElement(JSTL_CORE_OTHERWISE);
        _jspBuilder.endAttributes();

        ch = skipWhitespaceToEndOfLine(ch);
      }
      else if (name.equals("foreach")) {
        ch = parseVelocityForeach("resin-c:forEach");
      }
      else if (name.equals("end")) {
        addText();

        JspNode node = _jspBuilder.getCurrentNode();
        String nodeName = null;
        if (node != null)
          nodeName = node.getTagName();

        if (nodeName.equals("resin-c:when") ||
            nodeName.equals("resin-c:otherwise")) {
          _jspBuilder.endElement(nodeName);
          _jspBuilder.endElement(JSTL_CORE_CHOOSE.getName());
View Full Code Here


    if (qname.equals(JSP_DIRECTIVE_TAGLIB))
      processTaglibDirective(keys, values);

    ch = skipWhitespace(read());

    JspNode node = _jspBuilder.getCurrentNode();

    if (ch == '/') {
      if ((ch = read()) != '>')
        throw error(L.l("expected '/>' at '{0}' (for tag '<{1}>' at line {2}).  The XML empty tag syntax is: <tag attr1='value1'/>",
                        badChar(ch), name, String.valueOf(_lineStart)));

      setLocation();
      _jspBuilder.endElement(qname.getName());
    }
    else if (ch != '>')
      throw error(L.l("expected '>' at '{0}' (for tag '<{1}>' at line {2}).  The XML tag syntax is: <tag attr1='value1'>",
                      badChar(ch), name, String.valueOf(_lineStart)));
    // If tagdependent and not XML mode, then read the raw text.
    else if ("tagdependent".equals(node.getBodyContent()) && ! _isXml) {
      String tail = "</" + name + ">";
      for (ch = read(); ch >= 0; ch = read()) {
        _text.append((char) ch);
        if (_text.endsWith(tail)) {
          _text.setLength(_text.length() - tail.length());
View Full Code Here

    ch = skipWhitespace(ch);
    if (ch != '>')
      throw error(L.l("expected '>' at {0}.  The XML close tag syntax is </name>.", badChar(ch)));

    JspNode node = _jspBuilder.getCurrentNode();
    String nodeName = node.getTagName();
    if (nodeName.equals(name)) {
    }
    else if (nodeName.equals("resin-c:when")) {
      throw error(L.l("#if expects closing #end before </{0}> (#if at {1}).  #if statements require #end before the enclosing tag closes.",
                      name, String.valueOf(node.getStartLine())));
    }
    else if (nodeName.equals("resin-c:otherwise")) {
      throw error(L.l("#else expects closing #end before </{0}> (#else at {1}).  #if statements require #end before the enclosing tag closes.",
                      name, String.valueOf(node.getStartLine())));
    }
    else {
      throw error(L.l("expected </{0}> at </{1}>.  Closing tags must match opened tags.",
                      nodeName, name));
    }
View Full Code Here

      }
      else if (name.equals("elseif")) {
        addText();
        setLocation();

        JspNode node = _jspBuilder.getCurrentNode();
        if (! "resin-c:when".equals(node.getTagName()))
          throw error(L.l("#elseif is missing a corresponding #if.  Velocity-style #if syntax needs matching #if ... #elseif ... #else ... #end.  The #if statements must also nest properly with any tags."));

        _jspBuilder.endElement("resin-c:when");
        ch = parseVelocityIf("elseif");
      }
      else if (name.equals("else")) {
        addText();
        setLocation();
        _jspBuilder.endElement("resin-c:when");

        setLocation(_jspPath, _filename, _lineStart);
        _lineStart = _line;
        _jspBuilder.startElement(JSTL_CORE_OTHERWISE);
        _jspBuilder.endAttributes();

        ch = skipWhitespaceToEndOfLine(ch);
      }
      else if (name.equals("foreach")) {
        ch = parseVelocityForeach("resin-c:forEach");
      }
      else if (name.equals("end")) {
        addText();

        JspNode node = _jspBuilder.getCurrentNode();
        String nodeName = null;
        if (node != null)
          nodeName = node.getTagName();

        if (nodeName.equals("resin-c:when") ||
            nodeName.equals("resin-c:otherwise")) {
          _jspBuilder.endElement(nodeName);
          _jspBuilder.endElement(JSTL_CORE_CHOOSE.getName());
View Full Code Here

    if (qname.equals(JSP_DIRECTIVE_TAGLIB))
      processTaglibDirective(keys, values);

    ch = skipWhitespace(read());

    JspNode node = _jspBuilder.getCurrentNode();

    if (ch == '/') {
      if ((ch = read()) != '>')
        throw error(L.l("expected '/>' at '{0}' (for tag '<{1}>' at line {2}).  The XML empty tag syntax is: <tag attr1='value1'/>",
                        badChar(ch), name, String.valueOf(_lineStart)));

      setLocation();
      _jspBuilder.endElement(qname.getName());
    }
    else if (ch != '>')
      throw error(L.l("expected '>' at '{0}' (for tag '<{1}>' at line {2}).  The XML tag syntax is: <tag attr1='value1'>",
                      badChar(ch), name, String.valueOf(_lineStart)));
    // If tagdependent and not XML mode, then read the raw text.
    else if ("tagdependent".equals(node.getBodyContent()) && ! _isXml) {
      String tail = "</" + name + ">";
      for (ch = read(); ch >= 0; ch = read()) {
        _text.append((char) ch);
        if (_text.endsWith(tail)) {
          _text.setLength(_text.length() - tail.length());
View Full Code Here

    ch = skipWhitespace(ch);
    if (ch != '>')
      throw error(L.l("expected '>' at {0}.  The XML close tag syntax is </name>.", badChar(ch)));

    JspNode node = _jspBuilder.getCurrentNode();
    String nodeName = node.getTagName();
    if (nodeName.equals(name)) {
    }
    else if (nodeName.equals("resin-c:when")) {
      throw error(L.l("#if expects closing #end before </{0}> (#if at {1}).  #if statements require #end before the enclosing tag closes.",
                      name, String.valueOf(node.getStartLine())));
    }
    else if (nodeName.equals("resin-c:otherwise")) {
      throw error(L.l("#else expects closing #end before </{0}> (#else at {1}).  #if statements require #end before the enclosing tag closes.",
                      name, String.valueOf(node.getStartLine())));
    }
    else {
      throw error(L.l("expected </{0}> at </{1}>.  Closing tags must match opened tags.",
                      nodeName, name));
    }
View Full Code Here

TOP

Related Classes of com.caucho.jsp.java.JspNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.