| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
package org.kuali.rice.kew.plugin; |
| 18 |
|
|
| 19 |
|
import org.kuali.rice.core.api.config.property.Config; |
| 20 |
|
import org.kuali.rice.core.impl.config.property.BaseConfig; |
| 21 |
|
|
| 22 |
|
import java.io.File; |
| 23 |
|
import java.net.MalformedURLException; |
| 24 |
|
import java.net.URL; |
| 25 |
|
import java.util.ArrayList; |
| 26 |
|
import java.util.HashMap; |
| 27 |
|
import java.util.List; |
| 28 |
|
import java.util.Map; |
| 29 |
|
import java.util.Properties; |
| 30 |
|
|
| 31 |
|
|
| 32 |
|
|
| 33 |
|
|
| 34 |
|
|
| 35 |
|
@see |
| 36 |
|
|
| 37 |
|
@author |
| 38 |
|
|
|
|
|
| 0% |
Uncovered Elements: 40 (40) |
Complexity: 15 |
Complexity Density: 0.65 |
|
| 39 |
|
public class PluginConfig extends BaseConfig { |
| 40 |
|
|
| 41 |
|
private String resourceLoaderClassname; |
| 42 |
|
private List listeners = new ArrayList(); |
| 43 |
|
private Properties parentProperties; |
| 44 |
|
private Map parentObjects; |
| 45 |
|
private Config parentConfig; |
| 46 |
|
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 47 |
0
|
public PluginConfig(URL url, Config parentConfig) {... |
| 48 |
0
|
super(url.toString()); |
| 49 |
0
|
this.parentProperties = parentConfig.getProperties(); |
| 50 |
0
|
this.parentObjects = parentConfig.getObjects(); |
| 51 |
0
|
this.parentConfig = parentConfig; |
| 52 |
|
} |
| 53 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 54 |
0
|
public PluginConfig(File configFile, Config parentConfig) throws MalformedURLException {... |
| 55 |
0
|
this(configFile.toURI().toURL(), parentConfig); |
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 59 |
0
|
public Properties getBaseProperties() {... |
| 60 |
0
|
return this.parentProperties; |
| 61 |
|
} |
| 62 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 63 |
0
|
public Map getBaseObjects() {... |
| 64 |
0
|
return this.parentObjects; |
| 65 |
|
} |
| 66 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 67 |
0
|
public void addListener(String listenerClass) {... |
| 68 |
0
|
listeners.add(listenerClass); |
| 69 |
|
} |
| 70 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 71 |
0
|
public List getListeners() {... |
| 72 |
0
|
return listeners; |
| 73 |
|
} |
| 74 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 75 |
0
|
public void setResourceLoaderClassname(String resourceLoaderClassname) {... |
| 76 |
0
|
this.resourceLoaderClassname = resourceLoaderClassname; |
| 77 |
|
} |
| 78 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 79 |
0
|
public String getResourceLoaderClassname() {... |
| 80 |
0
|
return resourceLoaderClassname; |
| 81 |
|
} |
| 82 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 83 |
0
|
public String toString() {... |
| 84 |
0
|
return "[PluginConfig: resourceLoaderClassname: " + getResourceLoaderClassname() + "]"; |
| 85 |
|
} |
| 86 |
|
|
| 87 |
|
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 3 |
Complexity Density: 0.75 |
|
| 88 |
0
|
@Override... |
| 89 |
|
public Object getObject(String key) { |
| 90 |
0
|
Object object = super.getObject(key); |
| 91 |
0
|
if (object == null && parentConfig != null) { |
| 92 |
0
|
object = parentConfig.getObject(key); |
| 93 |
|
} |
| 94 |
0
|
return object; |
| 95 |
|
} |
| 96 |
|
|
|
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 3 |
Complexity Density: 0.43 |
|
| 97 |
0
|
@Override... |
| 98 |
|
public Map<String, Object> getObjects() { |
| 99 |
0
|
Map<String, Object> finalObjects = new HashMap<String, Object>(super.getObjects()); |
| 100 |
0
|
if (parentConfig != null) { |
| 101 |
0
|
Map<String, Object> parentObjects = parentConfig.getObjects(); |
| 102 |
0
|
for (String key : parentObjects.keySet()) { |
| 103 |
0
|
if (!finalObjects.containsKey(key)) { |
| 104 |
0
|
finalObjects.put(key, parentObjects.get(key)); |
| 105 |
|
} |
| 106 |
|
} |
| 107 |
|
} |
| 108 |
|
|
| 109 |
0
|
return finalObjects; |
| 110 |
|
} |
| 111 |
|
|
| 112 |
|
|
| 113 |
|
} |