1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.common.util.property;
17
18 import org.kuali.common.util.Mode;
19 import org.kuali.common.util.maven.MavenConstants;
20 import org.kuali.common.util.property.processor.NoOpProcessor;
21 import org.kuali.common.util.property.processor.PropertyProcessor;
22 import org.springframework.util.PropertyPlaceholderHelper;
23
24 public final class Constants {
25
26 public static final String UTF8 = "UTF-8";
27 public static final String DEFAULT_ENCODING = UTF8;
28 @Deprecated
29 public static final String DEFAULT_MAVEN_PROPERTIES_BEAN_NAME = MavenConstants.PROPERTIES_BEAN_NAME;
30 public static final String DEFAULT_PLACEHOLDER_PREFIX = "${";
31 public static final String DEFAULT_PLACEHOLDER_SUFFIX = "}";
32 public static final String DEFAULT_VALUE_SEPARATOR = ":";
33 public static final String DEFAULT_ESCAPE_STRING = "\\";
34 public static final boolean DEFAULT_IGNORE_UNRESOLVABLE_PLACEHOLDERS = true;
35 public static final boolean DEFAULT_RESOLVE_PLACEHOLDERS = true;
36 public static final String DEFAULT_ENCRYPTED_SUFFIX = ".encrypted";
37 public static final String DEFAULT_PATH_SUFFIX = "path";
38 public static final String DEFAULT_MAJOR_VERSION_SUFFIX = "major";
39 public static final String DEFAULT_MINOR_VERSION_SUFFIX = "minor";
40 public static final String DEFAULT_INCREMENTAL_VERSION_SUFFIX = "incremental";
41 public static final String DEFAULT_QUALIFIER_VERSION_SUFFIX = "qualifier";
42 public static final String DEFAULT_TRIMMED_VERSION_SUFFIX = "trimmed";
43 public static final String DEFAULT_SNAPSHOT_VERSION_SUFFIX = "snapshot";
44 public static final String DEFAULT_CODE_SUFFIX = "code";
45 public static final String DEFAULT_HOME_SUFFIX = "home";
46 @Deprecated
47 public static final String DEFAULT_GROUP_ID_PROPERTY = MavenConstants.GROUP_ID_KEY;
48 @Deprecated
49 public static final String DEFAULT_ARTIFACT_ID_PROPERTY = MavenConstants.ARTIFACT_ID_KEY;
50 @Deprecated
51 public static final String DEFAULT_VERSION_PROPERTY = MavenConstants.VERSION_KEY;
52 public static final String DEFAULT_USER_HOME_PROPERTY = "user.home";
53 public static final Mode DEFAULT_PROPERTY_OVERWRITE_MODE = Mode.INFORM;
54 public static final GlobalPropertiesMode DEFAULT_GLOBAL_PROPERTIES_MODE = GlobalPropertiesMode.BOTH;
55 public static final PropertyPlaceholderHelper DEFAULT_PROPERTY_PLACEHOLDER_HELPER = getDefaultHelper();
56 public static final PropertyProcessor NO_OP_PROCESSOR = new NoOpProcessor();
57 public static final String GROUP_ID = "groupId";
58 public static final String GROUP = "group";
59 @Deprecated
60 public static final String NONE = "NONE";
61 @Deprecated
62 public static final String NULL = "NULL";
63 public static final String WILDCARD = "*";
64 public static final String ENCRYPTION_PREFIX = "ENC(";
65 public static final String ENCRYPTION_SUFFIX = ")";
66
67
68
69 @Deprecated
70 public static final String GROUP_ID_BASE_PATH_KEY = "project.groupId.base.path";
71 public static final String ARTIFACT_ID_KEY = MavenConstants.ARTIFACT_ID_KEY;
72 public static final String GROUP_ID_PATH_KEY = MavenConstants.GROUP_ID_PATH_KEY;
73 public static final String PROJECT_PROPERTIES_BASE = "META-INF/${" + GROUP_ID_PATH_KEY + "}/${" + ARTIFACT_ID_KEY + "}";
74 public static final String PROJECT_PROPERTIES_FRAGMENT = PROJECT_PROPERTIES_BASE + "/project.properties";
75 public static final String PROJECT_PROPERTIES_OUTPUTFILE = "${project.build.outputDirectory}/" + PROJECT_PROPERTIES_FRAGMENT;
76 public static final String PROJECT_PROPERTIES_LOCATION = "classpath:" + PROJECT_PROPERTIES_FRAGMENT;
77
78 public static final String RICE_PROPERTIES_SUFFIX = "rice-properties.xml";
79 public static final String RICE_PROJECT_PROPERTIES_FRAGMENT = PROJECT_PROPERTIES_BASE + "/project-" + RICE_PROPERTIES_SUFFIX;
80 public static final String RICE_PROJECT_PROPERTIES_OUTPUTFILE = "${project.build.outputDirectory}/" + RICE_PROJECT_PROPERTIES_FRAGMENT;
81 public static final String RICE_PROJECT_PROPERTIES_LOCATION = "classpath:" + RICE_PROJECT_PROPERTIES_FRAGMENT;
82
83 private static final PropertyPlaceholderHelper getDefaultHelper() {
84 return new PropertyPlaceholderHelper(DEFAULT_PLACEHOLDER_PREFIX, DEFAULT_PLACEHOLDER_SUFFIX, DEFAULT_VALUE_SEPARATOR, DEFAULT_IGNORE_UNRESOLVABLE_PLACEHOLDERS);
85 }
86
87 }