Example usage for org.jdom2 Text getTextNormalize

List of usage examples for org.jdom2 Text getTextNormalize

Introduction

In this page you can find the example usage for org.jdom2 Text getTextNormalize.

Prototype

public String getTextNormalize() 

Source Link

Document

This returns the textual content with all surrounding whitespace removed and internal whitespace normalized to a single space.

Usage

From source file:xml.JDOMConverter.java

License:Apache License

/**.
 * Handles the case where the object in filter is a text
 * @param a the filtered text/* w  ww .  j a v a 2s .co m*/
 * @throws JSONException
 */
private void handleText(final Text t) throws JSONException {
    String str = t.getTextNormalize();
    if (!str.isEmpty()) {
        String parent = t.getParent().getName();
        tree.get(current - 1).put(parent, str);
        skipp = true;
    }
}