1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.common.util.property.processor;
17
18 import java.util.Properties;
19
20 import org.kuali.common.util.PropertyUtils;
21 import org.kuali.common.util.property.Constants;
22 import org.kuali.common.util.property.GlobalPropertiesMode;
23 import org.slf4j.Logger;
24 import org.slf4j.LoggerFactory;
25 import org.springframework.util.PropertyPlaceholderHelper;
26
27
28
29
30 @Deprecated
31 public class ResolvePlaceholdersProcessor implements PropertyProcessor {
32
33 private static final Logger logger = LoggerFactory.getLogger(ResolvePlaceholdersProcessor.class);
34
35 PropertyPlaceholderHelper helper = Constants.DEFAULT_PROPERTY_PLACEHOLDER_HELPER;
36 GlobalPropertiesMode globalPropertiesMode = Constants.DEFAULT_GLOBAL_PROPERTIES_MODE;
37
38 public ResolvePlaceholdersProcessor() {
39 this(Constants.DEFAULT_PROPERTY_PLACEHOLDER_HELPER);
40 }
41
42 public ResolvePlaceholdersProcessor(PropertyPlaceholderHelper helper) {
43 this(helper, Constants.DEFAULT_GLOBAL_PROPERTIES_MODE);
44 }
45
46 public ResolvePlaceholdersProcessor(PropertyPlaceholderHelper helper, GlobalPropertiesMode globalPropertiesMode) {
47 super();
48 this.helper = helper;
49 this.globalPropertiesMode = globalPropertiesMode;
50 }
51
52 @Override
53 public void process(Properties properties) {
54 Properties resolvedProperties = PropertyUtils.getResolvedProperties(properties, helper, globalPropertiesMode);
55 if (resolvedProperties.size() > 0) {
56 logger.debug("Resolved {} property values", resolvedProperties.size());
57 properties.putAll(resolvedProperties);
58 }
59 }
60
61 public PropertyPlaceholderHelper getHelper() {
62 return helper;
63 }
64
65 public void setHelper(PropertyPlaceholderHelper helper) {
66 this.helper = helper;
67 }
68
69 public GlobalPropertiesMode getGlobalPropertiesMode() {
70 return globalPropertiesMode;
71 }
72
73 public void setGlobalPropertiesMode(GlobalPropertiesMode globalPropertiesMode) {
74 this.globalPropertiesMode = globalPropertiesMode;
75 }
76 }