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

Method bind

basex-core/src/main/java/org/basex/query/QueryContext.java:462–466  ·  view source on GitHub ↗

Binds a value to a global variable or the context value. The arguments will be ignored if a value has already been assigned. The specified type is interpreted as follows: If "json" is specified, the value is converted according to the rules specified in {@link JsonW3Conver

(final String name, final Object value, final String type, final StaticContext sc)

Source from the content-addressed store, hash-verified

460 * @throws QueryException query exception
461 */
462 public void bind(final String name, final Object value, final String type, final StaticContext sc)
463 throws QueryException {
464 final QNm qnm = name == null || name.isEmpty() ? QNm.EMPTY : qname(name, sc);
465 if(!bindings.contains(qnm)) bindings.put(qnm, cast(value, type));
466 }
467
468 /**
469 * Adds some evaluation info.

Callers 4

compileMethod · 0.95
optimizeMethod · 0.95
variableMethod · 0.45
contextMethod · 0.45

Calls 5

qnameMethod · 0.95
castMethod · 0.95
containsMethod · 0.65
isEmptyMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected