1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.opensaml.saml2.core.impl;
22
23 import java.util.ArrayList;
24 import java.util.Collections;
25 import java.util.List;
26
27 import org.opensaml.common.impl.AbstractSAMLObject;
28 import org.opensaml.saml2.core.Attribute;
29 import org.opensaml.saml2.core.AttributeStatement;
30 import org.opensaml.saml2.core.EncryptedAttribute;
31 import org.opensaml.xml.XMLObject;
32 import org.opensaml.xml.util.IndexedXMLObjectChildrenList;
33
34
35
36
37 public class AttributeStatementImpl extends AbstractSAMLObject implements AttributeStatement {
38
39
40 private final IndexedXMLObjectChildrenList<XMLObject> indexedChildren;
41
42
43
44
45
46
47
48
49 protected AttributeStatementImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
50 super(namespaceURI, elementLocalName, namespacePrefix);
51 indexedChildren = new IndexedXMLObjectChildrenList<XMLObject>(this);
52 }
53
54
55 public List<Attribute> getAttributes() {
56 return (List<Attribute>) indexedChildren.subList(Attribute.DEFAULT_ELEMENT_NAME);
57 }
58
59
60
61 public List<EncryptedAttribute> getEncryptedAttributes() {
62 return (List<EncryptedAttribute>) indexedChildren.subList(EncryptedAttribute.DEFAULT_ELEMENT_NAME);
63 }
64
65
66 public List<XMLObject> getOrderedChildren() {
67 ArrayList<XMLObject> children = new ArrayList<XMLObject>();
68
69 children.addAll(indexedChildren);
70
71 return Collections.unmodifiableList(children);
72 }
73 }