MCPcopy Create free account
hub / github.com/BaseXdb/basex / isName

Method isName

basex-core/src/main/java/org/basex/util/XMLToken.java:198–205  ·  view source on GitHub ↗

Checks if the specified token is a valid name. @param value value to be checked @return result of check

(final byte[] value)

Source from the content-addressed store, hash-verified

196 * @return result of check
197 */
198 public static boolean isName(final byte[] value) {
199 final int vl = value.length;
200 for(int v = 0; v < vl; v += cl(value, v)) {
201 final int cp = cp(value, v);
202 if(v == 0 ? !isStartChar(cp) : !isChar(cp)) return false;
203 }
204 return vl != 0;
205 }
206
207 /**
208 * Checks if the specified token is a valid NMToken.

Callers 2

queryMethod · 0.95
castMethod · 0.95

Calls 4

isStartCharMethod · 0.95
isCharMethod · 0.95
clMethod · 0.45
cpMethod · 0.45

Tested by

no test coverage detected