-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor ValidatingVisitor to use factory pattern, error if strict is…
… set and defaults file does not exist (DAT-15920) (#5814)
- Loading branch information
1 parent
180da16
commit e04fc1e
Showing
10 changed files
with
130 additions
and
56 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
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
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
17 changes: 17 additions & 0 deletions
17
...tandard/src/main/java/liquibase/changelog/visitor/StandardValidatingVisitorGenerator.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,17 @@ | ||
package liquibase.changelog.visitor; | ||
|
||
import liquibase.changelog.RanChangeSet; | ||
|
||
import java.util.List; | ||
|
||
public class StandardValidatingVisitorGenerator implements ValidatingVisitorGenerator { | ||
@Override | ||
public int getPriority() { | ||
return PRIORITY_DEFAULT; | ||
} | ||
|
||
@Override | ||
public ValidatingVisitor generateValidatingVisitor(List<RanChangeSet> ranChangeSetList) { | ||
return new ValidatingVisitor(ranChangeSetList); | ||
} | ||
} |
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
22 changes: 22 additions & 0 deletions
22
liquibase-standard/src/main/java/liquibase/changelog/visitor/ValidatingVisitorGenerator.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,22 @@ | ||
package liquibase.changelog.visitor; | ||
|
||
import liquibase.changelog.RanChangeSet; | ||
import liquibase.plugin.Plugin; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* An interface for generating validating visitors, which are used to validate changesets. | ||
*/ | ||
public interface ValidatingVisitorGenerator extends Plugin { | ||
|
||
int getPriority(); | ||
|
||
/** | ||
* Generates a validating visitor for the provided list of ran change sets. | ||
* | ||
* @param ranChangeSetList The list of ran change sets to validate. | ||
* @return A validating visitor for the provided list of ran change sets. | ||
*/ | ||
ValidatingVisitor generateValidatingVisitor(List<RanChangeSet> ranChangeSetList); | ||
} |
22 changes: 22 additions & 0 deletions
22
...standard/src/main/java/liquibase/changelog/visitor/ValidatingVisitorGeneratorFactory.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,22 @@ | ||
package liquibase.changelog.visitor; | ||
|
||
import liquibase.plugin.AbstractPluginFactory; | ||
import lombok.AccessLevel; | ||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class ValidatingVisitorGeneratorFactory extends AbstractPluginFactory<ValidatingVisitorGenerator> { | ||
@Override | ||
protected Class<ValidatingVisitorGenerator> getPluginClass() { | ||
return ValidatingVisitorGenerator.class; | ||
} | ||
|
||
@Override | ||
protected int getPriority(ValidatingVisitorGenerator obj, Object... args) { | ||
return obj.getPriority(); | ||
} | ||
|
||
public ValidatingVisitorGenerator getValidatingVisitorGenerator() { | ||
return getPlugin(); | ||
} | ||
} |
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
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
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