org.jdom.Attribute.getNamespaceURI()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(98)

本文整理了Java中org.jdom.Attribute.getNamespaceURI()方法的一些代码示例,展示了Attribute.getNamespaceURI()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Attribute.getNamespaceURI()方法的具体详情如下:
包路径:org.jdom.Attribute
类名称:Attribute
方法名:getNamespaceURI

Attribute.getNamespaceURI介绍

[英]This returns the URI mapped to this Attribute's prefix. If no mapping is found, an empty String is returned.
[中]这将返回映射到此Attribute前缀的URI。如果未找到映射,则返回空String

代码示例

代码示例来源:origin: jaxen/jaxen

public String getAttributeNamespaceUri(Object obj)
{
  Attribute attr = (Attribute) obj;
  String uri = attr.getNamespaceURI();
  if ( uri != null && uri.length() == 0 ) 
    return null;
  else
    return uri;
}

代码示例来源:origin: org.freemarker/freemarker

@Override
String getNamespaceUri(Object node) {
  if (node instanceof Element) {
    return ((Element) node).getNamespaceURI();
  }
  if (node instanceof Attribute) {
    return ((Attribute) node).getNamespaceURI();
  }
  return null;
}

代码示例来源:origin: commons-jxpath/commons-jxpath

public String getNamespaceURI() {
  String uri = attr.getNamespaceURI();
  if (uri != null && uri.equals("")) {
    uri = null;
  }
  return uri;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.freemarker

@Override
String getNamespaceUri(Object node) {
  if (node instanceof Element) {
    return ((Element) node).getNamespaceURI();
  }
  if (node instanceof Attribute) {
    return ((Attribute) node).getNamespaceURI();
  }
  return null;
}

代码示例来源:origin: org.freemarker/com.springsource.freemarker

String getNamespaceUri(Object node) {
  if(node instanceof Element) {
    return ((Element)node).getNamespaceURI();
  }
  if(node instanceof Attribute) {
    return ((Attribute)node).getNamespaceURI();
  }
  return null;
}

代码示例来源:origin: org.freemarker/freemarker-gae

@Override
String getNamespaceUri(Object node) {
  if (node instanceof Element) {
    return ((Element) node).getNamespaceURI();
  }
  if (node instanceof Attribute) {
    return ((Attribute) node).getNamespaceURI();
  }
  return null;
}

代码示例来源:origin: apache/cxf

public String getAttributeNamespace(int i) {
  return getAttribute(i).getNamespaceURI();
}

代码示例来源:origin: org.codehaus.xfire/xfire-core

public String getAttributeNamespace(int i)
{
  return getAttribute(i).getNamespaceURI();
}

代码示例来源:origin: org.apache.cxf/cxf-rt-databinding-aegis

public String getAttributeNamespace(int i) {
  return getAttribute(i).getNamespaceURI();
}

代码示例来源:origin: org.jdom/jdom-legacy

/**
 * Return index of the <code>Attribute</code> with the
 * given name and uri.
 */
int indexOf(String name, Namespace namespace) {
  String uri = namespace.getURI();
  if (elementData != null) {
    for (int i = 0; i < size; i++) {
      Attribute old = elementData[i];
      String oldURI = old.getNamespaceURI();
      String oldName = old.getName();
      if (oldURI.equals(uri) && oldName.equals(name)) {
        return i;
      }
    }
  }
  return -1;
}

代码示例来源:origin: apache/cxf

public QName getAttributeName(int i) {
  Attribute at = getAttribute(i);
  return new QName(at.getNamespaceURI(), at.getName(), at.getNamespacePrefix());
}

代码示例来源:origin: org.codehaus.xfire/xfire-core

public QName getAttributeName(int i)
{
  Attribute at = getAttribute(i);
  
  return new QName(at.getNamespaceURI(), at.getName(), at.getNamespacePrefix());
}

代码示例来源:origin: org.apache.cxf/cxf-rt-databinding-aegis

public QName getAttributeName(int i) {
  Attribute at = getAttribute(i);
  return new QName(at.getNamespaceURI(), at.getName(), at.getNamespacePrefix());
}

代码示例来源:origin: apache/cxf

Attribute attr = (Attribute)itr.next();
String attPrefix = attr.getNamespacePrefix();
String attUri = attr.getNamespaceURI();

代码示例来源:origin: org.jdom/jdom-legacy

private org.w3c.dom.Attr output(Attribute attribute,
                 org.w3c.dom.Document domDoc)
                 throws JDOMException {
   org.w3c.dom.Attr domAttr = null;
   try {
     if (attribute.getNamespace() == Namespace.NO_NAMESPACE) {
       // No namespace, use createAttribute
       if (forceNamespaceAware) {
         domAttr = domDoc.createAttributeNS(null, attribute.getQualifiedName());
       } else {
         domAttr = domDoc.createAttribute(attribute.getQualifiedName());
       }
     }
     else {
       domAttr = domDoc.createAttributeNS(attribute.getNamespaceURI(),
                       attribute.getQualifiedName());
     }
     domAttr.setValue(attribute.getValue());
   } catch (Exception e) {
     throw new JDOMException("Exception outputting Attribute " +
                 attribute.getQualifiedName(), e);
   }
   return domAttr;
}

代码示例来源:origin: org.jdom/jdom-legacy

while (i.hasNext()) {
  Attribute a = (Attribute) i.next();
  atts.addAttribute(a.getNamespaceURI(),
           a.getName(),
           a.getQualifiedName(),

代码示例来源:origin: org.apache.cxf/cxf-rt-databinding-aegis

Attribute attr = (Attribute)itr.next();
String attPrefix = attr.getNamespacePrefix();
String attUri = attr.getNamespaceURI();

代码示例来源:origin: org.codehaus.xfire/xfire-core

String attUri = attr.getNamespaceURI();

代码示例来源:origin: org.jdom/jdom-legacy

domElement.setAttributeNS(attribute.getNamespaceURI(),
             attribute.getQualifiedName(),
             attribute.getValue());

相关文章