Package org.exolab.adaptx.xml
Class XMLUtil
- java.lang.Object
-
- org.exolab.adaptx.xml.XMLUtil
-
public class XMLUtil extends java.lang.Object
A utility class for parsing XML Namespaces and Locales- Author:
- Keith Visco
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
EMPTY_STRING
static char
LOCAL_SEP
static char
NAME_SPACE_SEP
static java.lang.String
XMLNS
-
Constructor Summary
Constructors Constructor Description XMLUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Locale
getLocale(java.lang.String xmlLang)
Creates a new Locale base on the value of the lang attributestatic java.lang.String
getLocalPart(java.lang.String qName)
Returns the local part of the qualified XML namestatic java.lang.String
getNameSpacePrefix(java.lang.String qName)
Returns the namespace part of the qualified XML namestatic boolean
isWhitespace(char[] chars, int start, int length)
Returns true if the given String contains only whitespace charactersstatic boolean
isWhitespace(java.lang.String text)
Returns true if the given String contains only whitespace characters
-
-
-
Field Detail
-
XMLNS
public static final java.lang.String XMLNS
- See Also:
- Constant Field Values
-
LOCAL_SEP
public static final char LOCAL_SEP
- See Also:
- Constant Field Values
-
NAME_SPACE_SEP
public static final char NAME_SPACE_SEP
- See Also:
- Constant Field Values
-
EMPTY_STRING
public static final java.lang.String EMPTY_STRING
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLocale
public static java.util.Locale getLocale(java.lang.String xmlLang)
Creates a new Locale base on the value of the lang attribute- Parameters:
lang
- the lang attribute to use when creating a Locale- Returns:
- the Local base on the lang attribute
-
getLocalPart
public static java.lang.String getLocalPart(java.lang.String qName)
Returns the local part of the qualified XML name- Parameters:
qName
- the qualified XML name- Returns:
- the local part of the qualified XML name
-
getNameSpacePrefix
public static java.lang.String getNameSpacePrefix(java.lang.String qName)
Returns the namespace part of the qualified XML name- Parameters:
qName
- the qualified XML name- Returns:
- the namespace part of the qualified XML name
-
isWhitespace
public static boolean isWhitespace(java.lang.String text)
Returns true if the given String contains only whitespace characters- Returns:
- true if the given String contains only whitespace characters, otherwise false.
-
isWhitespace
public static boolean isWhitespace(char[] chars, int start, int length)
Returns true if the given String contains only whitespace characters- Returns:
- true if the given String contains only whitespace characters, otherwise false.
-
-