1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.opensaml.xml.encryption.impl;
18
19 import java.util.ArrayList;
20 import java.util.Collections;
21 import java.util.List;
22
23 import org.opensaml.xml.XMLObject;
24 import org.opensaml.xml.encryption.CipherData;
25 import org.opensaml.xml.encryption.CipherReference;
26 import org.opensaml.xml.encryption.CipherValue;
27 import org.opensaml.xml.validation.AbstractValidatingXMLObject;
28
29
30
31
32 public class CipherDataImpl extends AbstractValidatingXMLObject implements CipherData {
33
34
35 private CipherValue cipherValue;
36
37
38 private CipherReference cipherReference;
39
40
41
42
43
44
45
46
47 protected CipherDataImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
48 super(namespaceURI, elementLocalName, namespacePrefix);
49 }
50
51
52 public CipherValue getCipherValue() {
53 return this.cipherValue;
54 }
55
56
57 public void setCipherValue(CipherValue newCipherValue) {
58 this.cipherValue = prepareForAssignment(this.cipherValue, newCipherValue);
59 }
60
61
62 public CipherReference getCipherReference() {
63 return this.cipherReference;
64 }
65
66
67 public void setCipherReference(CipherReference newCipherReference) {
68 this.cipherReference = prepareForAssignment(this.cipherReference, newCipherReference);
69 }
70
71
72 public List<XMLObject> getOrderedChildren() {
73 ArrayList<XMLObject> children = new ArrayList<XMLObject>();
74
75 if (cipherValue != null) {
76 children.add(cipherValue);
77 }
78 if (cipherReference != null) {
79 children.add(cipherReference);
80 }
81
82 if (children.size() == 0) {
83 return null;
84 }
85
86 return Collections.unmodifiableList(children);
87 }
88
89 }