gpt4 book ai didi

com.google.gdata.util.common.xml.XmlNamespace.getAlias()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 18:20:40 27 4
gpt4 key购买 nike

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

XmlNamespace.getAlias介绍

[英]Returns the prefix alias for the namespace or null if undefined.
[中]返回命名空间的前缀别名,如果未定义,则返回null。

代码示例

代码示例来源:origin: com.google.gdata/gdata-core-1.0

/**
 * Returns the namespace URI associated with a given namespace alias.
 *
 * @param     nsAlias namespace alias, or {@code null} for default namespace.
 * @return    namespace URI, or {@code null} if not found.
 */
protected String getNamespaceUri(String nsAlias) {
 if (nsAlias == null) {
  return defaultNamespace;
 }
 // Walk the stack from the top to find an element with this ns alias.
 for (int i = elementStack.size() - 1; i >= 0; --i) {
  Element element = elementStack.get(i);
  for (XmlNamespace ns : element.nsDecls) {
   if (ns.getAlias().equals(nsAlias)) {
    return ns.getUri();
   }
  }
 }
 return null;
}

代码示例来源:origin: com.mulesoft.google/google-api-gdata

/**
 * Returns the namespace URI associated with a given namespace alias.
 *
 * @param     nsAlias namespace alias, or {@code null} for default namespace.
 * @return    namespace URI, or {@code null} if not found.
 */
protected String getNamespaceUri(String nsAlias) {
 if (nsAlias == null) {
  return defaultNamespace;
 }
 // Walk the stack from the top to find an element with this ns alias.
 for (int i = elementStack.size() - 1; i >= 0; --i) {
  Element element = elementStack.get(i);
  for (XmlNamespace ns : element.nsDecls) {
   if (ns.getAlias().equals(nsAlias)) {
    return ns.getUri();
   }
  }
 }
 return null;
}

代码示例来源:origin: com.google.gdata/gdata-java-client

/**
 * Returns the namespace URI associated with a given namespace alias.
 *
 * @param     nsAlias namespace alias, or {@code null} for default namespace.
 * @return    namespace URI, or {@code null} if not found.
 */
protected String getNamespaceUri(String nsAlias) {
 if (nsAlias == null) {
  return defaultNamespace;
 }
 // Walk the stack from the top to find an element with this ns alias.
 for (int i = elementStack.size() - 1; i >= 0; --i) {
  Element element = elementStack.get(i);
  for (XmlNamespace ns : element.nsDecls) {
   if (ns.getAlias().equals(nsAlias)) {
    return ns.getUri();
   }
  }
 }
 return null;
}

代码示例来源:origin: com.google.gdata/gdata-core-1.0

@Override
public String toString() {
 if (getNs() == null || "".equals(getNs().getAlias())) {
  return getLocalName();
 }
 return getNs().getAlias() + ":" + getLocalName();
}

代码示例来源:origin: com.mulesoft.google/google-api-gdata

@Override
public String toString() {
 if (getNs() == null || "".equals(getNs().getAlias())) {
  return getLocalName();
 }
 return getNs().getAlias() + ":" + getLocalName();
}

代码示例来源:origin: com.google.gdata/gdata-java-client

@Override
public String toString() {
 if (getNs() == null || "".equals(getNs().getAlias())) {
  return getLocalName();
 }
 return getNs().getAlias() + ":" + getLocalName();
}

代码示例来源:origin: com.mulesoft.google/google-api-gdata

/**
  * Add a qualified name to the map by URI.  Only the first namespace with a
  * given URI is added to the map.
  */
 private static void addNamespace(Map<String, XmlNamespace> namespaces,
   QName name) {
  if (name == null) {
   return;
  }
  XmlNamespace ns = name.getNs();
  if (ns == null) {
   return;
  }
  String alias = ns.getAlias();
  if (alias == null) {
   return;
  }
  String uri = ns.getUri();
  if (namespaces.containsKey(uri)) {
   return;
  }
  namespaces.put(uri, ns);
 }
}

代码示例来源:origin: com.google.gdata/gdata-core-1.0

/**
  * Add a qualified name to the map by URI.  Only the first namespace with a
  * given URI is added to the map.
  */
 private static void addNamespace(Map<String, XmlNamespace> namespaces,
   QName name) {
  if (name == null) {
   return;
  }
  XmlNamespace ns = name.getNs();
  if (ns == null) {
   return;
  }
  String alias = ns.getAlias();
  if (alias == null) {
   return;
  }
  String uri = ns.getUri();
  if (namespaces.containsKey(uri)) {
   return;
  }
  namespaces.put(uri, ns);
 }
}

代码示例来源:origin: com.google.gdata/gdata-java-client

/**
  * Add a qualified name to the map by URI.  Only the first namespace with a
  * given URI is added to the map.
  */
 private static void addNamespace(Map<String, XmlNamespace> namespaces,
   QName name) {
  if (name == null) {
   return;
  }
  XmlNamespace ns = name.getNs();
  if (ns == null) {
   return;
  }
  String alias = ns.getAlias();
  if (alias == null) {
   return;
  }
  String uri = ns.getUri();
  if (namespaces.containsKey(uri)) {
   return;
  }
  namespaces.put(uri, ns);
 }
}

代码示例来源:origin: com.mulesoft.google/google-api-gdata

namespaces.add(new XmlNamespace(blobNs.getAlias(),
                blobNs.getUri()));

代码示例来源:origin: com.google.gdata/gdata-core-1.0

namespaces.add(new XmlNamespace(blobNs.getAlias(),
                blobNs.getUri()));

代码示例来源:origin: com.google.gdata/gdata-java-client

namespaces.add(new XmlNamespace(blobNs.getAlias(),
                blobNs.getUri()));

代码示例来源:origin: com.google.gdata/gdata-core-1.0

nsAttrs.add(new Attribute("alias", namespace.getAlias()));
nsAttrs.add(new Attribute("uri", namespace.getUri()));
w.simpleElement(Namespaces.gdataConfigNs, "namespaceDescription",

代码示例来源:origin: com.google.gdata/gdata-java-client

/**
 * Get a list of attributes for the given element.
 */
protected List<XmlWriter.Attribute> getAttributes(Element e,
  ElementMetadata<?, ?> metadata) {
 List<XmlWriter.Attribute> attrs = null;
 Iterator<Attribute> attributeIterator = e.getAttributeIterator(metadata);
 if (attributeIterator.hasNext()) {
  ElementKey<?, ?> key = e.getElementKey();
  attrs = new ArrayList<XmlWriter.Attribute>();
  while (attributeIterator.hasNext()) {
   Attribute attribute = attributeIterator.next();
   AttributeKey<?> attKey = attribute.getAttributeKey();
   AttributeMetadata<?> attMeta = (metadata == null) ? null
     : metadata.bindAttribute(attKey);
   QName qName = attMeta != null ? attMeta.getName() : attKey.getId();
   String alias = (qName.getNs() != null) ?
     qName.getNs().getAlias() : null;
   attrs.add(new XmlWriter.Attribute(alias, qName.getLocalName(),
     attribute.getValue().toString()));
  }
 }
 return attrs;
}

代码示例来源:origin: com.google.gdata/gdata-core-1.0

/**
 * Get a list of attributes for the given element.
 */
protected List<XmlWriter.Attribute> getAttributes(Element e,
  ElementMetadata<?, ?> metadata) {
 List<XmlWriter.Attribute> attrs = null;
 Iterator<Attribute> attributeIterator = e.getAttributeIterator(metadata);
 if (attributeIterator.hasNext()) {
  ElementKey<?, ?> key = e.getElementKey();
  attrs = new ArrayList<XmlWriter.Attribute>();
  while (attributeIterator.hasNext()) {
   Attribute attribute = attributeIterator.next();
   AttributeKey<?> attKey = attribute.getAttributeKey();
   AttributeMetadata<?> attMeta = (metadata == null) ? null
     : metadata.bindAttribute(attKey);
   QName qName = attMeta != null ? attMeta.getName() : attKey.getId();
   String alias = (qName.getNs() != null) ?
     qName.getNs().getAlias() : null;
   attrs.add(new XmlWriter.Attribute(alias, qName.getLocalName(),
     attribute.getValue().toString()));
  }
 }
 return attrs;
}

代码示例来源:origin: com.mulesoft.google/google-api-gdata

/**
 * Get a list of attributes for the given element.
 */
protected List<XmlWriter.Attribute> getAttributes(Element e,
  ElementMetadata<?, ?> metadata) {
 List<XmlWriter.Attribute> attrs = null;
 Iterator<Attribute> attributeIterator = e.getAttributeIterator(metadata);
 if (attributeIterator.hasNext()) {
  ElementKey<?, ?> key = e.getElementKey();
  attrs = new ArrayList<XmlWriter.Attribute>();
  while (attributeIterator.hasNext()) {
   Attribute attribute = attributeIterator.next();
   AttributeKey<?> attKey = attribute.getAttributeKey();
   AttributeMetadata<?> attMeta = (metadata == null) ? null
     : metadata.bindAttribute(attKey);
   QName qName = attMeta != null ? attMeta.getName() : attKey.getId();
   String alias = (qName.getNs() != null) ?
     qName.getNs().getAlias() : null;
   attrs.add(new XmlWriter.Attribute(alias, qName.getLocalName(),
     attribute.getValue().toString()));
  }
 }
 return attrs;
}

代码示例来源:origin: com.google.gdata/gdata-core-1.0

if (declaredNs.getAlias().equals(nsValue) ||
  declaredNs.getUri().equals(nsValue)) {
 namespace = declaredNs;

代码示例来源:origin: com.mulesoft.google/google-api-gdata

XmlNamespace newNs = new XmlNamespace(ns.getAlias(), ns.getUri());
if (!namespaces.contains(newNs)) {
 namespaces.add(newNs);

代码示例来源:origin: com.google.gdata/gdata-java-client

XmlNamespace newNs = new XmlNamespace(ns.getAlias(), ns.getUri());
if (!namespaces.contains(newNs)) {
 namespaces.add(newNs);

代码示例来源:origin: com.google.gdata/gdata-core-1.0

XmlNamespace newNs = new XmlNamespace(ns.getAlias(), ns.getUri());
if (!namespaces.contains(newNs)) {
 namespaces.add(newNs);

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com