forked from JSQLParser/JSqlParser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* an extensible validation visitor framework (ValidationCapability and
its subtypes FeatureSetValidation, DatabaseMetaDataValidation, AllowedTypesValidation) * FeatureConfiguration/Feature/FeatureSet class new packages * net.sf.jsqlparser.util.validation * net.sf.jsqlparser.parser.feature ------ history: * fresh clone from JSQLParser/JSqlParser (master) -> master.validate * (Merge the work on this issue done in 'github.validate' into master.validate) JSQLParser#1005
- Loading branch information
Showing
71 changed files
with
6,224 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/main/java/net/sf/jsqlparser/parser/AbstractJSqlParser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/*- | ||
* #%L | ||
* JSQLParser library | ||
* %% | ||
* Copyright (C) 2004 - 2020 JSQLParser | ||
* %% | ||
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0 | ||
* #L% | ||
*/ | ||
package net.sf.jsqlparser.parser; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import net.sf.jsqlparser.parser.feature.Feature; | ||
import net.sf.jsqlparser.parser.feature.FeatureConfiguration; | ||
|
||
public abstract class AbstractJSqlParser<P> { | ||
|
||
protected int jdbcParameterIndex = 0; | ||
protected boolean errorRecovery = false; | ||
protected List<ParseException> parseErrors = new ArrayList<>(); | ||
|
||
public P withSquareBracketQuotation(boolean allowSquareBracketQuotation) { | ||
return withFeature(Feature.allowSquareBracketQuotation, allowSquareBracketQuotation); | ||
} | ||
|
||
public P withFeature(Feature f, boolean enabled) { | ||
getConfiguration().setValue(f, enabled); | ||
return me(); | ||
} | ||
|
||
public abstract FeatureConfiguration getConfiguration(); | ||
|
||
public abstract P me(); | ||
|
||
public boolean getAsBoolean(Feature f) { | ||
return getConfiguration().getAsBoolean(f); | ||
} | ||
|
||
public void setErrorRecovery(boolean errorRecovery) { | ||
this.errorRecovery = errorRecovery; | ||
} | ||
|
||
public List<ParseException> getParseErrors() { | ||
return parseErrors; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.