View Javadoc
1   /**
2    * Copyright 2010-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
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   * @deprecated
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  }