nu.xom.Attribute.getQualifiedName()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(8.3k)|赞(0)|评价(0)|浏览(138)

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

Attribute.getQualifiedName介绍

[英]Returns the qualified name of this attribute, including the prefix if this attribute is in a namespace.
[中]返回此属性的限定名称,如果此属性位于命名空间中,则包括前缀。

代码示例

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

public String getAttributeQName(Object o) {
  return (isAttribute(o) ? ((Attribute)o).getQualifiedName() : null);
}

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

public String getAttributeName(int index) {
  return decodeAttribute(currentElement.getAttribute(index).getQualifiedName());
}

代码示例来源:origin: pierre/meteo

/**
 * <p>
 * Returns a string representation of the attribute 
 * that is a well-formed XML attribute. 
 * </p>
 * 
 * @return a string containing the XML form of this attribute
 */
public final String toXML() {
  // It's a common belief that methods like this one should be
  // implemented using StringBuffers rather than String 
  // concatenation for maximum performance. However, 
  // disassembling the code shows that today's compilers are 
  // smart enough to figure this out for themselves. The compiled
  // version of this class only uses a single StringBuffer. No 
  // benefit would be gained by making the code more opaque here. 
  return getQualifiedName() + "=\"" + escapeText(value) + "\"";    
}

代码示例来源:origin: pierre/meteo

/**
 * <p>
 * Returns a string representation of the attribute suitable for 
 * debugging and diagnosis. However, this is not necessarily 
 * a well-formed XML attribute.
 * </p>
 * 
 *  @return a non-XML string representation of this attribute
 *
 * @see java.lang.Object#toString()
 */
public final String toString() {
  return "[" + getClass().getName() + ": " 
   + getQualifiedName() + "=\"" 
   + Text.escapeLineBreaksAndTruncate(getValue()) + "\"]";
}

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

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

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

public String getAttributeName(int index) {
  return unescapeXmlName(currentElement.getAttribute(index).getQualifiedName());
}

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

public String getAttributeName(int index) {
  return decodeAttribute(currentElement.getAttribute(index).getQualifiedName());
}

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

public String getAttributeName(int index) {
  return unescapeXmlName(currentElement.getAttribute(index).getQualifiedName());
}

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

public String getAttributeName(int index) {
  return decodeAttribute(currentElement.getAttribute(index).getQualifiedName());
}

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

public String getAttributeName(int index) {
  return decodeAttribute(currentElement.getAttribute(index).getQualifiedName());
}

代码示例来源:origin: apache/servicemix-bundles

public String getAttributeName(int index) {
  return decodeAttribute(currentElement.getAttribute(index).getQualifiedName());
}

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

public String getAttributeName(int index) {
  return decodeAttribute(currentElement.getAttribute(index).getQualifiedName());
}

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

public String getAttributeName(int index) {
  return unescapeXmlName(currentElement.getAttribute(index).getQualifiedName());
}

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

/**
 * Get the display name of this node. For elements and attributes this is
 * [prefix:]localname. For unnamed nodes, it is an empty string.
 *
 * @return The display name of this node. For a node with no name, return an
 *         empty string.
 */
public String getDisplayName() {
  switch (nodeKind) {
    case Type.ELEMENT:
      return ((Element) node).getQualifiedName();
    case Type.ATTRIBUTE:
      return ((Attribute) node).getQualifiedName();
    case Type.PROCESSING_INSTRUCTION:
      return ((ProcessingInstruction) node).getTarget();
    default:
      return "";
  }
}

代码示例来源:origin: org.teiid/saxon-xom

/**
 * Get the display name of this node. For elements and attributes this is
 * [prefix:]localname. For unnamed nodes, it is an empty string.
 *
 * @return The display name of this node. For a node with no name, return an
 *         empty string.
 */
public String getDisplayName() {
  switch (nodeKind) {
    case Type.ELEMENT:
      return ((Element) node).getQualifiedName();
    case Type.ATTRIBUTE:
      return ((Attribute) node).getQualifiedName();
    case Type.PROCESSING_INSTRUCTION:
      return ((ProcessingInstruction) node).getTarget();
    default:
      return "";
  }
}

代码示例来源:origin: org.jboss.teiid/teiid-engine

/**
 * Get the display name of this node. For elements and attributes this is
 * [prefix:]localname. For unnamed nodes, it is an empty string.
 *
 * @return The display name of this node. For a node with no name, return an
 *         empty string.
 */
