Package com.caucho.xml

Examples of com.caucho.xml.QName


   
      XslNode literal = createChild(top);

      XslTemplate template = new XslTemplate();
      template.setGenerator((JavaGenerator) this);
      template.addAttribute(new QName("match"), "/");
      template.addChild(literal);

      template.generateDeclaration(getOut());
   
      template.generate(getOut());
View Full Code Here


        inputOffset = 0;
      }
      else {
        _nameKey.init(valueBuf, 0, valueOffset);

        QName name = _nameMap.get(_nameKey);

        if (name == null) {
          name = new QName(new String(valueBuf, 0, valueOffset), null);
          _nameMap.put(new NameKey(valueBuf, 0, valueOffset), name);
        }

        return name;
      }

      char ch = inputBuf[inputOffset++];

      if (XML_NAME_CHAR[ch])
        valueBuf[valueOffset++] = ch;
      else if (ch == ':') {
        valueBuf[valueOffset++] = ch;
      }
      else {
        _inputOffset = inputOffset - 1;

        QName name = _nameMap.get(_nameKey);

        if (name == null) {
          name = new QName(new String(valueBuf, 0, valueOffset), null);
          _nameMap.put(new NameKey(valueBuf, 0, valueOffset), name);
        }

        return name;
      }
View Full Code Here

   */
  public void setNode(Node node)
  {
    _node = node;

    setQName(new QName(node.getNodeName(), null));
  }
View Full Code Here

  {
    if (gen == null)
      throw new NullPointerException();
   
    setGenerator(gen);
    setQName(new QName("jsp", "text", JSP_NS));
    setParent(parent);

    _text = text;
  }
View Full Code Here

    node.setParent(this);
   
    if (node instanceof JspAttribute) {
      JspAttribute attr = (JspAttribute) node;

      QName name = attr.getName();

      addAttribute(name, attr);

      _hasJspAttribute = true;
View Full Code Here

    if (type != null) {
      return type;
    }

    if (! "".equals(name.getNamespaceURI())) {
      type = getEnvironmentType(new QName(name.getLocalName()));

      if (type != null) {
        _attrMap.put(name, type);

        return type;
View Full Code Here

      out.println(var + "_adapter = new javax.servlet.jsp.tagext.TagAdapter(" + var + ");");
    }

    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;

      generateSetAttribute(out, var, name, value, false, false,
                           _tag.getAttributeInfo(name.getLocalName()));
    }
  }
View Full Code Here

    addTagDepend();
   
    Hashtable<String,Object> tags = new Hashtable<String,Object>();

    for (int i = 0; i < _attributeNames.size(); i++) {
      QName qName = _attributeNames.get(i);
      Object value = _attributeValues.get(i);
      String name = qName.getName();

      TagAttributeInfo attrInfo = getAttributeInfo(qName);
      Method method = getAttributeMethod(qName);
     
      Class type = null;
View Full Code Here

    if (super.hasScripting())
      return true;

    // Any conflicting values must be set each time.
    for (int i = 0; i < _attributeValues.size(); i++) {
      QName name = _attributeNames.get(i);
      Object value = _attributeValues.get(i);

      try {
        if (value instanceof String && hasRuntimeAttribute((String) value))
          return true;
View Full Code Here

  @Override
  public void generatePrologue(JspJavaWriter out)
    throws Exception
  {
    for (int i = 0; i < _attributeNames.size(); i++) {
      QName name = _attributeNames.get(i);
      Object value = _attributeValues.get(i);
     
      if (! (value instanceof JspFragmentNode))
        continue;
     
      JspFragmentNode frag = (JspFragmentNode) value;
     
      TagAttributeInfo attribute = getAttributeInfo(name);
      String typeName = null;

      boolean isFragment = false;

      if (attribute != null && attribute.isFragment())
        isFragment = true;

      String fragmentClass = JspFragment.class.getName();
     
      if (attribute != null && fragmentClass.equals(attribute.getTypeName()))
        isFragment = true;

      Method method = getAttributeMethod(name);

      if (method != null) {
        typeName = method.getParameterTypes()[0].getName();
        if (fragmentClass.equals(typeName))
          isFragment = true;
      }

      if (isFragment)
        frag.generateFragmentPrologue(out);
    }
     
    TagInstance parent = getParent().getTag();

    boolean isBodyTag = BodyTag.class.isAssignableFrom(_tagClass);
    boolean isEmpty = isEmpty();
    boolean hasBodyContent = isBodyTag && ! isEmpty;

    _tag = parent.findTag(getQName(), _attributeNames,
                          hasBodyContent);

    if (_tag == null || ! _parseState.isRecycleTags()) {
      _tag = parent.addTag(_gen, getQName(), _tagInfo, _tagClass,
                           _attributeNames, _attributeValues,
                           hasBodyContent);

      if (! JspTagFileSupport.class.isAssignableFrom(_tagClass)) {
        out.printClass(_tagClass);
        out.println(" " + _tag.getId() + " = null;");
      }
      _isDeclaringInstance = true;

      /*
      if (SimpleTag.class.isAssignableFrom(_tagClass) && hasCustomTag())
        out.println("javax.servlet.jsp.tagext.Tag " + _tag.getId() + "_adapter = null;");
      */
    }
    else {
      // Any conflicting values must be set each time.
      for (int i = 0; i < _attributeNames.size(); i++) {
        QName name = _attributeNames.get(i);
        Object value = _attributeValues.get(i);
       
        _tag.addAttribute(name, value);
      }
    }
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.