1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.opensaml.saml2.core.impl;
18
19 import java.util.ArrayList;
20 import java.util.Collections;
21 import java.util.List;
22
23 import org.opensaml.common.impl.AbstractSAMLObject;
24 import org.opensaml.saml2.core.EncryptedElementType;
25 import org.opensaml.xml.XMLObject;
26 import org.opensaml.xml.encryption.EncryptedData;
27 import org.opensaml.xml.encryption.EncryptedKey;
28 import org.opensaml.xml.util.XMLObjectChildrenList;
29
30
31
32
33 public class EncryptedElementTypeImpl extends AbstractSAMLObject implements EncryptedElementType {
34
35
36 private EncryptedData encryptedData;
37
38
39 private final XMLObjectChildrenList<EncryptedKey> encryptedKeys;
40
41
42
43
44
45
46
47
48 protected EncryptedElementTypeImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
49 super(namespaceURI, elementLocalName, namespacePrefix);
50 encryptedKeys = new XMLObjectChildrenList<EncryptedKey>(this);
51 }
52
53
54 public EncryptedData getEncryptedData() {
55 return this.encryptedData;
56 }
57
58
59 public void setEncryptedData(EncryptedData newEncryptedData) {
60 this.encryptedData = prepareForAssignment(this.encryptedData, newEncryptedData);
61 }
62
63
64 public List<EncryptedKey> getEncryptedKeys() {
65 return this.encryptedKeys;
66 }
67
68
69 public List<XMLObject> getOrderedChildren() {
70 ArrayList<XMLObject> children = new ArrayList<XMLObject>();
71
72 if (encryptedData != null) {
73 children.add(encryptedData);
74 }
75
76 children.addAll(encryptedKeys);
77
78 if (children.size() == 0) {
79 return null;
80 }
81
82 return Collections.unmodifiableList(children);
83 }
84
85 }