/** * Finds the specified namespace uri. * * @param pref prefix of the namespace * @return uri, or {@code null} */ public static byte[] uri(final byte[] pref) { for (int s = NS.size() - 1; s >= 0; s--) { if (eq(NS.name(s), pref)) return NS.string(s); } return null; }
/** * Finds the prefix for the specified uri. * * @param uri namespace uri * @return prefix, or empty string */ public static byte[] prefix(final byte[] uri) { for (int s = NS.size() - 1; s >= 0; s--) { if (eq(NS.string(s), uri)) return NS.name(s); } return EMPTY; }
/** * Checks if the specified uri is a reserved namespace. * * @param uri uri to be checked * @return result of check */ public static boolean reserved(final byte[] uri) { for (int s = RESERVED - 1; s >= 0; s--) { if (eq(NS.string(s), uri)) return true; } return false; }