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