public String getDisplayName() {
  switch (nodeKind) {
    case Type.ELEMENT:
      return ((Element) node).getQualifiedName();
    case Type.ATTRIBUTE:
      return ((Attribute) node).getQualifiedName();
    case Type.PROCESSING_INSTRUCTION:
      return ((ProcessingInstruction) node).getTarget();
    default:
      return "";
  }
}

代码示例来源:origin: zanata/zanata-platform

private static Map<String, Object> buildMetadata(Element fromElem) {
  Map<String, Object> metadata = Maps.newHashMap();
  for (int i = 0; i < fromElem.getAttributeCount(); i++) {
    Attribute attr = fromElem.getAttribute(i);
    String uri = attr.getNamespaceURI();
    String name = attr.getLocalName();
    if (inTmxNamespace(uri)) {
      String value = attr.getValue();
      metadata.put(name, value);
    } else if (attr.getQualifiedName().equals(XML_LANG)) {
      String value = attr.getValue();
      metadata.put(attr.getQualifiedName(), value);
    }
  }
  List<String> childrenXml = getChildrenAsXml(fromElem);
  metadata.put(TMX_ELEMENT_CHILDREN, childrenXml);
  return metadata;
}

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

/**
 * This method overrides the XmlElement definition so that it can allow
 * the definition of the href attribute. All other attributes are
 * shown as 'Unknown Attribute' info elements.
 *
 * @param element The element that contains the attributes
 * @param info    The info object that will hold the validation info.
 */
@Override
protected void processUnexpectedAttributes(Element element, SwordValidationInfo info) {
  int attributeCount = element.getAttributeCount();
  Attribute attribute = null;
  for (int i = 0; i < attributeCount; i++) {
    attribute = element.getAttribute(i);
    if (!ATTRIBUTE_HREF_NAME.getLocalName().equals(attribute.getQualifiedName())) {
      XmlName attributeName = new XmlName(attribute.getNamespacePrefix(),
                        attribute.getLocalName(),
                        attribute.getNamespaceURI());
      SwordValidationInfo item = new SwordValidationInfo(xmlName, attributeName,
                                SwordValidationInfo.UNKNOWN_ATTRIBUTE,
                                SwordValidationInfoType.INFO);
      item.setContentDescription(attribute.getValue());
      info.addUnmarshallAttributeInfo(item);
    }
  }
}

代码示例来源:origin: org.dspace/dspace-sword-api

/**
* This method overrides the XmlElement definition so that it can allow
* the definition of the href attribute. All other attributes are
* shown as 'Unknown Attribute' info elements.
*
* @param element The element that contains the attributes
* @param info    The info object that will hold the validation info. 
*/
@Override
protected void processUnexpectedAttributes(Element element, SwordValidationInfo info)
{
  int attributeCount = element.getAttributeCount();
  Attribute attribute = null;
  for( int i = 0; i < attributeCount; i++ )
  {
    attribute = element.getAttribute(i);
    if( ! ATTRIBUTE_HREF_NAME.getLocalName().equals(attribute.getQualifiedName()) )
    {
      XmlName attributeName = new XmlName(attribute.getNamespacePrefix(),
          attribute.getLocalName(),
          attribute.getNamespaceURI());
      SwordValidationInfo item = new SwordValidationInfo(xmlName, attributeName,
          SwordValidationInfo.UNKNOWN_ATTRIBUTE,
          SwordValidationInfoType.INFO);
      item.setContentDescription(attribute.getValue());
      info.addUnmarshallAttributeInfo(item);
    }
  }
}

代码示例来源:origin: org.swordapp/sword-common

/**
* This method overrides the XmlElement definition so that it can allow
* the definition of the href attribute. All other attributes are
* shown as 'Unknown Attribute' info elements.
*
* @param element The element that contains the attributes
* @param info    The info object that will hold the validation info. 
*/
@Override
protected void processUnexpectedAttributes(Element element, SwordValidationInfo info)
{
  int attributeCount = element.getAttributeCount();
  Attribute attribute = null;
  for( int i = 0; i < attributeCount; i++ )
  {
    attribute = element.getAttribute(i);
    if( ! ATTRIBUTE_HREF_NAME.getLocalName().equals(attribute.getQualifiedName()) )
    {
      XmlName attributeName = new XmlName(attribute.getNamespacePrefix(),
          attribute.getLocalName(),
          attribute.getNamespaceURI());
      SwordValidationInfo item = new SwordValidationInfo(xmlName, attributeName,
          SwordValidationInfo.UNKNOWN_ATTRIBUTE,
          SwordValidationInfoType.INFO);
      item.setContentDescription(attribute.getValue());
      info.addUnmarshallAttributeInfo(item);
    }
  }
}

相关文章