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 org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
20 import org.opensaml.saml2.core.EncryptedElementType;
21 import org.opensaml.xml.XMLObject;
22 import org.opensaml.xml.encryption.EncryptedData;
23 import org.opensaml.xml.encryption.EncryptedKey;
24 import org.opensaml.xml.io.UnmarshallingException;
25
26
27
28
29 public class EncryptedElementTypeUnmarshaller extends AbstractSAMLObjectUnmarshaller {
30
31
32 protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
33 throws UnmarshallingException {
34 EncryptedElementType eet = (EncryptedElementType) parentSAMLObject;
35
36 if (childSAMLObject instanceof EncryptedData) {
37 eet.setEncryptedData((EncryptedData) childSAMLObject);
38 } else if (childSAMLObject instanceof EncryptedKey) {
39 eet.getEncryptedKeys().add((EncryptedKey) childSAMLObject);
40 } else {
41 super.processChildElement(parentSAMLObject, childSAMLObject);
42 }
43 }
44
45 }