public class IdUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
(package private) static java.lang.String |
valid
Characters allowed in the node name.
|
| Constructor and Description |
|---|
IdUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String[] |
listPaths(java.lang.String nodeId)
Generate a list of partial paths starting from root to specified node
ID.
|
static java.lang.String |
normalize(java.lang.String nodeId)
This method check nodeId validness and returns it in normalized form
/elem0/elem2/.../elemN. |
(package private) static java.lang.String[] |
splitId(java.lang.String id)
Split path into parent id and node name.
|
static java.lang.String |
upcaseFirst(java.lang.String str)
Uppercase first letter in the given string.
|
private static boolean |
verifyChars(java.lang.String string)
Validate string content.
|
static final java.lang.String valid
public static java.lang.String[] listPaths(java.lang.String nodeId)
nodeId /security/users/siy will
produce following set: nodeId - Node ID to normalize.null if node
ID is invalid.public static java.lang.String normalize(java.lang.String nodeId)
/elem0/elem2/.../elemN. All redundant
forward slashes are removed. If leading slash is omitted then path is
assumed invalid.nodeId - Node ID to normalize.null if node ID is invalid.public static java.lang.String upcaseFirst(java.lang.String str)
For example:
xml will be converted to Xml
xml-ldap will be converted to XmlLdap
xml-ldap-sql will be converted to XmlLdapSql
str - Source string.static java.lang.String[] splitId(java.lang.String id)
null since there is no parent for the root node.id - Node id.null is returned.private static boolean verifyChars(java.lang.String string)
string - Source string.true if string contains only allowed characters
and false otherwise.