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: setData, getNodeValue
        // Merge with any previous text node if possible. 
        if (coalescing) {
            Node lastChild = parent.getLastChild();
            if (lastChild != null && lastChild.getNodeType() == Node.TEXT_NODE) {
                Text textNode = (Text) lastChild;
                textNode.setData(textNode.getNodeValue() + text);
                return; 
            } 
        } 
        // Okay, we really do need a new text node 
        parent.appendChild(token == XmlPullParser.CDSECT
                ? new CDATASectionImpl(document, text)
                : new TextImpl(document, text));
    } 
 
    @Override 
    public void setEntityResolver(EntityResolver resolver) {
        entityResolver = resolver;
    } 
 
Full Snippet Info
6
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: cloneNode
6
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: getParentNode, getTextContent
  } 
 
  public void visitText(Text t) {
    String escaped;
    if (escapeHtmlEntities) {
      escaped = UiBinderWriter.escapeText(t.getTextContent(),
        preserveWhiteSpace(t));
    } else { 
      escaped = t.getTextContent();
      if (!preserveWhiteSpace(t)) {
        escaped = escaped.replaceAll("\\s+", " ");
      } 
      escaped = UiBinderWriter.escapeTextForJavaStringLiteral(escaped);
    } 
 
    buffer.append(escaped);
  } 
 
  private boolean preserveWhiteSpace(Text t) {
    Element parent = Node.ELEMENT_NODE == t.getParentNode().getNodeType()

5
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: splitText
	public String getClassName() {
		return "Text"; 
	} 
 
	public Scriptable jsFunction_splitText(int offset) throws DOMException {
		return exportNode(textNode.splitText(offset));
	} 
 
} 
Full Snippet Info
5
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: getWholeText
				Element domElement = (Element) domNode;
				return prefix + domElement.getNodeName();
			} 
			if (domNode instanceof Text) {
				Text domText = (Text) domNode;
				return prefix + domText.getWholeText();
			} else { 
				OcamlPlugin.logWarning("DOM element type not handled: " 
						+ element.getClass().getSimpleName());
			} 
			// else if (domNode instanceof Element) { 
			// Element domElement = (Element) domNode; 
			// return prefix + domElement.getNodeName(); 
			// } 
		} 
 
		return super.getText(element);
	} 
} 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Java 8 Text Questions & Answers:

See Code Examples for Java 8 Text Methods: