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