View Javadoc

1   /**
2    * Copyright 2010-2013 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.spring.service;
17  
18  import java.util.List;
19  import java.util.Map;
20  
21  import org.kuali.common.util.CollectionUtils;
22  
23  public class SpringContext {
24  
25  	public SpringContext(Map<String, Object> beans, Class<?> annotatedClass) {
26  		this(beans, CollectionUtils.asList(annotatedClass), (String) null);
27  	}
28  
29  	public SpringContext(Map<String, Object> beans, Class<?> annotatedClass, String activeProfile) {
30  		this(beans, CollectionUtils.asList(annotatedClass), null, CollectionUtils.toEmptyList(activeProfile));
31  	}
32  
33  	public SpringContext(Map<String, Object> beans, List<Class<?>> annotatedClasses, String activeProfile) {
34  		this(beans, annotatedClasses, null, CollectionUtils.toEmptyList(activeProfile));
35  	}
36  
37  	public SpringContext(PropertySourceContext propertySourceContext) {
38  		this((Class<?>) null, propertySourceContext);
39  	}
40  
41  	public SpringContext() {
42  		this((Class<?>) null);
43  	}
44  
45  	public SpringContext(Class<?> annotatedClass) {
46  		this(CollectionUtils.asList(annotatedClass));
47  	}
48  
49  	public SpringContext(Class<?> annotatedClass, PropertySourceContext propertySourceContext) {
50  		this(CollectionUtils.asList(annotatedClass), propertySourceContext);
51  	}
52  
53  	public SpringContext(List<Class<?>> annotatedClasses) {
54  		this(annotatedClasses, null);
55  	}
56  
57  	public SpringContext(List<Class<?>> annotatedClasses, PropertySourceContext propertySourceContext) {
58  		this(null, annotatedClasses, propertySourceContext);
59  	}
60  
61  	public SpringContext(Map<String, Object> contextBeans, List<Class<?>> annotatedClasses, PropertySourceContext propertySourceContext) {
62  		this(contextBeans, annotatedClasses, propertySourceContext, null);
63  	}
64  
65  	public SpringContext(Map<String, Object> contextBeans, List<Class<?>> annotatedClasses, PropertySourceContext propertySourceContext, List<String> activeProfiles) {
66  		this.contextBeans = contextBeans;
67  		this.annotatedClasses = annotatedClasses;
68  		this.propertySourceContext = propertySourceContext;
69  		this.activeProfiles = activeProfiles;
70  	}
71  
72  	String id;
73  	String displayName;
74  	List<String> locations;
75  	List<Class<?>> annotatedClasses;
76  	Map<String, Object> contextBeans;
77  	PropertySourceContext propertySourceContext;
78  	List<String> activeProfiles;
79  	List<String> defaultProfiles;
80  
81  	@Deprecated
82  	List<String> beanNames;
83  
84  	@Deprecated
85  	List<Object> beans;
86  
87  	public List<String> getLocations() {
88  		return locations;
89  	}
90  
91  	public void setLocations(List<String> locations) {
92  		this.locations = locations;
93  	}
94  
95  	public List<Class<?>> getAnnotatedClasses() {
96  		return annotatedClasses;
97  	}
98  
99  	public void setAnnotatedClasses(List<Class<?>> annotatedClasses) {
100 		this.annotatedClasses = annotatedClasses;
101 	}
102 
103 	@Deprecated
104 	public List<String> getBeanNames() {
105 		return beanNames;
106 	}
107 
108 	@Deprecated
109 	public void setBeanNames(List<String> beanNames) {
110 		this.beanNames = beanNames;
111 	}
112 
113 	@Deprecated
114 	public List<Object> getBeans() {
115 		return beans;
116 	}
117 
118 	@Deprecated
119 	public void setBeans(List<Object> beans) {
120 		this.beans = beans;
121 	}
122 
123 	public PropertySourceContext getPropertySourceContext() {
124 		return propertySourceContext;
125 	}
126 
127 	public void setPropertySourceContext(PropertySourceContext propertySourceContext) {
128 		this.propertySourceContext = propertySourceContext;
129 	}
130 
131 	public String getId() {
132 		return id;
133 	}
134 
135 	public void setId(String id) {
136 		this.id = id;
137 	}
138 
139 	public String getDisplayName() {
140 		return displayName;
141 	}
142 
143 	public void setDisplayName(String displayName) {
144 		this.displayName = displayName;
145 	}
146 
147 	public List<String> getActiveProfiles() {
148 		return activeProfiles;
149 	}
150 
151 	public void setActiveProfiles(List<String> activeProfiles) {
152 		this.activeProfiles = activeProfiles;
153 	}
154 
155 	public List<String> getDefaultProfiles() {
156 		return defaultProfiles;
157 	}
158 
159 	public void setDefaultProfiles(List<String> defaultProfiles) {
160 		this.defaultProfiles = defaultProfiles;
161 	}
162 
163 	public Map<String, Object> getContextBeans() {
164 		return contextBeans;
165 	}
166 
167 	public void setContextBeans(Map<String, Object> contextBeans) {
168 		this.contextBeans = contextBeans;
169 	}
170 
171 }