mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improve wall filter
This commit is contained in:
@@ -68,10 +68,20 @@ public class Lexer {
|
||||
|
||||
private int varIndex = -1;
|
||||
|
||||
protected CommentHandler commentHandler;
|
||||
|
||||
public Lexer(String input){
|
||||
this(input, true);
|
||||
}
|
||||
|
||||
public CommentHandler getCommentHandler() {
|
||||
return commentHandler;
|
||||
}
|
||||
|
||||
public void setCommentHandler(CommentHandler commentHandler) {
|
||||
this.commentHandler = commentHandler;
|
||||
}
|
||||
|
||||
public final char charAt(int index) {
|
||||
if (index >= text.length()) {
|
||||
return EOI;
|
||||
@@ -1008,4 +1018,9 @@ public class Lexer {
|
||||
public BigDecimal decimalValue() {
|
||||
return new BigDecimal(text.toCharArray(), mark, bufPos);
|
||||
}
|
||||
|
||||
public static interface CommentHandler {
|
||||
|
||||
boolean handle(Token lastToken, String comment);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user