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

Method simpleQuery

basex-core/src/main/java/org/basex/gui/GUI.java:343–351  ·  view source on GitHub ↗

Launches a simple single-line query. Adds the default namespace if available. @param query expression to be run

(final String query)

Source from the content-addressed store, hash-verified

341 * @param query expression to be run
342 */
343 public void simpleQuery(final String query) {
344 // check and add default namespace
345 String q = query.trim().isEmpty() ? "()" : query;
346 final Data data = context.data();
347 final Namespaces ns = data.nspaces;
348 final int uriId = ns.uriIdForPrefix(Token.EMPTY, 0, data);
349 if(uriId != 0) q = Util.info("declare default element namespace \"%\"; %", ns.uri(uriId), q);
350 execute(new XQuery(q));
351 }
352
353 /**
354 * Launches the specified commands in a separate thread.

Callers 3

executeMethod · 0.95
queryMethod · 0.80
queryMethod · 0.80

Calls 7

uriIdForPrefixMethod · 0.95
infoMethod · 0.95
uriMethod · 0.95
executeMethod · 0.95
isEmptyMethod · 0.45
trimMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected