1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.common.util.spring;
17
18 import org.kuali.common.util.Assert;
19 import org.kuali.common.util.Project;
20 import org.kuali.common.util.ProjectUtils;
21 import org.springframework.beans.factory.FactoryBean;
22
23 public class ProjectFactoryBean<T> implements FactoryBean<Project> {
24
25 String gav;
26 boolean singleton = true;
27
28 @Override
29 public Project getObject() throws Exception {
30 Assert.hasText(gav);
31 return ProjectUtils.loadProject(gav);
32 }
33
34 @Override
35 public Class<Project> getObjectType() {
36 return Project.class;
37 }
38
39 @Override
40 public boolean isSingleton() {
41 return singleton;
42 }
43
44 public String getGav() {
45 return gav;
46 }
47
48 public void setGav(String gav) {
49 this.gav = gav;
50 }
51
52 public void setSingleton(boolean singleton) {
53 this.singleton = singleton;
54 }
55
56 }