本文整理匯總了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;
}