mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improve sqlwall
This commit is contained in:
@@ -17,7 +17,7 @@ package com.alibaba.druid.sql.ast.expr;
|
||||
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
|
||||
|
||||
public class SQLCharExpr extends SQLTextLiteralExpr {
|
||||
public class SQLCharExpr extends SQLTextLiteralExpr implements SQLValuableExpr{
|
||||
|
||||
public SQLCharExpr(){
|
||||
|
||||
@@ -42,4 +42,9 @@ public class SQLCharExpr extends SQLTextLiteralExpr {
|
||||
visitor.visit(this);
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue() {
|
||||
return this.text;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ package com.alibaba.druid.sql.ast.expr;
|
||||
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
|
||||
|
||||
public class SQLIntegerExpr extends SQLNumericLiteralExpr {
|
||||
public class SQLIntegerExpr extends SQLNumericLiteralExpr implements SQLValuableExpr{
|
||||
|
||||
private Number number;
|
||||
|
||||
@@ -77,4 +77,9 @@ public class SQLIntegerExpr extends SQLNumericLiteralExpr {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue() {
|
||||
return this.number;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,9 @@ package com.alibaba.druid.sql.ast.expr;
|
||||
import com.alibaba.druid.sql.ast.SQLExprImpl;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
|
||||
|
||||
public class SQLNullExpr extends SQLExprImpl implements SQLLiteralExpr {
|
||||
import static com.alibaba.druid.sql.visitor.SQLEvalVisitor.EVAL_VALUE_NULL;
|
||||
|
||||
public class SQLNullExpr extends SQLExprImpl implements SQLLiteralExpr, SQLValuableExpr {
|
||||
|
||||
public SQLNullExpr(){
|
||||
|
||||
@@ -41,4 +43,9 @@ public class SQLNullExpr extends SQLExprImpl implements SQLLiteralExpr {
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof SQLNullExpr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue() {
|
||||
return EVAL_VALUE_NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright 1999-2011 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.druid.sql.ast.expr;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLExpr;
|
||||
|
||||
public interface SQLValuableExpr extends SQLExpr {
|
||||
|
||||
Object getValue();
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user