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

Method create

basex-core/src/main/java/org/basex/query/QueryPlan.java:100–115  ·  view source on GitHub ↗

Creates a new element node to be added to the query plan. @param expr calling expression @param atts attribute names and values @return element

(final ExprInfo expr, final Object... atts)

Source from the content-addressed store, hash-verified

98 * @return element
99 */
100 public FBuilder create(final ExprInfo expr, final Object... atts) {
101 final FBuilder elem = FElem.build(new QNm(Util.className(expr)));
102 final int al = atts.length;
103 for(int a = 0; a < al - 1; a += 2) {
104 addAttribute(elem, atts[a], atts[a + 1]);
105 }
106 if(expr instanceof final Expr ex) {
107 attachType(elem, ex.seqType(), ex.size(), ex.structSize(), ex.data());
108 } else if(expr instanceof StaticDecl) {
109 attachType(elem, ((StaticDecl) expr).seqType(), -1, -1, null);
110 }
111 final InputInfo info = expr.info();
112 if(info != null) attach(elem, info);
113
114 return elem;
115 }
116
117 /**
118 * Creates a new element node to be added to the query plan.

Callers

nothing calls this directly

Calls 12

buildMethod · 0.95
classNameMethod · 0.95
addAttributeMethod · 0.95
attachTypeMethod · 0.95
attachMethod · 0.95
capitalizeMethod · 0.95
attachVariableMethod · 0.95
seqTypeMethod · 0.65
sizeMethod · 0.65
infoMethod · 0.65
structSizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected