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

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

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

Attribute.getQualifiedName介绍

[英]This will retrieve the qualified name of the Attribute. For any XML attribute whose name is [namespacePrefix]:[elementName], the qualified name of the attribute would be everything (both namespace prefix and element name). When the attribute has no namespace, the qualified name is simply the attribute's local name.

To obtain the local name of the attribute, the #getName() method should be used.

To obtain the namespace prefix for this attribute, the #getNamespacePrefix() method should be used.
[中]这将检索Attribute的限定名称。对于名称为[namespacePrefix]:[elementName]的任何XML属性,该属性的限定名称将是所有内容(名称空间前缀和元素名称)。当属性没有名称空间时,限定名称只是属性的本地名称。
要获取属性的本地名称,应使用#getName()方法。
要获取此属性的命名空间前缀,应使用#getNamespacePrefix()方法。

代码示例

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

public List operate(Object node) {
      if (node instanceof Element)
        return Collections.singletonList(((Element) node).getQualifiedName());
      else if (node instanceof Attribute)
        return Collections.singletonList(((Attribute) node).getQualifiedName());
      // With 2.1 semantics it  makes more sense to just return a null and let the core 
      // throw an InvalidReferenceException and the template writer can use ?exists etcetera. (JR)
      return null;
//            throw new TemplateModelException("_qname can not be applied on " + node.getClass());
    }
  }

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

public void output(Attribute attribute, Writer out)
  throws IOException {
    out.write(" ");
    out.write(attribute.getQualifiedName());
    out.write("=");
    out.write("\"");
    out.write(escapeAttributeEntities(attribute.getValue()));
    out.write("\"");
  }
}

代码示例来源:origin: com.thoughtworks.xstream/xstream

public String getAttributeName(int index) {
  return decodeAttribute(((Attribute) currentElement.getAttributes().get(index)).getQualifiedName());
}

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

Attribute attribute = (Attribute) node;
sw.write(" ");
sw.write(attribute.getQualifiedName());
sw.write("=\"");
sw.write(OUTPUT.escapeAttributeEntities(attribute.getValue()));

代码示例来源:origin: info.magnolia/magnolia-core

protected List<Attribute> sortAttributes(List attributes) throws IOException {
  List<Attribute> sortedAttributes = new ArrayList<>(attributes);
  sortedAttributes.sort((o1, o2) -> o1.getQualifiedName().compareTo(o2.getQualifiedName()));
  return sortedAttributes;
}

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

public List operate(Object node) {
      if (node instanceof Element)
        return Collections.singletonList(((Element) node).getQualifiedName());
      else if (node instanceof Attribute)
        return Collections.singletonList(((Attribute) node).getQualifiedName());
      // With 2.1 semantics it  makes more sense to just return a null and let the core 
      // throw an InvalidReferenceException and the template writer can use ?exists etcetera. (JR)
      return null;
//            throw new TemplateModelException("_qname can not be applied on " + node.getClass());
    }
  }

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

public List operate(Object node) {
      if (node instanceof Element)
        return Collections.singletonList(((Element) node).getQualifiedName());
      else if (node instanceof Attribute)
        return Collections.singletonList(((Attribute) node).getQualifiedName());
      // With 2.1 semantics it  makes more sense to just return a null and let the core 
      // throw an InvalidReferenceException and the template writer can use ?exists etcetera. (JR)
      return null;
//            throw new TemplateModelException("_qname can not be applied on " + node.getClass());
    }
  }

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

public void output(Attribute attribute, Writer out)
  throws IOException {
    out.write(" ");
    out.write(attribute.getQualifiedName());
    out.write("=");
    out.write("\"");
    out.write(escapeAttributeEntities(attribute.getValue()));
    out.write("\"");
  }
}

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

public void output(Attribute attribute, Writer out)
  throws IOException {
    out.write(" ");
    out.write(attribute.getQualifiedName());
    out.write("=");
    out.write("\"");
    out.write(escapeAttributeEntities(attribute.getValue()));
    out.write("\"");
  }
}

代码示例来源:origin: velocity/velocity-dep

public void output(Attribute attribute, Writer out)
    throws IOException
  {
    out.write(" ");
    out.write(attribute.getQualifiedName());
    out.write("=");
    
    out.write("\"");
    out.write(escapeAttributeEntities(attribute.getValue()));
    out.write("\"");            
  }
}

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

public void output(Attribute attribute, Writer out)
  throws
  IOException
  {
    out.write(" ");
    out.write(attribute.getQualifiedName());
    out.write("=");
    out.write("\"");
    out.write(escapeAttributeEntities(attribute.getValue()));
    out.write("\"");
  }
}

代码示例来源:origin: x-stream/xstream

@Override
public String getAttributeName(final int index) {
  return decodeAttribute(((Attribute)currentElement.getAttributes().get(index)).getQualifiedName());
}

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

public String getAttributeName(int index) {
  return decodeAttribute(((Attribute) currentElement.getAttributes().get(index)).getQualifiedName());
}

代码示例来源:origin: com.haulmont.thirdparty/xstream

public String getAttributeName(int index) {
  return decodeAttribute(((Attribute) currentElement.getAttributes().get(index)).getQualifiedName());
}

代码示例来源:origin: edu.internet2.middleware.grouper/grouperClient

public String getAttributeName(int index) {
  return unescapeXmlName(((Attribute) currentElement.getAttributes().get(index)).getQualifiedName());
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream-java8

public String getAttributeName(int index) {
  return decodeAttribute(((Attribute) currentElement.getAttributes().get(index)).getQualifiedName());
}

代码示例来源:origin: ovea-deprecated/jetty-session-redis

public String getAttributeName(int index) {
  return unescapeXmlName(((Attribute) currentElement.getAttributes().get(index)).getQualifiedName());
}

代码示例来源:origin: org.jvnet.hudson/xstream

public String getAttributeName(int index) {
  return unescapeXmlName(((Attribute) currentElement.getAttributes().get(index)).getQualifiedName());
}

代码示例来源:origin: org.sonatype.nexus.xstream/xstream

public String getAttributeName(int index) {
  return decodeAttribute(((Attribute) currentElement.getAttributes().get(index)).getQualifiedName());
}

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

public List operate(Object node)
    {
      if (node instanceof Element)
        return Collections12.singletonList(((Element)node).getQualifiedName());
      else if (node instanceof Attribute)
        return Collections12.singletonList(((Attribute)node).getQualifiedName());
      // With 2.1 semantics it  makes more sense to just return a null and let the core 
      // throw an InvalidReferenceException and the template writer can use ?exists etcetera. (JR)
      return null;
//            throw new TemplateModelException("_qname can not be applied on " + node.getClass());
    }
  }

相关文章