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

Method toString

basex-core/src/main/java/org/basex/query/expr/Lookup.java:163–179  ·  view source on GitHub ↗
(final QueryString qs)

Source from the content-addressed store, hash-verified

161 }
162
163 @Override
164 public void toString(final QueryString qs) {
165 qs.token(exprs[0]).token('?');
166
167 final Expr keys = exprs[1];
168 Object key = null;
169 if(keys == WILDCARD) {
170 key = WILDCARD.string();
171 } else if(keys instanceof final Str str) {
172 if(XMLToken.isNCName(str.string())) key = str.toJava();
173 } else if(keys instanceof final Itr itr) {
174 final long l = itr.itr();
175 if(l >= 0) key = l;
176 }
177 if(key != null) qs.token(key);
178 else qs.paren(keys);
179 }
180}

Callers

nothing calls this directly

Calls 6

isNCNameMethod · 0.95
parenMethod · 0.80
tokenMethod · 0.65
stringMethod · 0.45
toJavaMethod · 0.45
itrMethod · 0.45

Tested by

no test coverage detected