org.apache.axiom.om.OMAttribute.setAttributeType()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(71)

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

OMAttribute.setAttributeType介绍

暂无

代码示例

代码示例来源:origin: org.apache.ws.commons.axiom/axiom-impl

attr.setAttributeType(atts.getType(i));

代码示例来源:origin: org.apache.ws.commons.axiom/om-aspects

attr.setAttributeType(atts.getType(i));

代码示例来源:origin: org.apache.ws.commons.axiom/axiom-api

/**
 * Method processAttributes.
 *
 * @param node
 */
protected void processAttributes(OMElement node) {
  int attribCount = parser.getAttributeCount();
  for (int i = 0; i < attribCount; i++) {
    String uri = parser.getAttributeNamespace(i);
    String prefix = parser.getAttributePrefix(i);
    OMNamespace namespace = null;
    if (uri != null && uri.length() > 0) {
      // prefix being null means this elements has a default namespace or it has inherited
      // a default namespace from its parent
      namespace = node.findNamespace(uri, prefix);
      if (namespace == null) {
        namespace = node.declareNamespace(uri, prefix);
      }
    }
    // todo if the attributes are supposed to namespace qualified all the time
    // todo then this should throw an exception here
    OMAttribute attr = node.addAttribute(parser.getAttributeLocalName(i),
             parser.getAttributeValue(i), namespace);
    attr.setAttributeType(parser.getAttributeType(i));
    if (attr instanceof OMAttributeEx) {
      ((OMAttributeEx)attr).setSpecified(parser.isAttributeSpecified(i));
    }
  }
}

相关文章