本文整理汇总了Java中com.sun.xml.internal.messaging.saaj.soap.name.NameImpl.createFromQualifiedName方法的典型用法代码示例。如果您正苦于以下问题:Java NameImpl.createFromQualifiedName方法的具体用法?Java NameImpl.createFromQualifiedName怎么用?Java NameImpl.createFromQualifiedName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.xml.internal.messaging.saaj.soap.name.NameImpl
的用法示例。
在下文中一共展示了NameImpl.createFromQualifiedName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFaultCodeAsName
import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; //导入方法依赖的package包/类
public Name getFaultCodeAsName() {
String faultcodeString = getFaultCode();
if (faultcodeString == null) {
return null;
}
int prefixIndex = faultcodeString.indexOf(':');
if (prefixIndex == -1) {
// Not a valid SOAP message, but we return the unqualified name
// anyway since some apps do not strictly conform to SOAP
// specs. A message that does not contain a <faultcode>
// element itself is also not valid in which case we return
// null instead of throwing an exception so this is consistent.
return NameImpl.createFromUnqualifiedName(faultcodeString);
}
// Get the prefix and map it to a namespace name (AKA namespace URI)
String prefix = faultcodeString.substring(0, prefixIndex);
if (this.faultCodeElement == null)
findFaultCodeElement();
String nsName = this.faultCodeElement.getNamespaceURI(prefix);
return NameImpl.createFromQualifiedName(faultcodeString, nsName);
}
示例2: getFaultCodeAsName
import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; //导入方法依赖的package包/类
@Override
public Name getFaultCodeAsName() {
String faultcodeString = getFaultCode();
if (faultcodeString == null) {
return null;
}
int prefixIndex = faultcodeString.indexOf(':');
if (prefixIndex == -1) {
// Not a valid SOAP message, but we return the unqualified name
// anyway since some apps do not strictly conform to SOAP
// specs. A message that does not contain a <faultcode>
// element itself is also not valid in which case we return
// null instead of throwing an exception so this is consistent.
return NameImpl.createFromUnqualifiedName(faultcodeString);
}
// Get the prefix and map it to a namespace name (AKA namespace URI)
String prefix = faultcodeString.substring(0, prefixIndex);
if (this.faultCodeElement == null)
findFaultCodeElement();
String nsName = this.faultCodeElement.getNamespaceURI(prefix);
return NameImpl.createFromQualifiedName(faultcodeString, nsName);
}
示例3: getAllAttributesFrom
import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; //导入方法依赖的package包/类
protected static Iterator getAllAttributesFrom(final Element element) {
final NamedNodeMap attributes = element.getAttributes();
return new Iterator() {
int attributesLength = attributes.getLength();
int attributeIndex = 0;
String currentName;
public boolean hasNext() {
return attributeIndex < attributesLength;
}
public Object next() {
if (!hasNext()) {
throw new NoSuchElementException();
}
Node current = attributes.item(attributeIndex++);
currentName = current.getNodeName();
String prefix = NameImpl.getPrefixFromTagName(currentName);
if (prefix.length() == 0) {
return NameImpl.createFromUnqualifiedName(currentName);
} else {
Name attributeName =
NameImpl.createFromQualifiedName(
currentName,
current.getNamespaceURI());
return attributeName;
}
}
public void remove() {
if (currentName == null) {
throw new IllegalStateException();
}
attributes.removeNamedItem(currentName);
}
};
}
示例4: addChildElement
import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; //导入方法依赖的package包/类
@Override
public SOAPElement addChildElement(String localName) throws SOAPException {
String nsUri = getNamespaceURI("");
Name name = (nsUri == null || nsUri.isEmpty())
? NameImpl.createFromUnqualifiedName(localName)
: NameImpl.createFromQualifiedName(localName, nsUri);
return addChildElement(name);
}
示例5: getAllAttributesFrom
import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; //导入方法依赖的package包/类
protected static Iterator<Name> getAllAttributesFrom(final Element element) {
final NamedNodeMap attributes = element.getAttributes();
return new Iterator<Name>() {
int attributesLength = attributes.getLength();
int attributeIndex = 0;
String currentName;
@Override
public boolean hasNext() {
return attributeIndex < attributesLength;
}
@Override
public Name next() {
if (!hasNext()) {
throw new NoSuchElementException();
}
Node current = attributes.item(attributeIndex++);
currentName = current.getNodeName();
String prefix = NameImpl.getPrefixFromTagName(currentName);
if (prefix.length() == 0) {
return NameImpl.createFromUnqualifiedName(currentName);
} else {
Name attributeName =
NameImpl.createFromQualifiedName(
currentName,
current.getNamespaceURI());
return attributeName;
}
}
@Override
public void remove() {
if (currentName == null) {
throw new IllegalStateException();
}
attributes.removeNamedItem(currentName);
}
};
}