1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.opensaml.saml2.core.impl;
22
23 import org.opensaml.Configuration;
24 import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
25 import org.opensaml.saml2.core.Conditions;
26 import org.opensaml.xml.XMLObject;
27 import org.opensaml.xml.io.MarshallingException;
28 import org.w3c.dom.Element;
29
30
31
32
33 public class ConditionsMarshaller extends AbstractSAMLObjectMarshaller {
34
35
36 protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
37 Conditions conditions = (Conditions) samlObject;
38
39 if (conditions.getNotBefore() != null) {
40 String notBeforeStr = Configuration.getSAMLDateFormatter().print(conditions.getNotBefore());
41 domElement.setAttributeNS(null, Conditions.NOT_BEFORE_ATTRIB_NAME, notBeforeStr);
42 }
43
44 if (conditions.getNotOnOrAfter() != null) {
45 String notOnOrAfterStr = Configuration.getSAMLDateFormatter().print(conditions.getNotOnOrAfter());
46 domElement.setAttributeNS(null, Conditions.NOT_ON_OR_AFTER_ATTRIB_NAME, notOnOrAfterStr);
47 }
48 }
49 }