1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package edu.internet2.middleware.shibboleth.common.attribute.encoding.provider;
19
20 import org.opensaml.Configuration;
21 import org.opensaml.common.SAMLObjectBuilder;
22 import org.opensaml.saml1.core.Attribute;
23
24 import edu.internet2.middleware.shibboleth.common.attribute.encoding.SAML1AttributeEncoder;
25
26
27
28
29 public abstract class AbstractSAML1AttributeEncoder extends AbstractAttributeEncoder<Attribute> implements
30 SAML1AttributeEncoder {
31
32
33 protected final SAMLObjectBuilder<Attribute> attributeBuilder;
34
35
36 private String namespace;
37
38
39 protected AbstractSAML1AttributeEncoder() {
40 attributeBuilder = (SAMLObjectBuilder<Attribute>) Configuration.getBuilderFactory().getBuilder(
41 Attribute.DEFAULT_ELEMENT_NAME);
42 }
43
44
45 public String getNamespace() {
46 return namespace;
47 }
48
49
50 public void setNamespace(String newNamespace) {
51 namespace = newNamespace;
52 }
53
54
55
56
57
58
59 protected void populateAttribute(Attribute attribute) {
60 attribute.setAttributeName(getAttributeName());
61 attribute.setAttributeNamespace(getNamespace());
62 }
63 }