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