本文整理汇总了Java中javax.xml.namespace.QName.valueOf方法的典型用法代码示例。如果您正苦于以下问题:Java QName.valueOf方法的具体用法?Java QName.valueOf怎么用?Java QName.valueOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.xml.namespace.QName
的用法示例。
在下文中一共展示了QName.valueOf方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAttributeName
import javax.xml.namespace.QName; //导入方法依赖的package包/类
/**
* Return an attribute's qname. Handle the case of DOM level 1 nodes.
*/
public QName getAttributeName(int index) {
if (_state == START_ELEMENT) {
Node attr = _currentAttributes.get(index);
String localName = attr.getLocalName();
if (localName != null) {
String prefix = attr.getPrefix();
String uri = attr.getNamespaceURI();
return new QName(fixNull(uri), localName, fixNull(prefix));
}
else {
return QName.valueOf(attr.getNodeName());
}
}
throw new IllegalStateException("DOMStreamReader: getAttributeName() called in illegal state");
}
示例2: getQNameAttribute
import javax.xml.namespace.QName; //导入方法依赖的package包/类
protected QName getQNameAttribute(Attributes attrs, String name) {
String value = getAttribute(attrs, name);
if (value == null || value.equals("")) {
return null;
} else {
return QName.valueOf(value);
}
}
示例3: getName
import javax.xml.namespace.QName; //导入方法依赖的package包/类
/**
* Return an element's qname. Handle the case of DOM level 1 nodes.
*/
public javax.xml.namespace.QName getName() {
if (_state == START_ELEMENT || _state == END_ELEMENT) {
String localName = _current.getLocalName();
if (localName != null) {
String prefix = _current.getPrefix();
String uri = _current.getNamespaceURI();
return new QName(fixNull(uri), localName, fixNull(prefix));
}
else {
return QName.valueOf(_current.getNodeName());
}
}
throw new IllegalStateException("DOMStreamReader: getName() called in illegal state");
}
示例4: equalsNSOptional
import javax.xml.namespace.QName; //导入方法依赖的package包/类
private static boolean equalsNSOptional(String strQName, QName checkQN) {
if (strQName == null)
return false;
strQName = strQName.trim();
QName reqQN = QName.valueOf(strQName);
if (reqQN.getNamespaceURI() == null || reqQN.getNamespaceURI().equals(""))
return reqQN.getLocalPart().equals(checkQN.getLocalPart());
return reqQN.equals(checkQN);
}
示例5: wrap
import javax.xml.namespace.QName; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private <T> JAXBElement<T> wrap(String name, T object) {
return new JAXBElement<T>(QName.valueOf(name), (Class<T>) object.getClass(), object);
}
示例6: parseArguments
import javax.xml.namespace.QName; //导入方法依赖的package包/类
@Override
protected int parseArguments(String[] args, int i) throws BadCommandLineException {
int j = super.parseArguments(args, i);
if (args[i].equals(SERVICENAME_OPTION)) {
serviceName = QName.valueOf(requireArgument(SERVICENAME_OPTION, args, ++i));
if (serviceName.getNamespaceURI() == null || serviceName.getNamespaceURI().length() == 0) {
throw new BadCommandLineException(WscompileMessages.WSGEN_SERVICENAME_MISSING_NAMESPACE(args[i]));
}
if (serviceName.getLocalPart() == null || serviceName.getLocalPart().length() == 0) {
throw new BadCommandLineException(WscompileMessages.WSGEN_SERVICENAME_MISSING_LOCALNAME(args[i]));
}
return 2;
} else if (args[i].equals(PORTNAME_OPTION)) {
portName = QName.valueOf(requireArgument(PORTNAME_OPTION, args, ++i));
if (portName.getNamespaceURI() == null || portName.getNamespaceURI().length() == 0) {
throw new BadCommandLineException(WscompileMessages.WSGEN_PORTNAME_MISSING_NAMESPACE(args[i]));
}
if (portName.getLocalPart() == null || portName.getLocalPart().length() == 0) {
throw new BadCommandLineException(WscompileMessages.WSGEN_PORTNAME_MISSING_LOCALNAME(args[i]));
}
return 2;
} else if (args[i].equals("-r")) {
nonclassDestDir = new File(requireArgument("-r", args, ++i));
if (!nonclassDestDir.exists()) {
throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(nonclassDestDir.getPath()));
}
return 2;
} else if (args[i].startsWith("-wsdl")) {
genWsdl = true;
//String value = requireArgument("-wsdl", args, ++i).substring(5);
String value = args[i].substring(5);
int index = value.indexOf(':');
if (index == 0) {
value = value.substring(1);
index = value.indexOf('/');
if (index == -1) {
protocol = value;
} else {
protocol = value.substring(0, index);
}
protocolSet = true;
}
return 1;
} else if (args[i].equals("-XwsgenReport")) {
// undocumented switch for the test harness
wsgenReport = new File(requireArgument("-XwsgenReport", args, ++i));
return 2;
} else if (args[i].equals("-Xdonotoverwrite")) {
doNotOverWrite = true;
return 1;
} else if (args[i].equals("-inlineSchemas")) {
inlineSchemas = true;
return 1;
} else if ("-x".equals(args[i])) {
externalMetadataFiles.add(requireArgument("-x", args, ++i));
return 1;
}
return j;
}