/** {@inheritDoc} */ protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException { AuthenticationStatement authenticationStatement = (AuthenticationStatement) samlElement; if (authenticationStatement.getAuthenticationMethod() != null) { domElement.setAttributeNS(null, AuthenticationStatement.AUTHENTICATIONMETHOD_ATTRIB_NAME, authenticationStatement.getAuthenticationMethod()); } if (authenticationStatement.getAuthenticationInstant() != null) { String value = Configuration.getSAMLDateFormatter().print( authenticationStatement.getAuthenticationInstant()); domElement.setAttributeNS(null, AuthenticationStatement.AUTHENTICATIONINSTANT_ATTRIB_NAME, value); } } }
/** * Validates that the authentication statement has an authentication method. * * @param authenticationStatement the statement to validate * * @throws ValidationException thrown if the statement does not have an authentication method */ protected void validateAuthenticationMethod(AuthenticationStatement authenticationStatement) throws ValidationException { if (DatatypeHelper.isEmpty(authenticationStatement.getAuthenticationMethod())) { throw new ValidationException("No authenticationStatement URI is null"); } }