1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.opensaml.samlext.saml2delrestrict.impl;
18
19 import org.opensaml.Configuration;
20 import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
21 import org.opensaml.samlext.saml2delrestrict.Delegate;
22 import org.opensaml.xml.XMLObject;
23 import org.opensaml.xml.io.MarshallingException;
24 import org.opensaml.xml.util.DatatypeHelper;
25 import org.w3c.dom.Element;
26
27
28
29
30 public class DelegateMarshaller extends AbstractSAMLObjectMarshaller {
31
32
33 protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
34 Delegate delegate = (Delegate) xmlObject;
35
36 if (delegate.getDelegationInstant() != null) {
37 String delInstant = Configuration.getSAMLDateFormatter().print(delegate.getDelegationInstant());
38 domElement.setAttributeNS(null, Delegate.DELEGATION_INSTANT_ATTRIB_NAME, delInstant);
39 }
40 if (!DatatypeHelper.isEmpty(delegate.getConfirmationMethod())) {
41 domElement.setAttributeNS(null, Delegate.CONFIRMATION_METHOD_ATTRIB_NAME, delegate.getConfirmationMethod());
42 }
43
44 super.marshallAttributes(xmlObject, domElement);
45 }
46
47 }