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

Method eval

basex-core/src/main/java/org/basex/core/Sandbox.java:251–264  ·  view source on GitHub ↗

Runs a query. @param query query string @return result @throws QueryException query exception @throws IOException I/O exception

(final String query)

Source from the content-addressed store, hash-verified

249 * @throws IOException I/O exception
250 */
251 protected static String eval(final String query) throws QueryException, IOException {
252 final ArrayOutput ao = new ArrayOutput();
253 try(QueryProcessor qp = new QueryProcessor(query, BASEURI, context, null)) {
254 qp.compile();
255 qp.register(context);
256 try(Serializer ser = qp.serializer(ao)) {
257 qp.value().serialize(ser);
258 } finally {
259 qp.close();
260 qp.unregister(context);
261 }
262 }
263 return ao.toString();
264 }
265
266 /**
267 * Checks the query plan and the result.

Callers 2

queryMethod · 0.95
errorMethod · 0.95

Calls 8

toStringMethod · 0.95
serializerMethod · 0.80
compileMethod · 0.65
closeMethod · 0.65
registerMethod · 0.45
serializeMethod · 0.45
valueMethod · 0.45
unregisterMethod · 0.45

Tested by

no test coverage detected