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 org.opensaml.xml.XMLObject;
20 import org.opensaml.xml.encryption.EncryptionProperties;
21 import org.opensaml.xml.encryption.EncryptionProperty;
22 import org.opensaml.xml.io.UnmarshallingException;
23 import org.w3c.dom.Attr;
24
25
26
27
28 public class EncryptionPropertiesUnmarshaller extends AbstractXMLEncryptionUnmarshaller {
29
30
31 protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
32 EncryptionProperties ep = (EncryptionProperties) xmlObject;
33
34 if (attribute.getLocalName().equals(EncryptionProperties.ID_ATTRIB_NAME)) {
35 ep.setID(attribute.getValue());
36 attribute.getOwnerElement().setIdAttributeNode(attribute, true);
37 } else {
38 super.processAttribute(xmlObject, attribute);
39 }
40 }
41
42
43 protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
44 throws UnmarshallingException {
45 EncryptionProperties ep = (EncryptionProperties) parentXMLObject;
46
47 if (childXMLObject instanceof EncryptionProperty) {
48 ep.getEncryptionProperties().add((EncryptionProperty) childXMLObject);
49 } else {
50 super.processChildElement(parentXMLObject, childXMLObject);
51 }
52 }
53
54 }