1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.opensaml.ws.wspolicy.impl;
19
20 import javax.xml.namespace.QName;
21
22 import org.opensaml.ws.wspolicy.Policy;
23 import org.opensaml.xml.XMLObject;
24 import org.opensaml.xml.io.UnmarshallingException;
25 import org.opensaml.xml.util.XMLHelper;
26 import org.w3c.dom.Attr;
27
28
29
30
31
32
33
34 public class PolicyUnmarshaller extends OperatorContentTypeUnmarshaller {
35
36
37 protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
38 Policy policy = (Policy) xmlObject;
39
40 QName nameQName = new QName(Policy.NAME_ATTRIB_NAME);
41
42 QName attribQName =
43 XMLHelper.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(), attribute.getPrefix());
44
45 if (nameQName.equals(attribQName)) {
46 policy.setName(attribute.getValue());
47 } else if (Policy.WSU_ID_ATTR_NAME.equals(attribQName)) {
48 policy.setWSUId(attribute.getValue());
49 attribute.getOwnerElement().setIdAttributeNode(attribute, true);
50 } else {
51 XMLHelper.unmarshallToAttributeMap(policy.getUnknownAttributes(), attribute);
52 }
53 }
54
55 }