-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
ChangeLogParserConfiguration.java
56 lines (42 loc) · 2.49 KB
/
ChangeLogParserConfiguration.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package liquibase.parser;
import liquibase.GlobalConfiguration;
import liquibase.configuration.AutoloadedConfigurations;
import liquibase.configuration.ConfigurationDefinition;
/**
* Configuration container for properties applicable to most {@link liquibase.parser.ChangeLogParser} implementations
*/
public class ChangeLogParserConfiguration implements AutoloadedConfigurations {
public static final ConfigurationDefinition<Boolean> SUPPORT_PROPERTY_ESCAPING;
public static final ConfigurationDefinition<Boolean> USE_PROCEDURE_SCHEMA;
public static final ConfigurationDefinition<MissingPropertyMode> MISSING_PROPERTY_MODE;
public static final ConfigurationDefinition<ChangelogParseMode> CHANGELOG_PARSE_MODE;
static {
ConfigurationDefinition.Builder builder = new ConfigurationDefinition.Builder("liquibase");
SUPPORT_PROPERTY_ESCAPING = builder.define("supportPropertyEscaping", Boolean.class)
.setDescription("Support escaping changelog parameters using a colon. Example: ${:user.name}")
.setDefaultValue(false)
.addAliasKey("enableEscaping")
.build();
USE_PROCEDURE_SCHEMA = builder.define("useProcedureSchema", Boolean.class)
.setDescription("If set to true (default value), createProcedure tags with a set schemaName will modify the procedure body with the given schema name.")
.setDefaultValue(true)
.build();
MISSING_PROPERTY_MODE = builder.define("missingPropertyMode", MissingPropertyMode.class)
.setDescription("How to handle changelog property expressions where a value is not set. For example, a string '${address}' when no 'address' property was defined. Values can be: 'preserve' which leaves the string as-is, 'empty' which replaces it with an empty string, or 'error' which stops processing with an error.")
.setDefaultValue(MissingPropertyMode.PRESERVE)
.build();
CHANGELOG_PARSE_MODE = builder.define("changelogParseMode", ChangelogParseMode.class)
.setDescription("Configures how to handle unknown fields in changelog files. Possible values: STRICT which causes parsing to fail, and LAX which continues with the parsing.")
.setDefaultValue(ChangelogParseMode.STRICT)
.build();
}
public enum MissingPropertyMode {
PRESERVE,
EMPTY,
ERROR,
}
public enum ChangelogParseMode {
STRICT,
LAX,
}
}