01: package liquibase.parser.filter;
02:
03: import liquibase.ChangeSet;
04: import liquibase.database.Database;
05:
06: public class DbmsChangeSetFilter implements ChangeSetFilter {
07:
08: private String databaseString;
09:
10: public DbmsChangeSetFilter(Database database) {
11: this .databaseString = database.getTypeName();
12: }
13:
14: public boolean accepts(ChangeSet changeSet) {
15: if (databaseString == null) {
16: return true;
17: }
18:
19: if (changeSet.getDbmsSet() == null) {
20: return true;
21: }
22:
23: for (String dbms : changeSet.getDbmsSet()) {
24: if (databaseString.equals(dbms)) {
25: return true;
26: }
27: }
28:
29: return false;
30: }
31: }
|