View Javadoc

1   package liquibase.sql.visitor;
2   
3   import liquibase.database.Database;
4   
5   public class RegExpReplaceSqlVisitor extends AbstractSqlVisitor {
6   
7       private String replace;
8       private String with;
9   
10      public String getName() {
11          return "regExpReplace";
12      }
13  
14      public String getReplace() {
15          return replace;
16      }
17  
18      public void setReplace(String replace) {
19          this.replace = replace;
20      }
21  
22      public String getWith() {
23          return with;
24      }
25  
26      public void setWith(String with) {
27          this.with = with;
28      }
29  
30      public String modifySql(String sql, Database database) {
31          return sql.replaceAll(getReplace(), getWith());
32      }
33  }