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

Method get

basex-core/src/main/java/org/basex/query/func/Functions.java:83–106  ·  view source on GitHub ↗

Creates a function call or a function item expression. @param qnm function name @param fb function arguments @param qc query context @return function call @throws QueryException query exception

(final QNm qnm, final FuncBuilder fb, final QueryContext qc)

Source from the content-addressed store, hash-verified

81 * @throws QueryException query exception
82 */
83 public static Expr get(final QNm qnm, final FuncBuilder fb, final QueryContext qc)
84 throws QueryException {
85
86 // partial function call?
87 if(fb.placeholders > 0) return dynamic(item(qnm, fb.arity, false, fb.info, qc), fb);
88
89 final QNm name = funcName(qnm, fb.arity, fb.info, qc);
90
91 // constructor function
92 if(eq(name.uri(), XS_URI)) return constructorCall(name, fb);
93
94 // built-in function
95 final FuncDefinition fd = builtIn(name);
96 if(fd != null) {
97 final int min = fd.minMax[0], max = fd.minMax[1];
98 final Expr[] prepared = prepareArgs(fb, fd.params, min, max, fd);
99 final StandardFunc sf = fd.get(fb.info, prepared);
100 if(sf.hasUPD()) qc.updating();
101 return sf;
102 }
103
104 // user-defined function
105 return staticCall(name, fb, qc);
106 }
107
108 /**
109 * Creates a dynamic function call or a partial function expression.

Callers 2

arrowMethod · 0.95
functionCallMethod · 0.95

Calls 12

dynamicMethod · 0.95
itemMethod · 0.95
funcNameMethod · 0.95
uriMethod · 0.95
constructorCallMethod · 0.95
builtInMethod · 0.95
prepareArgsMethod · 0.95
getMethod · 0.95
hasUPDMethod · 0.95
staticCallMethod · 0.95
eqMethod · 0.65
updatingMethod · 0.45

Tested by

no test coverage detected