/** * Determines if a character sequence is an NCName (Non-Colonised Name). An NCName is a string * which starts with an NCName start character and is followed by zero or more NCName * characters. * * @param s The character sequence to be tested. * @return {@code true} if {@code s} is an NCName, otherwise {@code false}. */ public static boolean isNCName(@Nullable CharSequence s) { if (isNullOrEmpty(s)) { return false; } assert s != null; int firstCodePoint = Character.codePointAt(s, 0); if (!isNCNameStartChar(firstCodePoint)) { return false; } for (int i = Character.charCount(firstCodePoint); i < s.length();) { int codePoint = Character.codePointAt(s, i); if (!isNCNameChar(codePoint)) { return false; } i += Character.charCount(codePoint); } return true; }
/** * Determines if a character sequence is an NCName (Non-Colonised Name). An * NCName is a string which starts with an NCName start character and is * followed by zero or more NCName characters. * * @param s * The character sequence to be tested. * @return {@code true} if {@code s} is an NCName, otherwise {@code false}. */ public static boolean isNCName(CharSequence s) { if (isNullOrEmpty(s)) { return false; } int firstCodePoint = Character.codePointAt(s, 0); if (!isNCNameStartChar(firstCodePoint)) { return false; } for (int i = Character.charCount(firstCodePoint); i < s.length();) { int codePoint = Character.codePointAt(s, i); if (!isNCNameChar(codePoint)) { return false; } i += Character.charCount(codePoint); } return true; }
/** * Determines if a character sequence is an NCName (Non-Colonised Name). An NCName is a string which starts with an * NCName start character and is followed by zero or more NCName characters. * @param s The character sequence to be tested. * @return <code>true</code> if <code>s</code> is an NCName, otherwise <code>false</code>. */ public static boolean isNCName(CharSequence s) { if (isNullOrEmpty(s)) { return false; } int firstCodePoint = Character.codePointAt(s, 0); if(!isNCNameStartChar(firstCodePoint)) { return false; } for(int i = Character.charCount(firstCodePoint); i < s.length(); ) { int codePoint = Character.codePointAt(s, i); if(!isNCNameChar(codePoint)) { return false; } i += Character.charCount(codePoint); } return true; }
/** * Determines if a character sequence is an NCName (Non-Colonised Name). An NCName is a string * which starts with an NCName start character and is followed by zero or more NCName * characters. * * @param s The character sequence to be tested. * @return {@code true} if {@code s} is an NCName, otherwise {@code false}. */ public static boolean isNCName(@Nullable CharSequence s) { if (isNullOrEmpty(s)) { return false; } assert s != null; int firstCodePoint = Character.codePointAt(s, 0); if (!isNCNameStartChar(firstCodePoint)) { return false; } for (int i = Character.charCount(firstCodePoint); i < s.length();) { int codePoint = Character.codePointAt(s, i); if (!isNCNameChar(codePoint)) { return false; } i += Character.charCount(codePoint); } return true; }
/** * Determines if a character sequence is an NCName (Non-Colonised Name). An NCName is a string * which starts with an NCName start character and is followed by zero or more NCName * characters. * * @param s The character sequence to be tested. * @return {@code true} if {@code s} is an NCName, otherwise {@code false}. */ public static boolean isNCName(@Nullable CharSequence s) { if (isNullOrEmpty(s)) { return false; } assert s != null; int firstCodePoint = Character.codePointAt(s, 0); if (!isNCNameStartChar(firstCodePoint)) { return false; } for (int i = Character.charCount(firstCodePoint); i < s.length();) { int codePoint = Character.codePointAt(s, i); if (!isNCNameChar(codePoint)) { return false; } i += Character.charCount(codePoint); } return true; }
if (isNullOrEmpty(s) || start >= s.length()) { return false;
if (isNullOrEmpty(s) || start >= s.length()) { return false;
if (isNullOrEmpty(s) || start >= s.length()) { return false;
if (isNullOrEmpty(s)) { return false;
if (isNullOrEmpty(s)) { return false;