本文整理了Java中org.apache.axiom.om.OMAttribute.setAttributeType()
方法的一些代码示例,展示了OMAttribute.setAttributeType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OMAttribute.setAttributeType()
方法的具体详情如下:
包路径:org.apache.axiom.om.OMAttribute
类名称: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));
}
}
}
内容来源于网络,如有侵权,请联系作者删除!