Package com.caucho.xml

Examples of com.caucho.xml.QName


    Element child = getUniqueChildElement(node);
   
    if (child == null)
      return null;

    QName qName = ((QNode) child).getQName();
    String uri = qName.getNamespaceURI();

    if (uri == null || ! uri.startsWith("urn:java:"))
      return null;

    return child;
View Full Code Here


        else {
          return type.valueOf(text);
        }
      }

      QName qName = ((QNode) childNode).getQName();

      ConfigType<?> childBeanType = type.createType(qName);

      if (childBeanType != null) {
        childBean = childBeanType.create(null, qName);
View Full Code Here

            String defName = _grammar.generateId();
           
            child = new ElementPattern(defName);

            if (name != null) {
              QName eltQName = getName(name);
              child.addNameChild(new NamePattern(eltQName));
            }

            if (name != null) {
              QName attrQName = getName(name);
              child.addNameChild(new NamePattern(attrQName));
            }
           
            _grammar.setDefinition(defName, child);
          }
          else if (localName.equals("attribute")) {
            String name = attrs.getValue("name");

            child = new AttributePattern();
           
            if (name != null) {
              QName attrQName = new QName(name, _ns);
              child.addNameChild(new NamePattern(attrQName));
            }
          }
          else if (localName.equals("empty")) {
            child = new EmptyPattern();
View Full Code Here

    if (p > 0) {
      String prefix = name.substring(0, p);
      String ns = _nsMap.get(prefix);

      if (ns != null)
        return new QName(name, ns);
      else
        return new QName(name, _ns);
    }
    else
      return new QName(name, _ns);
  }
View Full Code Here

    }
  }

  private NamePattern createNamePattern(String localName, String namespace)
  {
    return new NamePattern(new QName(localName, namespace));
  }
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

   */
  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

    os.print("<" + name);
   
    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

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.