-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathRowPatternFunction.java
More file actions
63 lines (52 loc) · 1.66 KB
/
Copy pathRowPatternFunction.java
File metadata and controls
63 lines (52 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*-
* #%L
* JSQLParser library
* %%
* Copyright (C) 2004 - 2026 JSQLParser
* %%
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
* #L%
*/
package net.sf.jsqlparser.expression;
import java.util.function.Consumer;
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
/** An explicit RUNNING or FINAL evaluation mode on a row-pattern function. */
public class RowPatternFunction extends ASTNodeAccessImpl implements Expression {
public enum EvaluationMode {
RUNNING, FINAL
}
private EvaluationMode evaluationMode;
private Function function;
public RowPatternFunction(EvaluationMode evaluationMode, Function function) {
this.evaluationMode = evaluationMode;
this.function = function;
}
public EvaluationMode getEvaluationMode() {
return evaluationMode;
}
public RowPatternFunction setEvaluationMode(EvaluationMode mode) {
evaluationMode = mode;
return this;
}
public Function getFunction() {
return function;
}
public RowPatternFunction setFunction(Function function) {
this.function = function;
return this;
}
@Override
public <T, S> T accept(ExpressionVisitor<T> visitor, S context) {
return visitor.visit(this, context);
}
public StringBuilder appendTo(StringBuilder builder, Consumer<Expression> expressions) {
builder.append(evaluationMode).append(' ');
expressions.accept(function);
return builder;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
return appendTo(builder, expression -> builder.append(expression)).toString();
}
}