1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.common.util.config;
17
18 import java.util.ArrayList;
19 import java.util.List;
20
21 import javax.xml.bind.annotation.XmlAccessType;
22 import javax.xml.bind.annotation.XmlAccessorType;
23 import javax.xml.bind.annotation.XmlAttribute;
24 import javax.xml.bind.annotation.XmlElement;
25 import javax.xml.bind.annotation.XmlRootElement;
26
27 import org.kuali.common.util.CollectionUtils;
28
29
30
31
32 @Deprecated
33 @XmlRootElement
34 @XmlAccessorType(XmlAccessType.PROPERTY)
35 public class ContextConfig {
36
37 String id;
38 List<Location> locations = new ArrayList<Location>();
39 List<ContextConfig> contexts = new ArrayList<ContextConfig>();
40
41 public ContextConfig(ContextConfig config) {
42 super();
43 this.id = config.getId();
44 for (Location location : CollectionUtils.toEmptyList(config.getLocations())) {
45 this.locations.add(new Location(location));
46 }
47 for (ContextConfig child : CollectionUtils.toEmptyList(config.getContexts())) {
48 this.contexts.add(new ContextConfig(child));
49 }
50 }
51
52 public ContextConfig() {
53 this((String) null);
54 }
55
56 public ContextConfig(String name) {
57 this(name, null);
58 }
59
60 public ContextConfig(String name, List<Location> locations) {
61 super();
62 this.id = name;
63 this.locations = locations;
64 }
65
66 @XmlAttribute
67 public String getId() {
68 return id;
69 }
70
71 @XmlElement(name = "location")
72 public List<Location> getLocations() {
73 return locations;
74 }
75
76 @XmlElement(name = "context")
77 public List<ContextConfig> getContexts() {
78 return contexts;
79 }
80
81 public void setLocations(List<Location> locations) {
82 this.locations = locations;
83 }
84
85 public void setContexts(List<ContextConfig> children) {
86 this.contexts = children;
87 }
88
89 public void setId(String name) {
90 this.id = name;
91 }
92
93 }