Java 8 Text - 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 Text class.

This code example shows how to use the following methods:getValue
        } 
    } 
 
    private void handleText(Text text) throws SAXException {
        if (getContentHandler() != null) { 
            char[] ch = text.getValue() != null ? text.getValue().toCharArray() : new char[0];
            getContentHandler().characters(ch, 0, ch.length);
        } 
    } 
 
    private Attributes getAttributes(SOAPElement element) {
        AttributesImpl attributes = new AttributesImpl();
 
        for (Iterator<?> iterator = element.getAllAttributes(); iterator.hasNext();) {
            Name attributeName = (Name) iterator.next();
            String namespace = attributeName.getURI();
            if (namespace == null || !namespacesFeature) {
                namespace = "";
            } 
            String attributeValue = element.getAttributeValue(attributeName);
4
CodeRank
This code example shows how to use the following methods:getData
This code example shows how to use the following methods:getData
        iter = soapElement.getChildElements();
        assertTrue(iter.hasNext()); 
        obj = iter.next();
        assertTrue(obj instanceof Text);  
        Text text = (Text)obj;
        assertEquals("DEF", text.getData());
        assertFalse(iter.hasNext());               
    } 
     
    @Validated @Test
    public void testRemoveChild() throws Exception {
        MessageFactory fact = MessageFactory.newInstance();
        SOAPMessage message = fact.createMessage();
        SOAPBody soapBody = message.getSOAPBody();
 
        assertFalse(soapBody.getChildElements().hasNext());
         
        QName qname1 = new QName("http://wombat.ztrade.com",
                                 "GetLastTradePrice", "ztrade"); 
        SOAPElement child = soapBody.addChildElement(qname1);
3
CodeRank
This code example shows how to use the following methods:getData
This code example shows how to use the following methods:isComment
        iter = soapElement.getChildElements();
        assertTrue(iter.hasNext()); 
        obj = iter.next();
        assertTrue(obj instanceof Text);  
        Text text = (Text)obj;
        assertTrue(text.isComment());
        assertEquals("this is a test with a comment node", text.getData().trim());
        assertFalse(iter.hasNext());        
    } 
} 
3
CodeRank
See Code Examples for Java 8 Text Methods: