Java Code Examples for javax.xml.namespace.QName#valueOf()
The following examples show how to use
javax.xml.namespace.QName#valueOf() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: openjdk-jdk9 File: DOMStreamReader.java License: GNU General Public License v2.0 | 6 votes |
/** * 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"); }
Example 2
Source Project: lams File: CoreXMLDeserializers.java License: GNU General Public License v2.0 | 6 votes |
@Override protected Object _deserialize(String value, DeserializationContext ctxt) throws IOException { switch (_kind) { case TYPE_DURATION: return _dataTypeFactory.newDuration(value); case TYPE_QNAME: return QName.valueOf(value); case TYPE_G_CALENDAR: Date d; try { d = _parseDate(value, ctxt); } catch (JsonMappingException e) { // try to parse from native XML Schema 1.0 lexical representation String, // which includes time-only formats not handled by parseXMLGregorianCalendarFromJacksonFormat(...) return _dataTypeFactory.newXMLGregorianCalendar(value); } return _gregorianFromDate(ctxt, d); } throw new IllegalStateException(); }
Example 3
Source Project: openjdk-jdk9 File: DOMStreamReader.java License: GNU General Public License v2.0 | 6 votes |
/** * 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"); }
Example 4
Source Project: hottub File: DOMStreamReader.java License: GNU General Public License v2.0 | 6 votes |
/** * 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"); }
Example 5
Source Project: openjdk-jdk9 File: DeploymentDescriptorParser.java License: GNU General Public License v2.0 | 5 votes |
protected QName getQNameAttribute(Attributes attrs, String name) { String value = getAttribute(attrs, name); if (value == null || value.equals("")) { return null; } else { return QName.valueOf(value); } }
Example 6
Source Project: openjdk-8-source File: DOMStreamReader.java License: GNU General Public License v2.0 | 5 votes |
/** * 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"); }
Example 7
Source Project: TencentKona-8 File: DOMStreamReader.java License: GNU General Public License v2.0 | 5 votes |
/** * 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"); }
Example 8
Source Project: openjdk-jdk8u File: JwsImplGenerator.java License: GNU General Public License v2.0 | 5 votes |
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); }
Example 9
Source Project: jdk8u60 File: DeploymentDescriptorParser.java License: GNU General Public License v2.0 | 5 votes |
protected QName getQNameAttribute(Attributes attrs, String name) { String value = getAttribute(attrs, name); if (value == null || value.equals("")) { return null; } else { return QName.valueOf(value); } }
Example 10
Source Project: openjdk-jdk9 File: DOMStreamReader.java License: GNU General Public License v2.0 | 5 votes |
/** * 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"); }
Example 11
Source Project: openjdk-8-source File: JwsImplGenerator.java License: GNU General Public License v2.0 | 5 votes |
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); }
Example 12
Source Project: openjdk-jdk9 File: DOMStreamReader.java License: GNU General Public License v2.0 | 5 votes |
/** * 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"); }
Example 13
Source Project: openjdk-jdk8u-backup File: JwsImplGenerator.java License: GNU General Public License v2.0 | 5 votes |
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); }
Example 14
Source Project: jackson-modules-base File: TestJaxbAnnotationIntrospector.java License: Apache License 2.0 | 4 votes |
@Override public QName unmarshal(String v) throws Exception { return QName.valueOf(v); }
Example 15
Source Project: tessera File: MapAdapterTest.java License: Apache License 2.0 | 4 votes |
@Test public void unmarshal() throws Exception { ConfigProperties properties = new ConfigProperties(); JAXBElement<String> someElement = new JAXBElement<>(QName.valueOf("message"), String.class, "I love sparrows!!"); JAXBElement<String> someOtherElement = new JAXBElement<>(QName.valueOf("greeting"), String.class, "Hellow"); properties.setProperties(Arrays.asList(someElement, someOtherElement)); Map<String, String> result = adapter.unmarshal(properties); Map<String, String> map = new LinkedHashMap<>(); map.put("message", "I love sparrows!!"); map.put("greeting", "Hellow"); assertThat(result).containsAllEntriesOf(map); }
Example 16
Source Project: steady File: AbstractSTSClient.java License: Apache License 2.0 | 4 votes |
public void setEndpointName(String qn) { endpointName = QName.valueOf(qn); }
Example 17
Source Project: steady File: AbstractSTSClient.java License: Apache License 2.0 | 4 votes |
public void setServiceName(String qn) { serviceName = QName.valueOf(qn); }
Example 18
Source Project: steady File: AbstractSTSClient.java License: Apache License 2.0 | 4 votes |
public void setEndpointName(String qn) { endpointName = QName.valueOf(qn); }
Example 19
Source Project: openjdk-jdk8u File: WsgenOptions.java License: GNU General Public License v2.0 | 4 votes |
@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; }
Example 20
Source Project: steady File: AbstractSTSClient.java License: Apache License 2.0 | 4 votes |
public void setEndpointName(String qn) { endpointName = QName.valueOf(qn); }