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.saml1.core.AuthenticationStatement;
21 import org.opensaml.xml.XMLObject;
22 import org.opensaml.xml.io.MarshallingException;
23 import org.w3c.dom.Element;
24
25
26
27
28 public class AuthenticationStatementMarshaller extends SubjectStatementMarshaller {
29
30
31 protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException {
32 AuthenticationStatement authenticationStatement = (AuthenticationStatement) samlElement;
33
34 if (authenticationStatement.getAuthenticationMethod() != null) {
35 domElement.setAttributeNS(null, AuthenticationStatement.AUTHENTICATIONMETHOD_ATTRIB_NAME,
36 authenticationStatement.getAuthenticationMethod());
37 }
38
39 if (authenticationStatement.getAuthenticationInstant() != null) {
40 String value = Configuration.getSAMLDateFormatter().print(
41 authenticationStatement.getAuthenticationInstant());
42 domElement.setAttributeNS(null, AuthenticationStatement.AUTHENTICATIONINSTANT_ATTRIB_NAME, value);
43 }
44 }
45 }