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