Skip to content

Commit f10a4b2

Browse files
gabriele-tomassettiadamretter
authored andcommitted
[feature] Add DeleteExpr class to support XQUF delete expression
1 parent f6f09f0 commit f10a4b2

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
* eXist-db Open Source Native XML Database
3+
* Copyright (C) 2001 The eXist-db Authors
4+
*
5+
6+
* http://www.exist-db.org
7+
*
8+
* This library is free software; you can redistribute it and/or
9+
* modify it under the terms of the GNU Lesser General Public
10+
* License as published by the Free Software Foundation; either
11+
* version 2.1 of the License, or (at your option) any later version.
12+
*
13+
* This library is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16+
* Lesser General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU Lesser General Public
19+
* License along with this library; if not, write to the Free Software
20+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21+
*/
22+
package org.exist.xquery.update;
23+
24+
import org.exist.xquery.AnalyzeContextInfo;
25+
import org.exist.xquery.Expression;
26+
import org.exist.xquery.XPathException;
27+
import org.exist.xquery.XQueryContext;
28+
import org.exist.xquery.util.ExpressionDumper;
29+
import org.exist.xquery.value.Item;
30+
import org.exist.xquery.value.Sequence;
31+
32+
/**
33+
* @author <a href="[email protected]">Adam Retter</a>
34+
* @author <a href="[email protected]">Gabriele Tomassetti</a>
35+
*/
36+
public class DeleteExpr extends ModifyingExpression {
37+
38+
public DeleteExpr(final XQueryContext context, final Expression target) {
39+
super(context, target);
40+
}
41+
42+
@Override
43+
public void analyze(final AnalyzeContextInfo contextInfo) throws XPathException {
44+
45+
}
46+
47+
@Override
48+
public Sequence eval(final Sequence contextSequence, final Item contextItem) throws XPathException {
49+
return Sequence.EMPTY_SEQUENCE;
50+
}
51+
52+
public void dump(final ExpressionDumper dumper) {
53+
dumper.display("delete").nl();
54+
dumper.startIndent();
55+
targetExpr.dump(dumper);
56+
dumper.endIndent();
57+
}
58+
59+
@Override
60+
public String toString() {
61+
final StringBuilder result = new StringBuilder();
62+
result.append("delete ");
63+
result.append(" ");
64+
result.append(targetExpr.toString());
65+
return result.toString();
66+
}
67+
}

0 commit comments

Comments
 (0)