|
JDOM 0.0.5-BETA |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jdom2.util.TextHelper
public class TextHelper
This class contains static helper methods for accessing Text content of JDOM Elements.
Method Summary | |
---|---|
static java.lang.String |
getChildText(Element parent,
java.lang.String name)
This convenience method returns the textual content of the first child element with the given name and in no Namespace, or returns an empty String ("") if the child has no textual content. |
static java.lang.String |
getChildText(Element parent,
java.lang.String name,
Namespace ns)
This convenience method returns the textual content of the first named child element, or returns an empty String ("") if the child
has no textual content. |
static java.lang.String |
getChildTextNormalize(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(Element parent,
java.lang.String name,
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(Element parent,
java.lang.String name)
This convenience method returns the trimmed textual content of the first named child element, or returns null if there's no such child. |
static java.lang.String |
getChildTextTrim(Element parent,
java.lang.String name,
Namespace ns)
This convenience method returns the trimmed textual content of the named child element, or returns null if there's no such child. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String getChildText(Element parent, java.lang.String name)
This convenience method returns the textual content of the first child
element with the given name and in no Namespace, 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
Element.getChild(String)
public static java.lang.String getChildText(Element parent, java.lang.String name, Namespace ns)
This convenience method returns the textual content of the first 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
Element.getChild(String, Namespace)
public static java.lang.String getChildTextTrim(Element parent, java.lang.String name)
This convenience method returns the trimmed textual content of the first
named child element, or returns null if there's no such child. See
Format.trimBoth(String)
for details of text trimming.
parent
- the parent elementname
- the name of the child
Element.getChild(String)
public static java.lang.String getChildTextTrim(Element parent, java.lang.String name, 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
Element.getChild(String, Namespace)
public static java.lang.String getChildTextNormalize(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
Format.compact(String)
for details of text normalization.
parent
- the parent elementname
- the name of the child
Element.getChild(String)
public static java.lang.String getChildTextNormalize(Element parent, java.lang.String name, 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
Format.compact(String)
for details of text normalization.
parent
- the parent elementname
- the name of the childns
- the namespace of the child
Element.getChild(String, Namespace)
|
JDOM 0.0.5-BETA |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |