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