public class NamespaceUtil
extends java.lang.Object
Constructor and Description |
---|
NamespaceUtil() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
generatePrefix(java.lang.String namespace)
Generates a candidate prefix for the specified namespace.
|
java.util.Map<java.lang.String,java.lang.String> |
getNamespace2PrefixMap() |
java.lang.String |
getPrefix(java.lang.String namespace)
Gets a prefix for the given namespace.
|
static boolean |
isDigit(char ch) |
static boolean |
isLetter(char ch) |
static boolean |
isNCNameChar(char ch)
Deprecated.
|
static boolean |
isNCNameStartChar(char ch)
Deprecated.
|
void |
setPrefix(java.lang.String namespace,
java.lang.String prefix)
Sets the prefix for the specified namespace.
|
java.lang.String[] |
split(java.lang.String s)
Deprecated.
|
java.lang.String[] |
split(java.lang.String s,
java.lang.String[] result)
Deprecated.
|
public static boolean isLetter(char ch)
ch
- character to checkpublic static boolean isDigit(char ch)
ch
- character to check@Deprecated public static boolean isNCNameChar(char ch)
XMLUtils.isNCNameChar(int)
@Deprecated public static boolean isNCNameStartChar(char ch)
XMLUtils.isNCNameStartChar(int)
@Deprecated public java.lang.String[] split(java.lang.String s, java.lang.String[] result)
XMLUtils.getNCNamePrefix(CharSequence)
s
- The string to be split.result
- May be null
. If not null
the method will
fill the array with the result and return the passed in array. This allows a
String array to be reused. If this parameter is null
then a new
String array will be created to hold the result. The size of the array
must be 2 @Deprecated public java.lang.String[] split(java.lang.String s)
XMLUtils.getNCNamePrefix(CharSequence)
public java.lang.String getPrefix(java.lang.String namespace)
namespace
- The namespace whose prefix is to be
retrieved.public java.util.Map<java.lang.String,java.lang.String> getNamespace2PrefixMap()
public java.lang.String generatePrefix(java.lang.String namespace)
namespace
- The namespace that a prefix should be generated
for. The implementation attempts to generate a prefix based on
the namespace. If it cannot do this, a prefix of the form pn
is generated, where n is an integer.public void setPrefix(java.lang.String namespace, java.lang.String prefix)
namespace
- The namespace whose prefix is to be set.prefix
- The prefix for the namespace