|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdom.contrib.helpers.TextHelper
public class TextHelper
This class contains static helper methods.
Constructor Summary | |
---|---|
TextHelper()
|
Method Summary | |
---|---|
static java.lang.String |
getChildText(org.jdom.Element parent,
java.lang.String name)
This convenience method returns the textual content of the named child element, or returns an empty String ("")
if the child has no textual content. |
static java.lang.String |
getChildText(org.jdom.Element parent,
java.lang.String name,
org.jdom.Namespace ns)
This convenience method returns the textual content of the named child element, or returns an empty String ("")
if the child has no textual content. |
static java.lang.String |
getChildTextNormalize(org.jdom.Element parent,
java.lang.String name)
This convenience method returns the normalized textual content of the named child element, or returns null if there's no such child. |
static java.lang.String |
getChildTextNormalize(org.jdom.Element parent,
java.lang.String name,
org.jdom.Namespace ns)
This convenience method returns the normalized textual content of the named child element, or returns null if there's no such child. |
static java.lang.String |
getChildTextTrim(org.jdom.Element parent,
java.lang.String name)
This convenience method returns the trimmed textual content of the named child element, or returns null if there's no such child. |
static java.lang.String |
getChildTextTrim(org.jdom.Element parent,
java.lang.String name,
org.jdom.Namespace ns)
This convenience method returns the trimmed textual content of the named child element, or returns null if there's no such child. |
static java.lang.String |
normalize(java.lang.String text)
This returns the text with surrounding whitespace removed and internal whitespace normalized to a single space. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextHelper()
Method Detail |
---|
public static java.lang.String normalize(java.lang.String text)
This returns the text with surrounding whitespace removed and internal whitespace normalized to a single space.
public static java.lang.String getChildText(org.jdom.Element parent, java.lang.String name)
This convenience method returns the textual content of the named
child element, or returns an empty String
("")
if the child has no textual content. However, if the child does
not exist, null
is returned.
parent
- the parent elementname
- the name of the child
public static java.lang.String getChildText(org.jdom.Element parent, java.lang.String name, org.jdom.Namespace ns)
This convenience method returns the textual content of the named
child element, or returns an empty String
("")
if the child has no textual content. However, if the child does
not exist, null
is returned.
parent
- the parent elementname
- the name of the childns
- the namespace of the child
public static java.lang.String getChildTextTrim(org.jdom.Element parent, java.lang.String name)
This convenience method returns the trimmed textual content of the
named child element, or returns null if there's no such child.
See String.trim()
for details of text trimming.
parent
- the parent elementname
- the name of the child
public static java.lang.String getChildTextTrim(org.jdom.Element parent, java.lang.String name, org.jdom.Namespace ns)
This convenience method returns the trimmed textual content of the
named child element, or returns null if there's no such child.
See String.trim()
for
details of text trimming.
parent
- the parent elementname
- the name of the childns
- the namespace of the child
public static java.lang.String getChildTextNormalize(org.jdom.Element parent, java.lang.String name)
This convenience method returns the normalized textual content of the
named child element, or returns null if there's no such child.
See
for details of text normalization.
normalize(java.lang.String)
parent
- the parent elementname
- the name of the child
public static java.lang.String getChildTextNormalize(org.jdom.Element parent, java.lang.String name, org.jdom.Namespace ns)
This convenience method returns the normalized textual content of the
named child element, or returns null if there's no such child.
See
for
details of text normalization.
normalize(java.lang.String)
parent
- the parent elementname
- the name of the childns
- the namespace of the child
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |