Skip to content

Commit ba1e1c7

Browse files
gabriele-tomassettiadamretter
authored andcommitted
[feature] Add base class ModifyingExpression to support insert, delete, replace and rename expressions
1 parent b1d14de commit ba1e1c7

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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.AbstractExpression;
25+
import org.exist.xquery.Expression;
26+
import org.exist.xquery.XQueryContext;
27+
import org.exist.xquery.value.Type;
28+
29+
/**
30+
* @author <a href="[email protected]">Adam Retter</a>
31+
* @author <a href="[email protected]">Gabriele Tomassetti</a>
32+
*/
33+
public abstract class ModifyingExpression extends AbstractExpression {
34+
35+
protected final Expression targetExpr;
36+
37+
public ModifyingExpression(final XQueryContext context, final Expression target) {
38+
super(context);
39+
this.targetExpr = target;
40+
}
41+
42+
@Override
43+
public int returnsType() {
44+
// placeholder implementation
45+
return Type.EMPTY;
46+
}
47+
48+
public Category getCategory() {
49+
return Category.UPDATING;
50+
}
51+
52+
public Expression getTargetExpr() {
53+
return targetExpr;
54+
}
55+
}

0 commit comments

Comments
 (0)