cdqa.dom

Class TextUtils


(package private) final class TextUtils
extends java.lang.Object

TextUtils class
Author:
simonkm

Method Summary

static void
appendIgnoreWhiteSpace(String string, StringBuffer stringBuffer)
appends a string to a stringBuffer, ignoring XML whitespaces
static StringStack
childStringStack(Node node)
static String
childText(Node node)
returns the child text of this node
static StringStack
descStringStack(Node node)
static String
descText(Node node)
returns the descendant text of this node
static String
stackToStringIgnoreWhiteSpace(StringStack stringStack)
converts a stringStack into a string
static String
textNodeValue(Node n)
If n is not a Text Node, returns null.

Method Details

appendIgnoreWhiteSpace

public static void appendIgnoreWhiteSpace(String string,
                                          StringBuffer stringBuffer)
appends a string to a stringBuffer, ignoring XML whitespaces

childStringStack

public static StringStack childStringStack(Node node)
Parameters:
node -
Returns:

childText

public static String childText(Node node)
returns the child text of this node

descStringStack

public static StringStack descStringStack(Node node)
Parameters:
node -
Returns:

descText

public static String descText(Node node)
returns the descendant text of this node

stackToStringIgnoreWhiteSpace

public static String stackToStringIgnoreWhiteSpace(StringStack stringStack)
converts a stringStack into a string

textNodeValue

public static String textNodeValue(Node n)
If n is not a Text Node, returns null. If n is a Text Node that contains only whitespaces, returns null. Otherwise, returns n.getNodeValue().