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 javax.xml.namespace.QName;
28
29 import org.opensaml.common.impl.AbstractSAMLObject;
30 import org.opensaml.saml2.core.Advice;
31 import org.opensaml.saml2.core.Assertion;
32 import org.opensaml.saml2.core.AssertionIDRef;
33 import org.opensaml.saml2.core.AssertionURIRef;
34 import org.opensaml.saml2.core.EncryptedAssertion;
35 import org.opensaml.xml.XMLObject;
36 import org.opensaml.xml.util.IndexedXMLObjectChildrenList;
37
38
39
40
41 public class AdviceImpl extends AbstractSAMLObject implements Advice {
42
43
44 private final IndexedXMLObjectChildrenList<XMLObject> indexedChildren;
45
46
47
48
49
50
51
52
53 protected AdviceImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
54 super(namespaceURI, elementLocalName, namespacePrefix);
55 indexedChildren = new IndexedXMLObjectChildrenList<XMLObject>(this);
56 }
57
58
59 public List<XMLObject> getChildren() {
60 return indexedChildren;
61 }
62
63
64 public List<XMLObject> getChildren(QName typeOrName) {
65 return (List<XMLObject>) indexedChildren.subList(typeOrName);
66 }
67
68
69 public List<AssertionIDRef> getAssertionIDReferences() {
70 return (List<AssertionIDRef>) indexedChildren.subList(AssertionIDRef.DEFAULT_ELEMENT_NAME);
71 }
72
73
74 public List<AssertionURIRef> getAssertionURIReferences() {
75 return (List<AssertionURIRef>) indexedChildren.subList(AssertionURIRef.DEFAULT_ELEMENT_NAME);
76 }
77
78
79 public List<Assertion> getAssertions() {
80 return (List<Assertion>) indexedChildren.subList(Assertion.DEFAULT_ELEMENT_NAME);
81 }
82
83
84 public List<EncryptedAssertion> getEncryptedAssertions() {
85 return (List<EncryptedAssertion>) indexedChildren.subList(EncryptedAssertion.DEFAULT_ELEMENT_NAME);
86 }
87
88
89 public List<XMLObject> getOrderedChildren() {
90 ArrayList<XMLObject> children = new ArrayList<XMLObject>();
91
92 children.addAll(indexedChildren);
93
94 return Collections.unmodifiableList(children);
95 }
96 }