1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package edu.internet2.middleware.shibboleth.common.config.attribute.resolver.attributeDefinition;
19
20 import java.util.List;
21
22 import org.apache.velocity.app.VelocityEngine;
23
24 import edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.attributeDefinition.TemplateAttributeDefinition;
25
26
27
28
29 public class TemplateAttributeDefinitionFactoryBean extends BaseAttributeDefinitionFactoryBean {
30
31
32 private String attributeTemplate;
33
34
35 private List<String> sourceAttributes;
36
37
38 private VelocityEngine velocityEngine;
39
40
41 public Class getObjectType() {
42 return TemplateAttributeDefinition.class;
43 }
44
45
46 protected Object createInstance() throws Exception {
47 TemplateAttributeDefinition definition = new TemplateAttributeDefinition(velocityEngine);
48 populateAttributeDefinition(definition);
49
50 definition.setAttributeTemplate(attributeTemplate);
51 definition.setSourceAttributes(sourceAttributes);
52
53 definition.initialize();
54
55 return definition;
56 }
57
58
59
60
61
62
63 public String getAttributeTemplate() {
64 return attributeTemplate;
65 }
66
67
68
69
70
71
72 public void setAttributeTemplate(String newAttributeTemplate) {
73 attributeTemplate = newAttributeTemplate;
74 }
75
76
77
78
79
80
81 public List<String> getSourceAttributes() {
82 return sourceAttributes;
83 }
84
85
86
87
88
89
90 public void setSourceAttributes(List<String> newSourceAttributes) {
91 sourceAttributes = newSourceAttributes;
92 }
93
94
95
96
97
98
99 public VelocityEngine getVelocityEngine() {
100 return velocityEngine;
101 }
102
103
104
105
106
107
108 public void setVelocityEngine(VelocityEngine newVelocityEngine) {
109 velocityEngine = newVelocityEngine;
110 }
111
112 }