Package com.caucho.xml

Examples of com.caucho.xml.QName


    os.print(" xmlns:" + prefix + "=\"" + uri + "\"");
   
    printJspId(os);

    for (int i = 0; i < _attributeNames.size(); i++) {
      QName attrName = _attributeNames.get(i);
      Object value = _attributeValues.get(i);

      if (value instanceof String) {
        String string = (String) value;

        printXmlAttribute(os, attrName.getName(), string);
      }
    }

    os.print(">");
View Full Code Here


    boolean isDynamic = DynamicAttributes.class.isAssignableFrom(_tagClass);
   
    // fill all mentioned attributes
    for (int i = 0; i < _attributeNames.size(); i++) {
      QName attrName = _attributeNames.get(i);
      Object value = _attributeValues.get(i);
     
      TagAttributeInfo attribute = getAttributeInfo(attrName);
     
      if (attrs != null && attribute == null && ! isDynamic)
        throw error(L.l("unexpected attribute '{0}' in <{1}>",
                        attrName.getName(), getTagName()));

      if (_tag.getAttribute(attrName) != null)
        continue;

      boolean isFragment = false;
View Full Code Here

  }

  private int getAttributeIndex(String name)
  {
    for (int i = 0; i < _attributeNames.size(); i++) {
      QName attrName = _attributeNames.get(i);

      if (isNameMatch(name, attrName))
        return i;
    }
View Full Code Here

      out.println(var + ".setParent((javax.servlet.jsp.tagext.Tag) " + parentName + ");");
    }

    ArrayList<QName> names = _tag.getAttributeNames();
    for (int i = 0; i < names.size(); i++) {
      QName name = names.get(i);

      String value = _tag.getAttribute(name);
      if (value == null)
        continue;
     
      TagAttributeInfo attrInfo = _tag.getAttributeInfo(name.getLocalName());

      boolean isRequestTime = true;

      if (attrInfo != null)
        isRequestTime = attrInfo.canBeRequestTime();
View Full Code Here

                             String prefix,
                             String localName,
                             String uri,
                             Class cl)
  {
    map.put(new QName(prefix, localName, uri), cl);
    map.put(new QName(prefix, localName, "urn:jsptld:" + uri), cl);
  }
View Full Code Here

    throws JspParseException
  {
    if (node instanceof JspAttribute) {
      JspAttribute attr = (JspAttribute) node;

      QName name = attr.getName();

      addAttribute(name, attr);
    }
  }
View Full Code Here

      processTaglib(prefix, JSTL_CORE_URI);
    }

    setLocation(jspPath, filename, line);
    _jspBuilder.startElement(JSTL_CORE_OUT);
    _jspBuilder.attribute(new QName("value"), cb.close());
    _jspBuilder.attribute(new QName("escapeXml"), "false");
    _jspBuilder.endAttributes();
    _jspBuilder.endElement(JSTL_CORE_OUT.getName());

    return ch;
  }
View Full Code Here

    }

    if (name.startsWith("$"))
      name = name.substring(1);

    _jspBuilder.attribute(new QName("var"), name);

    cb.clear();
    parseVelocityExpr(cb, ')');
    String expr = cb.close();

    if (expr.indexOf("..") > 0) {
      int h = 0;
      for (; Character.isWhitespace(expr.charAt(h)); h++) {
      }

      if (expr.charAt(h) != '[')
        throw error(L.l("Expected '[' for #foreach `{0}'.  The velocity-style #foreach syntax is: #foreach ([Type] $a in [min .. max])",
                        badChar(expr.charAt(h))));

      int t = expr.length() - 1;
      for (; Character.isWhitespace(expr.charAt(t)); t--) {
      }

      if (expr.charAt(t) != ']')
        throw error(L.l("Expected ']' for #foreach `{0}'.  The velocity-style #foreach syntax is: #foreach ($a in [min .. max])",
                        badChar(expr.charAt(t))));

      int p = expr.indexOf("..");

      String min = expr.substring(h + 1, p);
      String max = expr.substring(p + 2, t);

      _jspBuilder.attribute(new QName("begin"), "${" + min + "}");
      _jspBuilder.attribute(new QName("end"), "${" + max + "}");
    }
    else {
      _jspBuilder.attribute(new QName("items"), "${" + expr + "}");
    }
    _jspBuilder.endAttributes();

    return skipWhitespaceToEndOfLine(read());
  }
View Full Code Here

    _jspBuilder.startElement(JSTL_CORE_WHEN);
    _lineStart = _line;

    CharBuffer cb = CharBuffer.allocate();
    parseVelocityExpr(cb, ')');
    _jspBuilder.attribute(new QName("test"), "${" + cb.close() + "}");
    _jspBuilder.endAttributes();

    return skipWhitespaceToEndOfLine(read());
  }
View Full Code Here

    _lineStart = _line;

    int ch = read();

    // probably should be a qname
    QName eltName = null;

    switch (ch) {
    case '=':
      eltName = JSP_EXPRESSION;
      ch = read();
      break;

    case '!':
      eltName = JSP_DECLARATION;
      ch = read();
      break;

    case '@':
      parseDirective();
      return;

    case '-':
      if ((ch = read()) == '-') {
        parseComment();
        return;
      }
      else {
        eltName = JSP_SCRIPTLET;
        addText('-');
      }
      break;

    default:
      eltName = JSP_SCRIPTLET;
      break;
    }

    setLocation(_jspPath, _filename, _lineStart);
    _jspBuilder.startElement(eltName);
    _jspBuilder.endAttributes();

    while (ch >= 0) {
      switch (ch) {
      case '\\':
        addText('\\');
        ch = read();
        if (ch >= 0)
          addText((char) ch);
        ch = read();
        break;

      case '%':
        ch = read();
        if (ch == '>') {
          createText();
          setLocation();
          _jspBuilder.endElement(eltName.getName());
          return;
        }
        else if (ch == '\\') {
          ch = read();
          if (ch == '>') {
            addText("%");
          }
          else
            addText("%\\");
        }
        else
          addText('%');
        break;

      default:
        addText((char) ch);
        ch = read();
        break;
      }
    }

    createText();
    setLocation();
    _jspBuilder.endElement(eltName.getName());
  }
View Full Code Here

TOP

Related Classes of com.caucho.xml.QName

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.