Java 8 QName - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 QName class.

This code example shows how to use the following methods:
                "</server>"; 
        final XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(xml));
        final StandaloneXml parser = new StandaloneXml(null, null, null);
        final List<ModelNode> operationList = new ArrayList<ModelNode>();
        final XMLMapper mapper = XMLMapper.Factory.create();
        mapper.registerRootElement(new QName(namespace, "server"), parser);
        mapper.parseDocument(operationList, reader);
        final ModelNode content = operationList.get(1).get("content");
        assertArrayEquals(new byte[] { 0x12, 0x34 }, content.get(0).get("hash").asBytes());
    } 
 
    @Test 
    public void testFSArchive() throws Exception { 
        final String xml = "<?xml version='1.0' encoding='UTF-8'?>" +
                "<server name=\"example\" xmlns=\"urn:jboss:domain:1.0\">" + 
                "    <deployments>" + 
                "        <deployment name=\"test.war\" runtime-name=\"test-run.war\">" + 
                "            <fs-archive path=\"${jboss.home}/content/welcome.jar\"/>" + 
                "        </deployment>" + 
                "    </deployments>" + 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getLocalPart, getPrefix
 
    public void update(String uri, String localName, String qName) {
        QName qn = null;
        if (uri.equals("http://schemas.openxmlformats.org/spreadsheetml/2006/main")) {
        	// Avoid using the default namespace 
        	qn = new QName(uri,localName, "s");
        	qName = qn.getPrefix() + ":" + qn.getLocalPart();
        	if (!qn.getPrefix().equals("s")) { // only a problem with MOXy
            	log.debug("ignoring requested prefix!");        		 
        	} 
        } else { 
//        	log.debug("'" + uri +"'"); 
        	qn = new QName(uri,localName);
        } 
        Integer v = occurrence.get(qn);
        if(v==null) {
        	v=1;
        } else { 
        	v++;
        } 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getNamespaceURI
        String xpath;
 
        xpath = "/";
        assertEquals(1, XPathUtil.steps(descriptor, xpath, namespaces).size());
        XPathUtil.Step step = (XPathUtil.Step) XPathUtil.steps(descriptor, xpath, namespaces).get(0);
        QName rootQName = new QName(name.getNamespaceURI(), name.getLocalPart());
        assertEquals(rootQName, step.getName());
 
        expected = Collections.singletonList(new XPathUtil.Step(rootQName, 1));
        xpath = "wq_plus";
        assertEquals(expected, XPathUtil.steps(descriptor, xpath, namespaces));
 
        expected = Collections.singletonList(new XPathUtil.Step(rootQName, 1));
        xpath = "/wq_plus";
        assertEquals(expected, XPathUtil.steps(descriptor, xpath, namespaces));
 
        expected = Collections.singletonList(new XPathUtil.Step(rootQName, 1));
        xpath = "wq_plus/measurement/result/../../measurement/determinand_description/../..";
        assertEquals(expected, XPathUtil.steps(descriptor, xpath, namespaces));
 

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getLocalPart
		return this.name;
	} 
 
	@Override 
	public String getName() {
		return this.name.getLocalPart();
	} 
 
	@Override 
	public Serializable getValue() {
		return this.value;
	} 
 
} 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
        return war;
    } 
 
    @Test 
    public void testEJB3Endpoint() throws Exception { 
        final QName serviceName = new QName("org.jboss.as.test.integration.ws.context.as1605", "EJB3EndpointService");
        final URL wsdlURL = new URL(baseUrl, "/as1605-customized/EJB3Endpoint?wsdl");
        final Service service = Service.create(wsdlURL, serviceName);
        final EndpointIface port = service.getPort(EndpointIface.class);
        final String result = port.echo("hello");
        Assert.assertEquals("EJB3 hello", result);
    } 
 
} 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Java 8 QName Questions & Answers:

See Code Examples for Java 8 QName Methods: