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

Class FuncItem

basex-core/src/main/java/org/basex/query/value/item/FuncItem.java:29–370  ·  view source on GitHub ↗

Function item. @author BaseX Team, BSD License @author Leo Woerteler

Source from the content-addressed store, hash-verified

27 * @author Leo Woerteler
28 */
29public final class FuncItem extends FItem implements Scope {
30 /** Function expression. */
31 public final Expr expr;
32
33 /** Parameters. */
34 private final Var[] params;
35 /** Annotations. */
36 private final AnnList anns;
37 /** Size of the stack frame needed for this function. */
38 private final int stackSize;
39 /** Input information. */
40 private final InputInfo info;
41 /** Function name (can be {@code null}). */
42 private final QNm name;
43 /** Query focus. */
44 private final QueryFocus focus;
45 /** Indicates if the query focus is accessed or modified. */
46 private final boolean simple;
47
48 /**
49 * Constructor.
50 * @param info input info (can be {@code null})
51 * @param expr function body
52 * @param params parameters
53 * @param anns function annotations
54 * @param type function type
55 * @param stackSize stack-frame size
56 * @param name function name (can be {@code null})
57 */
58 public FuncItem(final InputInfo info, final Expr expr, final Var[] params, final AnnList anns,
59 final FuncType type, final int stackSize, final QNm name) {
60 this(info, expr, params, anns, type, stackSize, name, null);
61 }
62
63 /**
64 * Constructor.
65 * @param info input info (can be {@code null})
66 * @param expr function body
67 * @param params parameters
68 * @param anns function annotations
69 * @param type function type
70 * @param stackSize stack-frame size
71 * @param name function name (can be {@code null})
72 * @param focus query focus (can be {@code null})
73 */
74 public FuncItem(final InputInfo info, final Expr expr, final Var[] params, final AnnList anns,
75 final FuncType type, final int stackSize, final QNm name, final QueryFocus focus) {
76 super(type);
77 this.info = info;
78 this.expr = expr;
79 this.params = params;
80 this.anns = anns;
81 this.stackSize = stackSize;
82 this.name = name;
83 this.focus = focus;
84 simple = !expr.has(Flag.CTX);
85 }
86

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected