[java-opensaml] branch main updated: IDP-2069 - Null Handling Task
Scott Cantor
cantor.2 at osu.edu
Tue Apr 4 18:29:47 UTC 2023
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-opensaml.
View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=152aeacbc0689ba34f443778afd8ecb7ccab735d
The following commit(s) were added to refs/heads/main by this push:
new 152aeacbc IDP-2069 - Null Handling Task
152aeacbc is described below
commit 152aeacbc0689ba34f443778afd8ecb7ccab735d
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Apr 4 14:29:41 2023 -0400
IDP-2069 - Null Handling Task
https://shibboleth.atlassian.net/browse/IDP-2069
Clean up SAML marshallers.
Fix inconsistent int-valued index on AttributeConsumingService.
---
.../saml2/metadata/AttributeConsumingService.java | 4 +--
.../ext/saml2alg/impl/DigestMethodMarshaller.java | 10 ++++--
.../ext/saml2alg/impl/SigningMethodMarshaller.java | 22 +++++++------
.../ext/saml2aslo/impl/AsynchronousMarshaller.java | 3 +-
.../saml2cb/impl/ChannelBindingsMarshaller.java | 13 ++++++--
.../saml2delrestrict/impl/DelegateMarshaller.java | 21 ++++++++-----
.../impl/DelegationRestrictionTypeMarshaller.java | 3 +-
.../impl/EntityAttributesMarshaller.java | 3 +-
.../AttributeQueryDescriptorTypeMarshaller.java | 4 ++-
.../impl/AuthnQueryDescriptorTypeMarshaller.java | 4 ++-
...AuthzDecisionQueryDescriptorTypeMarshaller.java | 4 ++-
.../impl/QueryDescriptorTypeMarshaller.java | 13 +++++---
.../saml2mdrpi/impl/PublicationInfoMarshaller.java | 26 +++++++++-------
.../ext/saml2mdrpi/impl/PublicationMarshaller.java | 23 +++++++-------
.../saml2mdrpi/impl/PublicationPathMarshaller.java | 6 ++--
.../impl/RegistrationInfoMarshaller.java | 20 +++++++-----
.../ext/saml2mdui/impl/DiscoHintsMarshaller.java | 3 +-
.../ext/saml2mdui/impl/KeywordsMarshaller.java | 29 +++++++++--------
.../saml/ext/saml2mdui/impl/LogoMarshaller.java | 23 ++++++++------
.../saml/ext/saml2mdui/impl/UIInfoMarshaller.java | 3 +-
.../ext/samlec/impl/GeneratedKeyMarshaller.java | 14 ++++++---
.../saml/ext/samlec/impl/SessionKeyMarshaller.java | 15 ++++++---
.../saml/saml1/core/impl/ActionMarshaller.java | 7 +++--
.../saml/saml1/core/impl/AdviceMarshaller.java | 3 +-
.../saml/saml1/core/impl/AssertionMarshaller.java | 20 +++++++-----
.../core/impl/AttributeDesignatorMarshaller.java | 17 +++++-----
.../saml/saml1/core/impl/AttributeMarshaller.java | 4 ++-
.../saml1/core/impl/AttributeQueryMarshaller.java | 10 ++++--
.../core/impl/AttributeStatementMarshaller.java | 4 ++-
.../AudienceRestrictionConditionMarshaller.java | 3 +-
.../core/impl/AuthenticationQueryMarshaller.java | 13 +++++---
.../impl/AuthenticationStatementMarshaller.java | 18 +++++++----
.../core/impl/AuthorityBindingMarshaller.java | 21 ++++++++-----
.../impl/AuthorizationDecisionQueryMarshaller.java | 14 ++++++---
.../AuthorizationDecisionStatementMarshaller.java | 17 ++++++----
.../saml/saml1/core/impl/ConditionsMarshaller.java | 23 ++++++++------
.../core/impl/DoNotCacheConditionMarshaller.java | 3 +-
.../saml/saml1/core/impl/EvidenceMarshaller.java | 3 +-
.../saml1/core/impl/NameIdentifierMarshaller.java | 11 ++++---
.../core/impl/RequestAbstractTypeMarshaller.java | 31 ++++++++++++-------
.../saml/saml1/core/impl/RequestMarshaller.java | 4 ++-
.../core/impl/ResponseAbstractTypeMarshaller.java | 31 ++++++++++++-------
.../saml/saml1/core/impl/ResponseMarshaller.java | 4 ++-
.../saml/saml1/core/impl/StatusCodeMarshaller.java | 9 ++++--
.../saml1/core/impl/StatusDetailMarshaller.java | 3 +-
.../saml/saml1/core/impl/StatusMarshaller.java | 3 +-
.../core/impl/SubjectConfirmationMarshaller.java | 3 +-
.../saml1/core/impl/SubjectLocalityMarshaller.java | 11 +++++--
.../saml/saml1/core/impl/SubjectMarshaller.java | 3 +-
.../saml1/core/impl/SubjectQueryMarshaller.java | 3 +-
.../core/impl/SubjectStatementMarshaller.java | 3 +-
.../saml/saml2/core/impl/ActionMarshaller.java | 7 +++--
.../saml/saml2/core/impl/AdviceMarshaller.java | 3 +-
.../saml2/core/impl/ArtifactResolveMarshaller.java | 4 ++-
.../core/impl/ArtifactResponseMarshaller.java | 4 ++-
.../core/impl/AssertionIDRequestMarshaller.java | 4 ++-
.../saml/saml2/core/impl/AssertionMarshaller.java | 26 ++++++++++------
.../saml/saml2/core/impl/AttributeMarshaller.java | 10 ++++--
.../saml2/core/impl/AttributeQueryMarshaller.java | 4 ++-
.../core/impl/AttributeStatementMarshaller.java | 3 +-
.../core/impl/AudienceRestrictionMarshaller.java | 3 +-
.../saml2/core/impl/AuthnContextMarshaller.java | 3 +-
.../saml/saml2/core/impl/AuthnQueryMarshaller.java | 12 +++++---
.../saml2/core/impl/AuthnRequestMarshaller.java | 36 +++++++++++++---------
.../saml2/core/impl/AuthnStatementMarshaller.java | 22 ++++++++-----
.../core/impl/AuthzDecisionQueryMarshaller.java | 12 +++++---
.../impl/AuthzDecisionStatementMarshaller.java | 17 ++++++----
.../saml/saml2/core/impl/BaseIDMarshaller.java | 11 +++++--
.../saml/saml2/core/impl/ConditionsMarshaller.java | 24 +++++++++------
.../core/impl/EncryptedAssertionMarshaller.java | 4 ++-
.../core/impl/EncryptedAttributeMarshaller.java | 4 ++-
.../core/impl/EncryptedElementTypeMarshaller.java | 3 +-
.../saml2/core/impl/EncryptedIDMarshaller.java | 4 ++-
.../saml/saml2/core/impl/EvidenceMarshaller.java | 3 +-
.../saml/saml2/core/impl/ExtensionsMarshaller.java | 27 ++--------------
.../saml/saml2/core/impl/IDPEntryMarshaller.java | 10 ++++--
.../saml/saml2/core/impl/IDPListMarshaller.java | 3 +-
.../saml2/core/impl/LogoutRequestMarshaller.java | 21 ++++++++-----
.../saml2/core/impl/LogoutResponseMarshaller.java | 4 ++-
.../core/impl/ManageNameIDRequestMarshaller.java | 4 ++-
.../core/impl/ManageNameIDResponseMarshaller.java | 4 ++-
.../core/impl/NameIDMappingRequestMarshaller.java | 4 ++-
.../core/impl/NameIDMappingResponseMarshaller.java | 4 ++-
.../saml2/core/impl/NameIDPolicyMarshaller.java | 17 ++++++----
.../saml/saml2/core/impl/NameIDTypeMarshaller.java | 13 +++++---
.../saml2/core/impl/NewEncryptedIDMarshaller.java | 4 ++-
.../saml/saml2/core/impl/OneTimeUseMarshaller.java | 3 +-
.../core/impl/ProxyRestrictionMarshaller.java | 17 ++++++----
.../core/impl/RequestAbstractTypeMarshaller.java | 28 +++++++++--------
.../core/impl/RequestedAuthnContextMarshaller.java | 16 ++++++----
.../saml/saml2/core/impl/ResponseMarshaller.java | 4 ++-
.../saml/saml2/core/impl/ScopingMarshaller.java | 15 ++++++---
.../saml/saml2/core/impl/StatusCodeMarshaller.java | 9 ++++--
.../saml2/core/impl/StatusDetailMarshaller.java | 3 +-
.../saml/saml2/core/impl/StatusMarshaller.java | 3 +-
.../core/impl/StatusResponseTypeMarshaller.java | 28 +++++++++--------
.../impl/SubjectConfirmationDataMarshaller.java | 22 ++++++++-----
.../core/impl/SubjectConfirmationMarshaller.java | 9 ++++--
.../saml2/core/impl/SubjectLocalityMarshaller.java | 9 ++++--
.../core/impl/SubjectLocalityUnmarshaller.java | 2 +-
.../saml/saml2/core/impl/SubjectMarshaller.java | 3 +-
.../saml2/core/impl/SubjectQueryMarshaller.java | 4 ++-
.../saml/saml2/core/impl/TerminateMarshaller.java | 3 +-
.../saml/saml2/ecp/impl/RelayStateMarshaller.java | 14 ++++++---
.../ecp/impl/RequestAuthenticatedMarshaller.java | 12 ++++++--
.../saml/saml2/ecp/impl/RequestMarshaller.java | 25 ++++++++++-----
.../saml/saml2/ecp/impl/ResponseMarshaller.java | 19 ++++++++----
.../ecp/impl/SubjectConfirmationMarshaller.java | 16 +++++++---
.../impl/AdditionalMetadataLocationMarshaller.java | 10 ++++--
.../impl/AffiliationDescriptorMarshaller.java | 25 +++++++++------
.../AttributeAuthorityDescriptorMarshaller.java | 4 ++-
.../impl/AttributeConsumingServiceImpl.java | 13 ++++----
.../impl/AttributeConsumingServiceMarshaller.java | 27 ++++++++--------
.../impl/AuthnAuthorityDescriptorMarshaller.java | 4 ++-
.../metadata/impl/ContactPersonMarshaller.java | 15 ++++++---
.../saml2/metadata/impl/EndpointMarshaller.java | 18 ++++++-----
.../impl/EntitiesDescriptorMarshaller.java | 29 ++++++++++-------
.../metadata/impl/EntityDescriptorMarshaller.java | 25 +++++++++------
.../saml2/metadata/impl/ExtensionsMarshaller.java | 27 ++--------------
.../metadata/impl/IDPSSODescriptorMarshaller.java | 19 +++++++-----
.../metadata/impl/IndexedEndpointMarshaller.java | 28 +++++++++++------
.../metadata/impl/KeyDescriptorMarshaller.java | 12 +++++---
.../metadata/impl/LocalizedNameMarshaller.java | 11 +++++--
.../metadata/impl/LocalizedURIMarshaller.java | 11 +++++--
.../metadata/impl/OrganizationMarshaller.java | 9 ++++--
.../metadata/impl/PDPDescriptorMarshaller.java | 4 ++-
.../impl/RequestedAttributeMarshaller.java | 19 +++++++-----
.../metadata/impl/RoleDescriptorMarshaller.java | 28 ++++++++++-------
.../metadata/impl/SPSSODescriptorMarshaller.java | 25 +++++++++------
.../metadata/impl/SSODescriptorMarshaller.java | 4 ++-
.../metadata/impl/SPSSODescriptorChildElements.xml | 2 +-
131 files changed, 962 insertions(+), 574 deletions(-)
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/metadata/AttributeConsumingService.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/metadata/AttributeConsumingService.java
index 5881684a3..d0116c1bb 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/metadata/AttributeConsumingService.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/metadata/AttributeConsumingService.java
@@ -60,14 +60,14 @@ public interface AttributeConsumingService extends SAMLObject {
*
* @return the index for this service
*/
- int getIndex();
+ @Nullable Integer getIndex();
/**
* Sets the index for this service.
*
* @param index the index for this service
*/
- void setIndex(int index);
+ void setIndex(@Nullable final Integer index);
/**
* Checks if this is the default service for the service provider.
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2alg/impl/DigestMethodMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2alg/impl/DigestMethodMarshaller.java
index 896fd2bd9..684071141 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2alg/impl/DigestMethodMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2alg/impl/DigestMethodMarshaller.java
@@ -17,6 +17,8 @@
package org.opensaml.saml.ext.saml2alg.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -24,12 +26,14 @@ import org.opensaml.saml.ext.saml2alg.DigestMethod;
import org.w3c.dom.Element;
/**
- * DigestMethod marshaller.
+ * Marshaller for {@link DigestMethod}.
*/
public class DigestMethodMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject xmlObject, final Element domElement) throws MarshallingException {
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
+ throws MarshallingException {
final DigestMethod digestMethod = (DigestMethod) xmlObject;
if (digestMethod.getAlgorithm() != null) {
@@ -37,4 +41,4 @@ public class DigestMethodMarshaller extends AbstractSAMLObjectMarshaller {
}
}
-}
+}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2alg/impl/SigningMethodMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2alg/impl/SigningMethodMarshaller.java
index 6477ba870..a4754c433 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2alg/impl/SigningMethodMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2alg/impl/SigningMethodMarshaller.java
@@ -17,6 +17,8 @@
package org.opensaml.saml.ext.saml2alg.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -24,27 +26,29 @@ import org.opensaml.saml.ext.saml2alg.SigningMethod;
import org.w3c.dom.Element;
/**
- * SigningMethod marshaller.
+ * Marshaller for {@link SigningMethod}.
*/
public class SigningMethodMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject xmlObject, final Element domElement) throws MarshallingException {
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
+ throws MarshallingException {
final SigningMethod signingMethod = (SigningMethod) xmlObject;
if (signingMethod.getAlgorithm() != null) {
domElement.setAttributeNS(null, SigningMethod.ALGORITHM_ATTRIB_NAME, signingMethod.getAlgorithm());
}
- if (signingMethod.getMinKeySize() != null) {
- domElement.setAttributeNS(null, SigningMethod.MIN_KEY_SIZE_ATTRIB_NAME,
- signingMethod.getMinKeySize().toString());
+ Integer size = signingMethod.getMinKeySize();
+ if (size != null) {
+ domElement.setAttributeNS(null, SigningMethod.MIN_KEY_SIZE_ATTRIB_NAME, size.toString());
}
- if (signingMethod.getMaxKeySize() != null) {
- domElement.setAttributeNS(null, SigningMethod.MAX_KEY_SIZE_ATTRIB_NAME,
- signingMethod.getMaxKeySize().toString());
+ size = signingMethod.getMaxKeySize();
+ if (size != null) {
+ domElement.setAttributeNS(null, SigningMethod.MAX_KEY_SIZE_ATTRIB_NAME, size.toString());
}
}
-}
+}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2aslo/impl/AsynchronousMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2aslo/impl/AsynchronousMarshaller.java
index 6e169f257..3f89951c0 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2aslo/impl/AsynchronousMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2aslo/impl/AsynchronousMarshaller.java
@@ -22,10 +22,11 @@
package org.opensaml.saml.ext.saml2aslo.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.ext.saml2aslo.Asynchronous;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.ext.saml2aslo.Asynchronous} objects.
+ * A thread safe Marshaller for {@link Asynchronous} objects.
*/
public class AsynchronousMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2cb/impl/ChannelBindingsMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2cb/impl/ChannelBindingsMarshaller.java
index ca9ada4e3..4b5b07e69 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2cb/impl/ChannelBindingsMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2cb/impl/ChannelBindingsMarshaller.java
@@ -18,8 +18,12 @@
package org.opensaml.saml.ext.saml2cb.impl;
import org.opensaml.saml.ext.saml2cb.ChannelBindings;
+
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
+import org.opensaml.core.xml.schema.XSBooleanValue;
import org.opensaml.core.xml.schema.impl.XSBase64BinaryMarshaller;
import org.opensaml.core.xml.util.XMLObjectSupport;
import org.w3c.dom.Element;
@@ -30,16 +34,19 @@ import org.w3c.dom.Element;
public class ChannelBindingsMarshaller extends XSBase64BinaryMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject xmlObject, final Element domElement) throws MarshallingException {
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
+ throws MarshallingException {
final ChannelBindings cb = (ChannelBindings) xmlObject;
if (cb.getType() != null) {
domElement.setAttributeNS(null, ChannelBindings.TYPE_ATTRIB_NAME, cb.getType());
}
- if (cb.isSOAP11MustUnderstandXSBoolean() != null) {
+ final XSBooleanValue mustUnderstand = cb.isSOAP11MustUnderstandXSBoolean();
+ if (mustUnderstand != null) {
XMLObjectSupport.marshallAttribute(ChannelBindings.SOAP11_MUST_UNDERSTAND_ATTR_NAME,
- cb.isSOAP11MustUnderstandXSBoolean().toString(), domElement, false);
+ mustUnderstand.toString(), domElement, false);
}
if (cb.getSOAP11Actor() != null) {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2delrestrict/impl/DelegateMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2delrestrict/impl/DelegateMarshaller.java
index fca6444e4..505fdc6e2 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2delrestrict/impl/DelegateMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2delrestrict/impl/DelegateMarshaller.java
@@ -17,14 +17,16 @@
package org.opensaml.saml.ext.saml2delrestrict.impl;
+import java.time.Instant;
+
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
import org.opensaml.saml.ext.saml2delrestrict.Delegate;
import org.w3c.dom.Element;
-import com.google.common.base.Strings;
-
import net.shibboleth.shared.xml.AttributeSupport;
/**
@@ -33,18 +35,21 @@ import net.shibboleth.shared.xml.AttributeSupport;
public class DelegateMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject xmlObject, final Element domElement) throws MarshallingException {
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
+ throws MarshallingException {
final Delegate delegate = (Delegate) xmlObject;
- if (delegate.getDelegationInstant() != null) {
- AttributeSupport.appendDateTimeAttribute(domElement,
- Delegate.DELEGATION_INSTANT_ATTRIB_QNAME, delegate.getDelegationInstant());
+ final Instant i = delegate.getDelegationInstant();
+ if (i != null) {
+ AttributeSupport.appendDateTimeAttribute(domElement, Delegate.DELEGATION_INSTANT_ATTRIB_QNAME, i);
}
- if (!Strings.isNullOrEmpty(delegate.getConfirmationMethod())) {
+
+ if (delegate.getConfirmationMethod() != null) {
domElement.setAttributeNS(null, Delegate.CONFIRMATION_METHOD_ATTRIB_NAME, delegate.getConfirmationMethod());
}
super.marshallAttributes(xmlObject, domElement);
}
-}
+}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2delrestrict/impl/DelegationRestrictionTypeMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2delrestrict/impl/DelegationRestrictionTypeMarshaller.java
index 2e025a529..c4de8828e 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2delrestrict/impl/DelegationRestrictionTypeMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2delrestrict/impl/DelegationRestrictionTypeMarshaller.java
@@ -18,9 +18,10 @@
package org.opensaml.saml.ext.saml2delrestrict.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.ext.saml2delrestrict.DelegationRestrictionType;
/**
- * Marshaller for instances of {@link org.opensaml.saml.ext.saml2delrestrict.DelegationRestrictionType}.
+ * Marshaller for instances of {@link DelegationRestrictionType}.
*/
public class DelegationRestrictionTypeMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdattr/impl/EntityAttributesMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdattr/impl/EntityAttributesMarshaller.java
index cd44ff170..069588468 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdattr/impl/EntityAttributesMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdattr/impl/EntityAttributesMarshaller.java
@@ -18,8 +18,9 @@
package org.opensaml.saml.ext.saml2mdattr.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.ext.saml2mdattr.EntityAttributes;
-/** A thread-safe Marshaller for {@link org.opensaml.saml.ext.saml2mdattr.EntityAttributes}. */
+/** A thread-safe Marshaller for {@link EntityAttributes}. */
public class EntityAttributesMarshaller extends AbstractSAMLObjectMarshaller {
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdquery/impl/AttributeQueryDescriptorTypeMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdquery/impl/AttributeQueryDescriptorTypeMarshaller.java
index 1ea167e4d..bac6dbceb 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdquery/impl/AttributeQueryDescriptorTypeMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdquery/impl/AttributeQueryDescriptorTypeMarshaller.java
@@ -17,8 +17,10 @@
package org.opensaml.saml.ext.saml2mdquery.impl;
+import org.opensaml.saml.ext.saml2mdquery.AttributeQueryDescriptorType;
+
/**
- * Marshaller for {@link org.opensaml.saml.ext.saml2mdquery.AttributeQueryDescriptorType} objects.
+ * Marshaller for {@link AttributeQueryDescriptorType} objects.
*/
public class AttributeQueryDescriptorTypeMarshaller extends QueryDescriptorTypeMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdquery/impl/AuthnQueryDescriptorTypeMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdquery/impl/AuthnQueryDescriptorTypeMarshaller.java
index e7da0628d..f07d1d23c 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdquery/impl/AuthnQueryDescriptorTypeMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdquery/impl/AuthnQueryDescriptorTypeMarshaller.java
@@ -17,8 +17,10 @@
package org.opensaml.saml.ext.saml2mdquery.impl;
+import org.opensaml.saml.ext.saml2mdquery.AuthnQueryDescriptorType;
+
/**
- * Marshaller for {@link org.opensaml.saml.ext.saml2mdquery.AuthnQueryDescriptorType} objects.
+ * Marshaller for {@link AuthnQueryDescriptorType} objects.
*/
public class AuthnQueryDescriptorTypeMarshaller extends QueryDescriptorTypeMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdquery/impl/AuthzDecisionQueryDescriptorTypeMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdquery/impl/AuthzDecisionQueryDescriptorTypeMarshaller.java
index d719a6a87..35c270605 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdquery/impl/AuthzDecisionQueryDescriptorTypeMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdquery/impl/AuthzDecisionQueryDescriptorTypeMarshaller.java
@@ -17,8 +17,10 @@
package org.opensaml.saml.ext.saml2mdquery.impl;
+import org.opensaml.saml.ext.saml2mdquery.AuthzDecisionQueryDescriptorType;
+
/**
- * Marshaller of {@link org.opensaml.saml.ext.saml2mdquery.AuthzDecisionQueryDescriptorType} objects.
+ * Marshaller of {@link AuthzDecisionQueryDescriptorType} objects.
*/
public class AuthzDecisionQueryDescriptorTypeMarshaller extends QueryDescriptorTypeMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdquery/impl/QueryDescriptorTypeMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdquery/impl/QueryDescriptorTypeMarshaller.java
index c5c052d74..c8c1adfee 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdquery/impl/QueryDescriptorTypeMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdquery/impl/QueryDescriptorTypeMarshaller.java
@@ -17,8 +17,11 @@
package org.opensaml.saml.ext.saml2mdquery.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
+import org.opensaml.core.xml.schema.XSBooleanValue;
import org.opensaml.saml.ext.saml2mdquery.QueryDescriptorType;
import org.opensaml.saml.saml2.metadata.impl.RoleDescriptorMarshaller;
import org.w3c.dom.Element;
@@ -30,14 +33,16 @@ public abstract class QueryDescriptorTypeMarshaller extends RoleDescriptorMarsha
/** {@inheritDoc} */
@Override
- protected void marshallAttributes(final XMLObject xmlObject, final Element domElement) throws MarshallingException {
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
+ throws MarshallingException {
final QueryDescriptorType descriptor = (QueryDescriptorType) xmlObject;
- if (descriptor.getWantAssertionsSignedXSBoolean() != null) {
- domElement.setAttributeNS(null, QueryDescriptorType.WANT_ASSERTIONS_SIGNED_ATTRIB_NAME, descriptor
- .getWantAssertionsSignedXSBoolean().toString());
+ final XSBooleanValue flag = descriptor.getWantAssertionsSignedXSBoolean();
+ if (flag != null) {
+ domElement.setAttributeNS(null, QueryDescriptorType.WANT_ASSERTIONS_SIGNED_ATTRIB_NAME, flag.toString());
}
super.marshallAttributes(xmlObject, domElement);
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationInfoMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationInfoMarshaller.java
index f02afc23b..e4a1bb714 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationInfoMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationInfoMarshaller.java
@@ -17,6 +17,10 @@
package org.opensaml.saml.ext.saml2mdrpi.impl;
+import java.time.Instant;
+
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -30,25 +34,25 @@ import net.shibboleth.shared.xml.AttributeSupport;
* A marshaller for {@link PublicationInfo}.
*/
public class PublicationInfoMarshaller extends AbstractSAMLObjectMarshaller {
+
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final PublicationInfo info = (PublicationInfo) samlObject;
+ final PublicationInfo info = (PublicationInfo) xmlObject;
if (info.getPublisher() != null) {
- domElement.setAttributeNS(null, PublicationInfo.PUBLISHER_ATTRIB_NAME,
- info.getPublisher());
+ domElement.setAttributeNS(null, PublicationInfo.PUBLISHER_ATTRIB_NAME, info.getPublisher());
}
if (info.getPublicationId() != null) {
- domElement.setAttributeNS(null, PublicationInfo.PUBLICATION_ID_ATTRIB_NAME,
- info.getPublicationId());
+ domElement.setAttributeNS(null, PublicationInfo.PUBLICATION_ID_ATTRIB_NAME, info.getPublicationId());
}
-
- if (info.getCreationInstant() != null) {
- AttributeSupport.appendDateTimeAttribute(domElement, PublicationInfo.CREATION_INSTANT_ATTRIB_QNAME,
- info.getCreationInstant());
+ final Instant i = info.getCreationInstant();
+ if (i != null) {
+ AttributeSupport.appendDateTimeAttribute(domElement, PublicationInfo.CREATION_INSTANT_ATTRIB_QNAME, i);
}
}
-}
+
+}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationMarshaller.java
index 15e83cb57..5c5a8731f 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationMarshaller.java
@@ -17,6 +17,10 @@
package org.opensaml.saml.ext.saml2mdrpi.impl;
+import java.time.Instant;
+
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -26,30 +30,27 @@ import org.w3c.dom.Element;
import net.shibboleth.shared.xml.AttributeSupport;
-
/**
* A marshaller for {@link Publication}.
*/
public class PublicationMarshaller extends AbstractSAMLObjectMarshaller {
+
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final Publication info = (Publication) samlObject;
+ final Publication info = (Publication) xmlObject;
if (info.getPublisher() != null) {
- domElement.setAttributeNS(null, Publication.PUBLISHER_ATTRIB_NAME,
- info.getPublisher());
+ domElement.setAttributeNS(null, Publication.PUBLISHER_ATTRIB_NAME, info.getPublisher());
}
if (info.getPublicationId() != null) {
- domElement.setAttributeNS(null, Publication.PUBLICATION_ID_ATTRIB_NAME,
- info.getPublicationId());
+ domElement.setAttributeNS(null, Publication.PUBLICATION_ID_ATTRIB_NAME, info.getPublicationId());
}
-
- if (info.getCreationInstant() != null) {
- AttributeSupport.appendDateTimeAttribute(domElement, PublicationInfo.CREATION_INSTANT_ATTRIB_QNAME,
- info.getCreationInstant());
+ final Instant i = info.getCreationInstant();
+ if (i != null) {
+ AttributeSupport.appendDateTimeAttribute(domElement, PublicationInfo.CREATION_INSTANT_ATTRIB_QNAME, i);
}
}
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationPathMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationPathMarshaller.java
index 8742af9a4..44a7a6b42 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationPathMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationPathMarshaller.java
@@ -18,9 +18,11 @@
package org.opensaml.saml.ext.saml2mdrpi.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.ext.saml2mdrpi.PublicationPath;
/**
- * A marshaller for {@link org.opensaml.saml.ext.saml2mdrpi.PublicationPath}.
+ * A marshaller for {@link PublicationPath}.
*/
public class PublicationPathMarshaller extends AbstractSAMLObjectMarshaller {
-}
+
+}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/RegistrationInfoMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/RegistrationInfoMarshaller.java
index f367064d9..9490559f7 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/RegistrationInfoMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/RegistrationInfoMarshaller.java
@@ -17,6 +17,10 @@
package org.opensaml.saml.ext.saml2mdrpi.impl;
+import java.time.Instant;
+
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -25,24 +29,26 @@ import org.w3c.dom.Element;
import net.shibboleth.shared.xml.AttributeSupport;
-
/**
* A marshaller for {@link RegistrationInfo}.
*/
public class RegistrationInfoMarshaller extends AbstractSAMLObjectMarshaller {
+
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final RegistrationInfo info = (RegistrationInfo) samlObject;
+ final RegistrationInfo info = (RegistrationInfo) xmlObject;
if (info.getRegistrationAuthority() != null) {
domElement.setAttributeNS(null, RegistrationInfo.REGISTRATION_AUTHORITY_ATTRIB_NAME,
info.getRegistrationAuthority());
}
- if (info.getRegistrationInstant() != null) {
- AttributeSupport.appendDateTimeAttribute(domElement, RegistrationInfo.REGISTRATION_INSTANT_ATTRIB_QNAME,
- info.getRegistrationInstant());
+ final Instant i = info.getRegistrationInstant();
+ if (i != null) {
+ AttributeSupport.appendDateTimeAttribute(domElement, RegistrationInfo.REGISTRATION_INSTANT_ATTRIB_QNAME, i);
}
}
-}
+
+}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdui/impl/DiscoHintsMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdui/impl/DiscoHintsMarshaller.java
index df0004f7c..d6748159a 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdui/impl/DiscoHintsMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdui/impl/DiscoHintsMarshaller.java
@@ -18,9 +18,10 @@
package org.opensaml.saml.ext.saml2mdui.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.ext.saml2mdui.DiscoHints;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.ext.saml2mdui.DiscoHints} objects.
+ * A thread safe Marshaller for {@link DiscoHints} objects.
*/
public class DiscoHintsMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdui/impl/KeywordsMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdui/impl/KeywordsMarshaller.java
index 26bb47cc4..88620e70a 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdui/impl/KeywordsMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdui/impl/KeywordsMarshaller.java
@@ -21,6 +21,10 @@ import net.shibboleth.shared.xml.AttributeSupport;
import net.shibboleth.shared.xml.ElementSupport;
import net.shibboleth.shared.xml.XMLConstants;
+import java.util.List;
+
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.LangBearing;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
@@ -30,38 +34,39 @@ import org.w3c.dom.Attr;
import org.w3c.dom.Element;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.ext.saml2mdui.Keywords} objects.
+ * A thread safe Marshaller for {@link Keywords} objects.
*/
public class KeywordsMarshaller extends AbstractSAMLObjectMarshaller {
- /**
- * {@inheritDoc}
- */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ /** {@inheritDoc} */
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final Keywords words = (Keywords) samlObject;
+ final Keywords words = (Keywords) xmlObject;
if (words.getXMLLang() != null) {
final Attr attribute = AttributeSupport.constructAttribute(domElement.getOwnerDocument(),
- XMLConstants.XML_NS,
- LangBearing.XML_LANG_ATTR_LOCAL_NAME, XMLConstants.XML_PREFIX);
+ XMLConstants.XML_NS, LangBearing.XML_LANG_ATTR_LOCAL_NAME, XMLConstants.XML_PREFIX);
attribute.setValue(words.getXMLLang());
domElement.setAttributeNodeNS(attribute);
}
}
/** {@inheritDoc} */
- protected void marshallElementContent(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallElementContent(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final Keywords words = (Keywords) samlObject;
+ final Keywords words = (Keywords) xmlObject;
- if (words.getKeywords() != null) {
+ final List<String> keywords = words.getKeywords();
+ if (keywords != null && !keywords.isEmpty()) {
final StringBuilder sb = new StringBuilder();
- for (final String s : words.getKeywords()) {
+ for (final String s : keywords) {
sb.append(s);
sb.append(' ');
}
ElementSupport.appendTextContent(domElement, sb.toString());
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdui/impl/LogoMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdui/impl/LogoMarshaller.java
index d59ddd56f..dd3304290 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdui/impl/LogoMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdui/impl/LogoMarshaller.java
@@ -17,6 +17,8 @@
package org.opensaml.saml.ext.saml2mdui.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.ext.saml2mdui.Logo;
@@ -28,21 +30,22 @@ import org.w3c.dom.Element;
*/
public class LogoMarshaller extends LocalizedURIMarshaller {
- /**
- * {@inheritDoc}
- */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ /** {@inheritDoc} */
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- super.marshallAttributes(samlObject, domElement);
+ super.marshallAttributes(xmlObject, domElement);
- final Logo logo = (Logo) samlObject;
+ final Logo logo = (Logo) xmlObject;
- if (logo.getHeight() != null) {
- domElement.setAttributeNS(null, Logo.HEIGHT_ATTR_NAME, logo.getHeight().toString());
+ Integer size = logo.getHeight();
+ if (size != null) {
+ domElement.setAttributeNS(null, Logo.HEIGHT_ATTR_NAME, size.toString());
}
- if (logo.getWidth() != null) {
- domElement.setAttributeNS(null, Logo.WIDTH_ATTR_NAME, logo.getWidth().toString());
+ size = logo.getWidth();
+ if (size != null) {
+ domElement.setAttributeNS(null, Logo.WIDTH_ATTR_NAME, size.toString());
}
}
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdui/impl/UIInfoMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdui/impl/UIInfoMarshaller.java
index 8b1d0c118..20bb448cf 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdui/impl/UIInfoMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdui/impl/UIInfoMarshaller.java
@@ -18,9 +18,10 @@
package org.opensaml.saml.ext.saml2mdui.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.ext.saml2mdui.UIInfo;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.ext.saml2mdui.UIInfo} objects.
+ * A thread safe Marshaller for {@link UIInfo} objects.
*/
public class UIInfoMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/samlec/impl/GeneratedKeyMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/samlec/impl/GeneratedKeyMarshaller.java
index 0f774e1fd..6c417298d 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/samlec/impl/GeneratedKeyMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/samlec/impl/GeneratedKeyMarshaller.java
@@ -21,8 +21,11 @@
package org.opensaml.saml.ext.samlec.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
+import org.opensaml.core.xml.schema.XSBooleanValue;
import org.opensaml.core.xml.schema.impl.XSBase64BinaryMarshaller;
import org.opensaml.core.xml.util.XMLObjectSupport;
import org.opensaml.saml.ext.samlec.GeneratedKey;
@@ -34,13 +37,15 @@ import org.w3c.dom.Element;
public class GeneratedKeyMarshaller extends XSBase64BinaryMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final GeneratedKey key = (GeneratedKey) samlObject;
+ final GeneratedKey key = (GeneratedKey) xmlObject;
- if (key.isSOAP11MustUnderstandXSBoolean() != null) {
+ final XSBooleanValue mustUnderstand = key.isSOAP11MustUnderstandXSBoolean();
+ if (mustUnderstand != null) {
XMLObjectSupport.marshallAttribute(GeneratedKey.SOAP11_MUST_UNDERSTAND_ATTR_NAME,
- key.isSOAP11MustUnderstandXSBoolean().toString(), domElement, false);
+ mustUnderstand.toString(), domElement, false);
}
if (key.getSOAP11Actor() != null) {
@@ -48,4 +53,5 @@ public class GeneratedKeyMarshaller extends XSBase64BinaryMarshaller {
key.getSOAP11Actor(), domElement, false);
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/samlec/impl/SessionKeyMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/samlec/impl/SessionKeyMarshaller.java
index e456fb31d..736102de8 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/samlec/impl/SessionKeyMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/samlec/impl/SessionKeyMarshaller.java
@@ -21,27 +21,31 @@
package org.opensaml.saml.ext.samlec.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
+import org.opensaml.core.xml.schema.XSBooleanValue;
import org.opensaml.core.xml.util.XMLObjectSupport;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
import org.opensaml.saml.ext.samlec.SessionKey;
import org.w3c.dom.Element;
-
/**
* A thread-safe Marshaller for {@link SessionKey} objects.
*/
public class SessionKeyMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final SessionKey key = (SessionKey) samlObject;
+ final SessionKey key = (SessionKey) xmlObject;
- if (key.isSOAP11MustUnderstandXSBoolean() != null) {
+ final XSBooleanValue mustUnderstand = key.isSOAP11MustUnderstandXSBoolean();
+ if (mustUnderstand != null) {
XMLObjectSupport.marshallAttribute(SessionKey.SOAP11_MUST_UNDERSTAND_ATTR_NAME,
- key.isSOAP11MustUnderstandXSBoolean().toString(), domElement, false);
+ mustUnderstand.toString(), domElement, false);
}
if (key.getSOAP11Actor() != null) {
@@ -53,4 +57,5 @@ public class SessionKeyMarshaller extends AbstractSAMLObjectMarshaller {
domElement.setAttributeNS(null, SessionKey.ALGORITHM_ATTRIB_NAME, key.getAlgorithm());
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ActionMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ActionMarshaller.java
index 29745a743..0c874202b 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ActionMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ActionMarshaller.java
@@ -17,6 +17,8 @@
package org.opensaml.saml.saml1.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.core.xml.schema.impl.XSStringMarshaller;
@@ -29,13 +31,14 @@ import org.w3c.dom.Element;
public class ActionMarshaller extends XSStringMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlElement, final Element domElement)
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final Action action = (Action) samlElement;
+ final Action action = (Action) xmlObject;
if (action.getNamespace() != null) {
domElement.setAttributeNS(null, Action.NAMESPACE_ATTRIB_NAME, action.getNamespace());
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AdviceMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AdviceMarshaller.java
index c5d75f374..51ecdefa1 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AdviceMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AdviceMarshaller.java
@@ -18,9 +18,10 @@
package org.opensaml.saml.saml1.core.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.saml1.core.Advice;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.Advice} objects.
+ * A thread safe Marshaller for {@link Advice} objects.
*/
public class AdviceMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AssertionMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AssertionMarshaller.java
index 227110e58..e8f97a160 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AssertionMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AssertionMarshaller.java
@@ -17,6 +17,10 @@
package org.opensaml.saml.saml1.core.impl;
+import java.time.Instant;
+
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.core.xml.util.XMLObjectSupport;
@@ -27,15 +31,16 @@ import org.w3c.dom.Element;
import net.shibboleth.shared.xml.AttributeSupport;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.Assertion} objects.
+ * A thread safe Marshaller for {@link Assertion} objects.
*/
public class AssertionMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlElement, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final Assertion assertion = (Assertion) samlElement;
+ final Assertion assertion = (Assertion) xmlObject;
if (assertion.getID() != null) {
domElement.setAttributeNS(null, Assertion.ID_ATTRIB_NAME, assertion.getID());
@@ -45,9 +50,9 @@ public class AssertionMarshaller extends AbstractSAMLObjectMarshaller {
domElement.setAttributeNS(null, Assertion.ISSUER_ATTRIB_NAME, assertion.getIssuer());
}
- if (assertion.getIssueInstant() != null) {
- AttributeSupport.appendDateTimeAttribute(domElement, Assertion.ISSUEINSTANT_ATTRIB_QNAME,
- assertion.getIssueInstant());
+ final Instant i = assertion.getIssueInstant();
+ if (i != null) {
+ AttributeSupport.appendDateTimeAttribute(domElement, Assertion.ISSUEINSTANT_ATTRIB_QNAME, i);
}
domElement.setAttributeNS(null, Assertion.MAJORVERSION_ATTRIB_NAME, "1");
@@ -59,7 +64,8 @@ public class AssertionMarshaller extends AbstractSAMLObjectMarshaller {
}
/** {@inheritDoc} */
- protected void marshallAttributeIDness(final XMLObject xmlObject, final Element domElement)
+ @Override
+ protected void marshallAttributeIDness(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
if (((Assertion)xmlObject).getMinorVersion() != 0) {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AttributeDesignatorMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AttributeDesignatorMarshaller.java
index 739589c70..36ad6cafe 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AttributeDesignatorMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AttributeDesignatorMarshaller.java
@@ -17,6 +17,8 @@
package org.opensaml.saml.saml1.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -27,19 +29,20 @@ import org.w3c.dom.Element;
public class AttributeDesignatorMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlElement, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final AttributeDesignator designator = (AttributeDesignator) samlElement;
+ final AttributeDesignator designator = (AttributeDesignator) xmlObject;
if (designator.getAttributeName() != null) {
- domElement.setAttributeNS(null, AttributeDesignator.ATTRIBUTENAME_ATTRIB_NAME, designator
- .getAttributeName());
+ domElement.setAttributeNS(null, AttributeDesignator.ATTRIBUTENAME_ATTRIB_NAME,
+ designator.getAttributeName());
}
if (designator.getAttributeNamespace() != null) {
- domElement.setAttributeNS(null, AttributeDesignator.ATTRIBUTENAMESPACE_ATTRIB_NAME, designator
- .getAttributeNamespace());
+ domElement.setAttributeNS(null, AttributeDesignator.ATTRIBUTENAMESPACE_ATTRIB_NAME,
+ designator.getAttributeNamespace());
}
}
-}
+}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AttributeMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AttributeMarshaller.java
index 5aecb80c4..5cc70b491 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AttributeMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AttributeMarshaller.java
@@ -17,8 +17,10 @@
package org.opensaml.saml.saml1.core.impl;
+import org.opensaml.saml.saml1.core.Attribute;
+
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.Attribute} objects.
+ * A thread safe Marshaller for {@link Attribute} objects.
*/
public class AttributeMarshaller extends AttributeDesignatorMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AttributeQueryMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AttributeQueryMarshaller.java
index 2c3ecf37f..88f53249f 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AttributeQueryMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AttributeQueryMarshaller.java
@@ -17,24 +17,28 @@
package org.opensaml.saml.saml1.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.saml1.core.AttributeQuery;
import org.w3c.dom.Element;
/**
- * A thread safe Unmarshaller for {@link org.opensaml.saml.saml1.core.AttributeQuery} objects.
+ * A thread safe Marshaller for {@link AttributeQuery} objects.
*/
public class AttributeQueryMarshaller extends SubjectQueryMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlElement, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final AttributeQuery attributeQuery = (AttributeQuery) samlElement;
+ final AttributeQuery attributeQuery = (AttributeQuery) xmlObject;
if (attributeQuery.getResource() != null) {
domElement.setAttributeNS(null, AttributeQuery.RESOURCE_ATTRIB_NAME, attributeQuery.getResource());
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AttributeStatementMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AttributeStatementMarshaller.java
index a763d0a1a..3b80089c9 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AttributeStatementMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AttributeStatementMarshaller.java
@@ -17,8 +17,10 @@
package org.opensaml.saml.saml1.core.impl;
+import org.opensaml.saml.saml1.core.AttributeStatement;
+
/**
- * A thread safe Unmarshaller for {@link org.opensaml.saml.saml1.core.AttributeStatement} objects.
+ * A thread safe Marshaller for {@link AttributeStatement} objects.
*/
public class AttributeStatementMarshaller extends SubjectStatementMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AudienceRestrictionConditionMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AudienceRestrictionConditionMarshaller.java
index 1262d08d4..9e93f7744 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AudienceRestrictionConditionMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AudienceRestrictionConditionMarshaller.java
@@ -18,9 +18,10 @@
package org.opensaml.saml.saml1.core.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.saml1.core.AudienceRestrictionCondition;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.AudienceRestrictionCondition} objects.
+ * A thread safe Marshaller for {@link AudienceRestrictionCondition} objects.
*/
public class AudienceRestrictionConditionMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthenticationQueryMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthenticationQueryMarshaller.java
index 98c4ac11c..d7748d621 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthenticationQueryMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthenticationQueryMarshaller.java
@@ -17,24 +17,27 @@
package org.opensaml.saml.saml1.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.saml1.core.AuthenticationQuery;
import org.w3c.dom.Element;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.AuthenticationQuery} objects.
+ * A thread safe Marshaller for {@link AuthenticationQuery} objects.
*/
public class AuthenticationQueryMarshaller extends SubjectQueryMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final AuthenticationQuery authenticationQuery = (AuthenticationQuery) samlObject;
+ final AuthenticationQuery authenticationQuery = (AuthenticationQuery) xmlObject;
if (authenticationQuery.getAuthenticationMethod() != null) {
- domElement.setAttributeNS(null, AuthenticationQuery.AUTHENTICATIONMETHOD_ATTRIB_NAME, authenticationQuery
- .getAuthenticationMethod());
+ domElement.setAttributeNS(null, AuthenticationQuery.AUTHENTICATIONMETHOD_ATTRIB_NAME,
+ authenticationQuery.getAuthenticationMethod());
}
}
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthenticationStatementMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthenticationStatementMarshaller.java
index bc3d0d7c3..da4c48ef9 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthenticationStatementMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthenticationStatementMarshaller.java
@@ -17,6 +17,10 @@
package org.opensaml.saml.saml1.core.impl;
+import java.time.Instant;
+
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.saml1.core.AuthenticationStatement;
@@ -25,24 +29,26 @@ import org.w3c.dom.Element;
import net.shibboleth.shared.xml.AttributeSupport;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.AuthenticationStatement} objects.
+ * A thread safe Marshaller for {@link AuthenticationStatement} objects.
*/
public class AuthenticationStatementMarshaller extends SubjectStatementMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlElement, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final AuthenticationStatement authenticationStatement = (AuthenticationStatement) samlElement;
+ final AuthenticationStatement authenticationStatement = (AuthenticationStatement) xmlObject;
if (authenticationStatement.getAuthenticationMethod() != null) {
domElement.setAttributeNS(null, AuthenticationStatement.AUTHENTICATIONMETHOD_ATTRIB_NAME,
authenticationStatement.getAuthenticationMethod());
}
- if (authenticationStatement.getAuthenticationInstant() != null) {
+ final Instant i = authenticationStatement.getAuthenticationInstant();
+ if (i != null) {
AttributeSupport.appendDateTimeAttribute(domElement,
- AuthenticationStatement.AUTHENTICATIONINSTANT_ATTRIB_QNAME,
- authenticationStatement.getAuthenticationInstant());
+ AuthenticationStatement.AUTHENTICATIONINSTANT_ATTRIB_QNAME, i);
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthorityBindingMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthorityBindingMarshaller.java
index bd4fae3d6..3272163c1 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthorityBindingMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthorityBindingMarshaller.java
@@ -17,6 +17,7 @@
package org.opensaml.saml.saml1.core.impl;
+import javax.annotation.Nonnull;
import javax.xml.namespace.QName;
import org.opensaml.core.xml.XMLObject;
@@ -28,18 +29,21 @@ import org.w3c.dom.Element;
import net.shibboleth.shared.xml.QNameSupport;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.AuthorityBinding} objects.
+ * A thread safe Marshaller for {@link AuthorityBinding} objects.
*/
public class AuthorityBindingMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- public void marshallAttributes(final XMLObject samlElement, final Element domElement) throws MarshallingException {
- final AuthorityBinding authorityBinding = (AuthorityBinding) samlElement;
-
- if (authorityBinding.getAuthorityKind() != null) {
- final QName authKind = authorityBinding.getAuthorityKind();
- domElement.setAttributeNS(null, AuthorityBinding.AUTHORITYKIND_ATTRIB_NAME, QNameSupport
- .qnameToContentString(authKind));
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
+ throws MarshallingException {
+ final AuthorityBinding authorityBinding = (AuthorityBinding) xmlObject;
+
+
+ final QName authKind = authorityBinding.getAuthorityKind();
+ if (authKind != null) {
+ domElement.setAttributeNS(null, AuthorityBinding.AUTHORITYKIND_ATTRIB_NAME,
+ QNameSupport.qnameToContentString(authKind));
}
if (authorityBinding.getBinding() != null) {
@@ -50,4 +54,5 @@ public class AuthorityBindingMarshaller extends AbstractSAMLObjectMarshaller {
domElement.setAttributeNS(null, AuthorityBinding.LOCATION_ATTRIB_NAME, authorityBinding.getLocation());
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthorizationDecisionQueryMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthorizationDecisionQueryMarshaller.java
index 5e9b60d03..9b07a2141 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthorizationDecisionQueryMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthorizationDecisionQueryMarshaller.java
@@ -17,24 +17,28 @@
package org.opensaml.saml.saml1.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.saml1.core.AuthorizationDecisionQuery;
import org.w3c.dom.Element;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.AuthorizationDecisionQuery} objects.
+ * A thread safe Marshaller for {@link AuthorizationDecisionQuery} objects.
*/
public class AuthorizationDecisionQueryMarshaller extends SubjectQueryMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlElement, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final AuthorizationDecisionQuery authorizationDecisionQuery = (AuthorizationDecisionQuery) samlElement;
+ final AuthorizationDecisionQuery authorizationDecisionQuery = (AuthorizationDecisionQuery) xmlObject;
if (authorizationDecisionQuery.getResource() != null) {
- domElement.setAttributeNS(null, AuthorizationDecisionQuery.RESOURCE_ATTRIB_NAME, authorizationDecisionQuery
- .getResource());
+ domElement.setAttributeNS(null, AuthorizationDecisionQuery.RESOURCE_ATTRIB_NAME,
+ authorizationDecisionQuery.getResource());
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthorizationDecisionStatementMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthorizationDecisionStatementMarshaller.java
index c0b5613e7..8445a1639 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthorizationDecisionStatementMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/AuthorizationDecisionStatementMarshaller.java
@@ -17,31 +17,36 @@
package org.opensaml.saml.saml1.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.saml1.core.AuthorizationDecisionStatement;
+import org.opensaml.saml.saml1.core.DecisionTypeEnumeration;
import org.w3c.dom.Element;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.AuthorizationDecisionStatement} objects.
+ * A thread safe Marshaller for {@link AuthorizationDecisionStatement} objects.
*/
public class AuthorizationDecisionStatementMarshaller extends SubjectStatementMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlElement, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
final AuthorizationDecisionStatement authorizationDecisionStatement;
- authorizationDecisionStatement = (AuthorizationDecisionStatement) samlElement;
+ authorizationDecisionStatement = (AuthorizationDecisionStatement) xmlObject;
if (authorizationDecisionStatement.getResource() != null) {
domElement.setAttributeNS(null, AuthorizationDecisionStatement.RESOURCE_ATTRIB_NAME,
authorizationDecisionStatement.getResource());
}
- if (authorizationDecisionStatement.getDecision() != null) {
- domElement.setAttributeNS(null, AuthorizationDecisionStatement.DECISION_ATTRIB_NAME,
- authorizationDecisionStatement.getDecision().toString());
+ final DecisionTypeEnumeration decision = authorizationDecisionStatement.getDecision();
+ if (decision != null) {
+ domElement.setAttributeNS(null, AuthorizationDecisionStatement.DECISION_ATTRIB_NAME, decision.toString());
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ConditionsMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ConditionsMarshaller.java
index 8f35358fc..2033bb3b5 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ConditionsMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ConditionsMarshaller.java
@@ -17,6 +17,10 @@
package org.opensaml.saml.saml1.core.impl;
+import java.time.Instant;
+
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -26,24 +30,25 @@ import org.w3c.dom.Element;
import net.shibboleth.shared.xml.AttributeSupport;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.Conditions} objects.
+ * A thread safe Marshaller for {@link Conditions} objects.
*/
public class ConditionsMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlElement, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final Conditions conditions = (Conditions) samlElement;
+ final Conditions conditions = (Conditions) xmlObject;
- if (conditions.getNotBefore() != null) {
- AttributeSupport.appendDateTimeAttribute(domElement, Conditions.NOTBEFORE_ATTRIB_QNAME,
- conditions.getNotBefore());
+ Instant i = conditions.getNotBefore();
+ if (i != null) {
+ AttributeSupport.appendDateTimeAttribute(domElement, Conditions.NOTBEFORE_ATTRIB_QNAME, i);
}
- if (conditions.getNotOnOrAfter() != null) {
- AttributeSupport.appendDateTimeAttribute(domElement, Conditions.NOTONORAFTER_ATTRIB_QNAME,
- conditions.getNotOnOrAfter());
+ i = conditions.getNotOnOrAfter();
+ if (i != null) {
+ AttributeSupport.appendDateTimeAttribute(domElement, Conditions.NOTONORAFTER_ATTRIB_QNAME, i);
}
}
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/DoNotCacheConditionMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/DoNotCacheConditionMarshaller.java
index 2ee587a42..9712cff3c 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/DoNotCacheConditionMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/DoNotCacheConditionMarshaller.java
@@ -18,9 +18,10 @@
package org.opensaml.saml.saml1.core.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.saml1.core.DoNotCacheCondition;
/**
- * Thread safe Marshaller for {@link org.opensaml.saml.saml1.core.DoNotCacheCondition} objects.
+ * Thread safe Marshaller for {@link DoNotCacheCondition} objects.
*/
public class DoNotCacheConditionMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/EvidenceMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/EvidenceMarshaller.java
index 01f1708a9..68b85ce32 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/EvidenceMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/EvidenceMarshaller.java
@@ -18,9 +18,10 @@
package org.opensaml.saml.saml1.core.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.saml1.core.Evidence;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.Evidence} objects.
+ * A thread safe Marshaller for {@link Evidence} objects.
*/
public class EvidenceMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/NameIdentifierMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/NameIdentifierMarshaller.java
index 4460e56cd..f28f3c7d3 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/NameIdentifierMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/NameIdentifierMarshaller.java
@@ -17,6 +17,8 @@
package org.opensaml.saml.saml1.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.core.xml.schema.impl.XSStringMarshaller;
@@ -29,13 +31,14 @@ import org.w3c.dom.Element;
public class NameIdentifierMarshaller extends XSStringMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlElement, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final NameIdentifier nameIdentifier = (NameIdentifier) samlElement;
+ final NameIdentifier nameIdentifier = (NameIdentifier) xmlObject;
if (nameIdentifier.getNameQualifier() != null) {
- domElement
- .setAttributeNS(null, NameIdentifier.NAMEQUALIFIER_ATTRIB_NAME, nameIdentifier.getNameQualifier());
+ domElement.setAttributeNS(null, NameIdentifier.NAMEQUALIFIER_ATTRIB_NAME,
+ nameIdentifier.getNameQualifier());
}
if (nameIdentifier.getFormat() != null) {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/RequestAbstractTypeMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/RequestAbstractTypeMarshaller.java
index 5b58f025f..c469fa4f8 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/RequestAbstractTypeMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/RequestAbstractTypeMarshaller.java
@@ -21,6 +21,10 @@
package org.opensaml.saml.saml1.core.impl;
+import java.time.Instant;
+
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.core.xml.util.XMLObjectSupport;
@@ -32,32 +36,37 @@ import org.w3c.dom.Element;
import net.shibboleth.shared.xml.AttributeSupport;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.RequestAbstractType} objects.
+ * A thread safe Marshaller for {@link RequestAbstractType} objects.
*/
public class RequestAbstractTypeMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlElement, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final RequestAbstractType request = (RequestAbstractType) samlElement;
+ final RequestAbstractType request = (RequestAbstractType) xmlObject;
if (request.getID() != null) {
domElement.setAttributeNS(null, RequestAbstractType.ID_ATTRIB_NAME, request.getID());
}
- if (request.getIssueInstant() != null) {
- AttributeSupport.appendDateTimeAttribute(domElement, RequestAbstractType.ISSUEINSTANT_ATTRIB_QNAME,
- request.getIssueInstant());
+ final Instant i = request.getIssueInstant();
+ if (i != null) {
+ AttributeSupport.appendDateTimeAttribute(domElement, RequestAbstractType.ISSUEINSTANT_ATTRIB_QNAME, i);
}
- domElement.setAttributeNS(null, RequestAbstractType.MAJORVERSION_ATTRIB_NAME,
- Integer.toString(request.getVersion().getMajorVersion()));
- domElement.setAttributeNS(null, RequestAbstractType.MINORVERSION_ATTRIB_NAME,
- Integer.toString(request.getVersion().getMinorVersion()));
+ final SAMLVersion version = request.getVersion();
+ if (version != null) {
+ domElement.setAttributeNS(null, RequestAbstractType.MAJORVERSION_ATTRIB_NAME,
+ Integer.toString(version.getMajorVersion()));
+ domElement.setAttributeNS(null, RequestAbstractType.MINORVERSION_ATTRIB_NAME,
+ Integer.toString(version.getMinorVersion()));
+ }
}
/** {@inheritDoc} */
- protected void marshallAttributeIDness(final XMLObject xmlObject, final Element domElement)
+ @Override
+ protected void marshallAttributeIDness(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
if (((RequestAbstractType)xmlObject).getVersion() != SAMLVersion.VERSION_10) {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/RequestMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/RequestMarshaller.java
index a373a8b44..02dd134d1 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/RequestMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/RequestMarshaller.java
@@ -17,8 +17,10 @@
package org.opensaml.saml.saml1.core.impl;
+import org.opensaml.saml.saml1.core.Request;
+
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.Request} objects.
+ * A thread safe Marshaller for {@link Request} objects.
*/
public class RequestMarshaller extends RequestAbstractTypeMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ResponseAbstractTypeMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ResponseAbstractTypeMarshaller.java
index 53fcaa185..4a00e06f7 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ResponseAbstractTypeMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ResponseAbstractTypeMarshaller.java
@@ -21,6 +21,10 @@
package org.opensaml.saml.saml1.core.impl;
+import java.time.Instant;
+
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.core.xml.util.XMLObjectSupport;
@@ -32,14 +36,15 @@ import org.w3c.dom.Element;
import net.shibboleth.shared.xml.AttributeSupport;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.ResponseAbstractType} objects.
+ * A thread safe Marshaller for {@link ResponseAbstractType} objects.
*/
public abstract class ResponseAbstractTypeMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlElement, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final ResponseAbstractType response = (ResponseAbstractType) samlElement;
+ final ResponseAbstractType response = (ResponseAbstractType) xmlObject;
if (response.getID() != null) {
domElement.setAttributeNS(null, ResponseAbstractType.ID_ATTRIB_NAME, response.getID());
@@ -49,15 +54,18 @@ public abstract class ResponseAbstractTypeMarshaller extends AbstractSAMLObjectM
domElement.setAttributeNS(null, ResponseAbstractType.INRESPONSETO_ATTRIB_NAME, response.getInResponseTo());
}
- if (response.getIssueInstant() != null) {
- AttributeSupport.appendDateTimeAttribute(domElement, ResponseAbstractType.ISSUEINSTANT_ATTRIB_QNAME,
- response.getIssueInstant());
+ final Instant i = response.getIssueInstant();
+ if (i != null) {
+ AttributeSupport.appendDateTimeAttribute(domElement, ResponseAbstractType.ISSUEINSTANT_ATTRIB_QNAME, i);
}
- domElement.setAttributeNS(null, ResponseAbstractType.MAJORVERSION_ATTRIB_NAME,
- Integer.toString(response.getVersion().getMajorVersion()));
- domElement.setAttributeNS(null, ResponseAbstractType.MINORVERSION_ATTRIB_NAME,
- Integer.toString(response.getVersion().getMinorVersion()));
+ final SAMLVersion version = response.getVersion();
+ if (version != null) {
+ domElement.setAttributeNS(null, ResponseAbstractType.MAJORVERSION_ATTRIB_NAME,
+ Integer.toString(version.getMajorVersion()));
+ domElement.setAttributeNS(null, ResponseAbstractType.MINORVERSION_ATTRIB_NAME,
+ Integer.toString(version.getMinorVersion()));
+ }
if (response.getRecipient() != null) {
domElement.setAttributeNS(null, ResponseAbstractType.RECIPIENT_ATTRIB_NAME, response.getRecipient());
@@ -65,7 +73,8 @@ public abstract class ResponseAbstractTypeMarshaller extends AbstractSAMLObjectM
}
/** {@inheritDoc} */
- protected void marshallAttributeIDness(final XMLObject xmlObject, final Element domElement)
+ @Override
+ protected void marshallAttributeIDness(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
if (((ResponseAbstractType)xmlObject).getVersion() != SAMLVersion.VERSION_10) {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ResponseMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ResponseMarshaller.java
index 655921ba3..06e19b7d2 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ResponseMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/ResponseMarshaller.java
@@ -17,8 +17,10 @@
package org.opensaml.saml.saml1.core.impl;
+import org.opensaml.saml.saml1.core.Response;
+
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.Response} objects.
+ * A thread safe Marshaller for {@link Response} objects.
*/
public class ResponseMarshaller extends ResponseAbstractTypeMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/StatusCodeMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/StatusCodeMarshaller.java
index 05a598a9e..21a30df7c 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/StatusCodeMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/StatusCodeMarshaller.java
@@ -17,6 +17,7 @@
package org.opensaml.saml.saml1.core.impl;
+import javax.annotation.Nonnull;
import javax.xml.namespace.QName;
import org.opensaml.core.xml.XMLObject;
@@ -28,14 +29,15 @@ import org.w3c.dom.Element;
import net.shibboleth.shared.xml.QNameSupport;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.StatusCode} objects.
+ * A thread safe Marshaller for {@link StatusCode} objects.
*/
public class StatusCodeMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlElement, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final StatusCode statusCode = (StatusCode) samlElement;
+ final StatusCode statusCode = (StatusCode) xmlObject;
final QName statusValue = statusCode.getValue();
if (statusValue != null) {
@@ -43,4 +45,5 @@ public class StatusCodeMarshaller extends AbstractSAMLObjectMarshaller {
QNameSupport.qnameToContentString(statusValue));
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/StatusDetailMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/StatusDetailMarshaller.java
index 467f25e3a..8304d7fca 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/StatusDetailMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/StatusDetailMarshaller.java
@@ -18,9 +18,10 @@
package org.opensaml.saml.saml1.core.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.saml1.core.StatusDetail;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.StatusDetail} objects.
+ * A thread safe Marshaller for {@link StatusDetail} objects.
*/
public class StatusDetailMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/StatusMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/StatusMarshaller.java
index 71cbbb816..6c9604130 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/StatusMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/StatusMarshaller.java
@@ -18,9 +18,10 @@
package org.opensaml.saml.saml1.core.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.saml1.core.Status;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.Status} objects.
+ * A thread safe Marshaller for {@link Status} objects.
*/
public class StatusMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/SubjectConfirmationMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/SubjectConfirmationMarshaller.java
index 9a43a2ace..cae6a5f38 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/SubjectConfirmationMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/SubjectConfirmationMarshaller.java
@@ -18,9 +18,10 @@
package org.opensaml.saml.saml1.core.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.saml1.core.SubjectConfirmation;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.SubjectConfirmation} objects.
+ * A thread safe Marshaller for {@link SubjectConfirmation} objects.
*/
public class SubjectConfirmationMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/SubjectLocalityMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/SubjectLocalityMarshaller.java
index db5343c97..c3cfff25b 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/SubjectLocalityMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/SubjectLocalityMarshaller.java
@@ -17,6 +17,8 @@
package org.opensaml.saml.saml1.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -24,13 +26,15 @@ import org.opensaml.saml.saml1.core.SubjectLocality;
import org.w3c.dom.Element;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.SubjectLocality} objects.
+ * A thread safe Marshaller for {@link SubjectLocality} objects.
*/
public class SubjectLocalityMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- public void marshallAttributes(final XMLObject samlElement, final Element domElement) throws MarshallingException {
- final SubjectLocality subjectLocality = (SubjectLocality) samlElement;
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
+ throws MarshallingException {
+ final SubjectLocality subjectLocality = (SubjectLocality) xmlObject;
if (subjectLocality.getIPAddress() != null) {
domElement.setAttributeNS(null, SubjectLocality.IPADDRESS_ATTRIB_NAME, subjectLocality.getIPAddress());
@@ -40,4 +44,5 @@ public class SubjectLocalityMarshaller extends AbstractSAMLObjectMarshaller {
domElement.setAttributeNS(null, SubjectLocality.DNSADDRESS_ATTRIB_NAME, subjectLocality.getDNSAddress());
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/SubjectMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/SubjectMarshaller.java
index 7fec178b0..dcacbba43 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/SubjectMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/SubjectMarshaller.java
@@ -18,9 +18,10 @@
package org.opensaml.saml.saml1.core.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.saml1.core.Subject;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.Subject} objects.
+ * A thread safe Marshaller for {@link Subject} objects.
*/
public class SubjectMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/SubjectQueryMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/SubjectQueryMarshaller.java
index 3e7e59dbe..fdb6c1eef 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/SubjectQueryMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/SubjectQueryMarshaller.java
@@ -22,9 +22,10 @@
package org.opensaml.saml.saml1.core.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.saml1.core.SubjectQuery;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml1.core.SubjectQuery} objects.
+ * A thread safe Marshaller for {@link SubjectQuery} objects.
*/
public abstract class SubjectQueryMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/SubjectStatementMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/SubjectStatementMarshaller.java
index eff8c2fe3..fdd7a83b5 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/SubjectStatementMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/core/impl/SubjectStatementMarshaller.java
@@ -22,9 +22,10 @@
package org.opensaml.saml.saml1.core.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.saml1.core.SubjectStatement;
/**
- * Marshaller for {@link org.opensaml.saml.saml1.core.SubjectStatement} XMLObjects.
+ * Marshaller for {@link SubjectStatement} XMLObjects.
*/
public abstract class SubjectStatementMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ActionMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ActionMarshaller.java
index e3891d3cc..2f398969e 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ActionMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ActionMarshaller.java
@@ -21,6 +21,8 @@
package org.opensaml.saml.saml2.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.core.xml.schema.impl.XSStringMarshaller;
@@ -33,9 +35,10 @@ import org.w3c.dom.Element;
public class ActionMarshaller extends XSStringMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final Action action = (Action) samlObject;
+ final Action action = (Action) xmlObject;
if (action.getNamespace() != null) {
domElement.setAttributeNS(null, Action.NAMEPSACE_ATTRIB_NAME, action.getNamespace());
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AdviceMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AdviceMarshaller.java
index 074e91307..11fe8cf3f 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AdviceMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AdviceMarshaller.java
@@ -22,9 +22,10 @@
package org.opensaml.saml.saml2.core.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.saml2.core.Advice;
/**
- * A thread-safe marshaller for {@link org.opensaml.saml.saml2.core.Advice}.
+ * A thread-safe marshaller for {@link Advice}.
*/
public class AdviceMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ArtifactResolveMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ArtifactResolveMarshaller.java
index 81c863a31..e0dfe3cc0 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ArtifactResolveMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ArtifactResolveMarshaller.java
@@ -21,8 +21,10 @@
package org.opensaml.saml.saml2.core.impl;
+import org.opensaml.saml.saml2.core.ArtifactResolve;
+
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.ArtifactResolve}.
+ * A thread-safe Marshaller for {@link ArtifactResolve}.
*/
public class ArtifactResolveMarshaller extends RequestAbstractTypeMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ArtifactResponseMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ArtifactResponseMarshaller.java
index afc25d288..36a66b88d 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ArtifactResponseMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ArtifactResponseMarshaller.java
@@ -21,8 +21,10 @@
package org.opensaml.saml.saml2.core.impl;
+import org.opensaml.saml.saml2.core.ArtifactResponse;
+
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.ArtifactResponse}.
+ * A thread-safe Marshaller for {@link ArtifactResponse}.
*/
public class ArtifactResponseMarshaller extends StatusResponseTypeMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AssertionIDRequestMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AssertionIDRequestMarshaller.java
index 64d861ce4..ef2206f02 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AssertionIDRequestMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AssertionIDRequestMarshaller.java
@@ -21,8 +21,10 @@
package org.opensaml.saml.saml2.core.impl;
+import org.opensaml.saml.saml2.core.AssertionIDRequest;
+
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.AssertionIDRequest}.
+ * A thread-safe Marshaller for {@link AssertionIDRequest}.
*/
public class AssertionIDRequestMarshaller extends RequestAbstractTypeMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AssertionMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AssertionMarshaller.java
index f77471bbd..92278d699 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AssertionMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AssertionMarshaller.java
@@ -21,32 +21,39 @@
package org.opensaml.saml.saml2.core.impl;
+import java.time.Instant;
+
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.core.xml.util.XMLObjectSupport;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.common.SAMLVersion;
import org.opensaml.saml.saml2.core.Assertion;
import org.w3c.dom.Element;
import net.shibboleth.shared.xml.AttributeSupport;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.Assertion}.
+ * A thread-safe Marshaller for {@link Assertion}.
*/
public class AssertionMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final Assertion assertion = (Assertion) samlObject;
+ final Assertion assertion = (Assertion) xmlObject;
- if (assertion.getVersion() != null) {
- domElement.setAttributeNS(null, Assertion.VERSION_ATTRIB_NAME, assertion.getVersion().toString());
+ final SAMLVersion version = assertion.getVersion();
+ if (version != null) {
+ domElement.setAttributeNS(null, Assertion.VERSION_ATTRIB_NAME, version.toString());
}
- if (assertion.getIssueInstant() != null) {
- AttributeSupport.appendDateTimeAttribute(domElement, Assertion.ISSUEINSTANT_ATTRIB_QNAME,
- assertion.getIssueInstant());
+ final Instant i = assertion.getIssueInstant();
+ if (i != null) {
+ AttributeSupport.appendDateTimeAttribute(domElement, Assertion.ISSUEINSTANT_ATTRIB_QNAME, i);
}
if (assertion.getID() != null) {
@@ -55,7 +62,8 @@ public class AssertionMarshaller extends AbstractSAMLObjectMarshaller {
}
/** {@inheritDoc} */
- protected void marshallAttributeIDness(final XMLObject xmlObject, final Element domElement)
+ @Override
+ protected void marshallAttributeIDness(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
XMLObjectSupport.marshallAttributeIDness(null, Assertion.ID_ATTRIB_NAME, domElement, true);
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AttributeMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AttributeMarshaller.java
index 49ab75404..279988101 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AttributeMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AttributeMarshaller.java
@@ -17,6 +17,8 @@
package org.opensaml.saml.saml2.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -24,14 +26,15 @@ import org.opensaml.saml.saml2.core.Attribute;
import org.w3c.dom.Element;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.Attribute} objects.
+ * A thread safe Marshaller for {@link Attribute} objects.
*/
public class AttributeMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlElement, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final Attribute attribute = (Attribute) samlElement;
+ final Attribute attribute = (Attribute) xmlObject;
if (attribute.getName() != null) {
domElement.setAttributeNS(null, Attribute.NAME_ATTTRIB_NAME, attribute.getName());
@@ -47,4 +50,5 @@ public class AttributeMarshaller extends AbstractSAMLObjectMarshaller {
marshallUnknownAttributes(attribute, domElement);
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AttributeQueryMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AttributeQueryMarshaller.java
index 9c8f247fe..4faaff9a0 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AttributeQueryMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AttributeQueryMarshaller.java
@@ -21,8 +21,10 @@
package org.opensaml.saml.saml2.core.impl;
+import org.opensaml.saml.saml2.core.AttributeQuery;
+
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.AttributeQuery}.
+ * A thread-safe Marshaller for {@link AttributeQuery}.
*/
public class AttributeQueryMarshaller extends SubjectQueryMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AttributeStatementMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AttributeStatementMarshaller.java
index fbd9232a5..e5a1c63e2 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AttributeStatementMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AttributeStatementMarshaller.java
@@ -22,9 +22,10 @@
package org.opensaml.saml.saml2.core.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.saml2.core.AttributeStatement;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.AttributeStatement}.
+ * A thread-safe Marshaller for {@link AttributeStatement}.
*/
public class AttributeStatementMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AudienceRestrictionMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AudienceRestrictionMarshaller.java
index 2b157a2fc..283ac7f78 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AudienceRestrictionMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AudienceRestrictionMarshaller.java
@@ -22,9 +22,10 @@
package org.opensaml.saml.saml2.core.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.saml2.core.AudienceRestriction;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.AudienceRestriction} objects.
+ * A thread safe Marshaller for {@link AudienceRestriction} objects.
*/
public class AudienceRestrictionMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnContextMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnContextMarshaller.java
index 682a19d96..a8366836c 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnContextMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnContextMarshaller.java
@@ -22,9 +22,10 @@
package org.opensaml.saml.saml2.core.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.saml2.core.AuthnContext;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.AuthnContext}.
+ * A thread-safe Marshaller for {@link AuthnContext}.
*/
public class AuthnContextMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnQueryMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnQueryMarshaller.java
index 86d669244..b1b226167 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnQueryMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnQueryMarshaller.java
@@ -21,25 +21,29 @@
package org.opensaml.saml.saml2.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.saml2.core.AuthnQuery;
import org.w3c.dom.Element;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.AuthnQuery}.
+ * A thread-safe Marshaller for {@link AuthnQuery}.
*/
public class AuthnQueryMarshaller extends SubjectQueryMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final AuthnQuery query = (AuthnQuery) samlObject;
+ final AuthnQuery query = (AuthnQuery) xmlObject;
if (query.getSessionIndex() != null) {
domElement.setAttributeNS(null, AuthnQuery.SESSION_INDEX_ATTRIB_NAME, query.getSessionIndex());
}
- super.marshallAttributes(samlObject, domElement);
+ super.marshallAttributes(xmlObject, domElement);
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnRequestMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnRequestMarshaller.java
index 697179134..7d3617cce 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnRequestMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnRequestMarshaller.java
@@ -21,37 +21,42 @@
package org.opensaml.saml.saml2.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
+import org.opensaml.core.xml.schema.XSBooleanValue;
import org.opensaml.saml.saml2.core.AuthnRequest;
import org.w3c.dom.Element;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.AuthnRequest}.
+ * A thread-safe Marshaller for {@link AuthnRequest}.
*/
public class AuthnRequestMarshaller extends RequestAbstractTypeMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final AuthnRequest req = (AuthnRequest) samlObject;
+ final AuthnRequest req = (AuthnRequest) xmlObject;
- if (req.isForceAuthnXSBoolean() != null) {
- domElement.setAttributeNS(null, AuthnRequest.FORCE_AUTHN_ATTRIB_NAME, req.isForceAuthnXSBoolean()
- .toString());
+ XSBooleanValue flag = req.isForceAuthnXSBoolean();
+ if (flag != null) {
+ domElement.setAttributeNS(null, AuthnRequest.FORCE_AUTHN_ATTRIB_NAME, flag.toString());
}
- if (req.isPassiveXSBoolean() != null) {
- domElement.setAttributeNS(null, AuthnRequest.IS_PASSIVE_ATTRIB_NAME, req.isPassiveXSBoolean().toString());
+ flag = req.isPassiveXSBoolean();
+ if (flag != null) {
+ domElement.setAttributeNS(null, AuthnRequest.IS_PASSIVE_ATTRIB_NAME, flag.toString());
}
if (req.getProtocolBinding() != null) {
domElement.setAttributeNS(null, AuthnRequest.PROTOCOL_BINDING_ATTRIB_NAME, req.getProtocolBinding());
}
- if (req.getAssertionConsumerServiceIndex() != null) {
- domElement.setAttributeNS(null, AuthnRequest.ASSERTION_CONSUMER_SERVICE_INDEX_ATTRIB_NAME, req
- .getAssertionConsumerServiceIndex().toString());
+ Integer i = req.getAssertionConsumerServiceIndex();
+ if (i != null) {
+ domElement.setAttributeNS(null, AuthnRequest.ASSERTION_CONSUMER_SERVICE_INDEX_ATTRIB_NAME, i.toString());
}
if (req.getAssertionConsumerServiceURL() != null) {
@@ -59,15 +64,16 @@ public class AuthnRequestMarshaller extends RequestAbstractTypeMarshaller {
.getAssertionConsumerServiceURL());
}
- if (req.getAttributeConsumingServiceIndex() != null) {
- domElement.setAttributeNS(null, AuthnRequest.ATTRIBUTE_CONSUMING_SERVICE_INDEX_ATTRIB_NAME, req
- .getAttributeConsumingServiceIndex().toString());
+ i = req.getAttributeConsumingServiceIndex();
+ if (i != null) {
+ domElement.setAttributeNS(null, AuthnRequest.ATTRIBUTE_CONSUMING_SERVICE_INDEX_ATTRIB_NAME, i.toString());
}
if (req.getProviderName() != null) {
domElement.setAttributeNS(null, AuthnRequest.PROVIDER_NAME_ATTRIB_NAME, req.getProviderName());
}
- super.marshallAttributes(samlObject, domElement);
+ super.marshallAttributes(xmlObject, domElement);
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnStatementMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnStatementMarshaller.java
index 0ffc514c4..03b44ae2a 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnStatementMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnStatementMarshaller.java
@@ -21,6 +21,10 @@
package org.opensaml.saml.saml2.core.impl;
+import java.time.Instant;
+
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -30,27 +34,29 @@ import org.w3c.dom.Element;
import net.shibboleth.shared.xml.AttributeSupport;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.AuthnStatement}.
+ * A thread-safe Marshaller for {@link AuthnStatement}.
*/
public class AuthnStatementMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final AuthnStatement authnStatement = (AuthnStatement) samlObject;
+ final AuthnStatement authnStatement = (AuthnStatement) xmlObject;
- if (authnStatement.getAuthnInstant() != null) {
- AttributeSupport.appendDateTimeAttribute(domElement, AuthnStatement.AUTHN_INSTANT_ATTRIB_QNAME,
- authnStatement.getAuthnInstant());
+ Instant i = authnStatement.getAuthnInstant();
+ if (i != null) {
+ AttributeSupport.appendDateTimeAttribute(domElement, AuthnStatement.AUTHN_INSTANT_ATTRIB_QNAME, i);
}
if (authnStatement.getSessionIndex() != null) {
domElement.setAttributeNS(null, AuthnStatement.SESSION_INDEX_ATTRIB_NAME, authnStatement.getSessionIndex());
}
- if (authnStatement.getSessionNotOnOrAfter() != null) {
+ i = authnStatement.getSessionNotOnOrAfter();
+ if (i != null) {
AttributeSupport.appendDateTimeAttribute(domElement, AuthnStatement.SESSION_NOT_ON_OR_AFTER_ATTRIB_QNAME,
- authnStatement.getSessionNotOnOrAfter());
+ i);
}
}
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthzDecisionQueryMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthzDecisionQueryMarshaller.java
index 58bdb034f..cdbf3ebab 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthzDecisionQueryMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthzDecisionQueryMarshaller.java
@@ -21,25 +21,29 @@
package org.opensaml.saml.saml2.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.saml2.core.AuthzDecisionQuery;
import org.w3c.dom.Element;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.AuthzDecisionQuery} objects.
+ * A thread-safe Marshaller for {@link AuthzDecisionQuery} objects.
*/
public class AuthzDecisionQueryMarshaller extends SubjectQueryMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final AuthzDecisionQuery query = (AuthzDecisionQuery) samlObject;
+ final AuthzDecisionQuery query = (AuthzDecisionQuery) xmlObject;
if (query.getResource() != null) {
domElement.setAttributeNS(null, AuthzDecisionQuery.RESOURCE_ATTRIB_NAME, query.getResource());
}
- super.marshallAttributes(samlObject, domElement);
+ super.marshallAttributes(xmlObject, domElement);
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthzDecisionStatementMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthzDecisionStatementMarshaller.java
index fcabf613b..9e89d41b1 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthzDecisionStatementMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthzDecisionStatementMarshaller.java
@@ -21,29 +21,34 @@
package org.opensaml.saml.saml2.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
import org.opensaml.saml.saml2.core.AuthzDecisionStatement;
+import org.opensaml.saml.saml2.core.DecisionTypeEnumeration;
import org.w3c.dom.Element;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.AuthzDecisionStatement}.
+ * A thread-safe Marshaller for {@link AuthzDecisionStatement}.
*/
public class AuthzDecisionStatementMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final AuthzDecisionStatement authzDS = (AuthzDecisionStatement) samlObject;
+ final AuthzDecisionStatement authzDS = (AuthzDecisionStatement) xmlObject;
if (authzDS.getResource() != null) {
domElement.setAttributeNS(null, AuthzDecisionStatement.RESOURCE_ATTRIB_NAME, authzDS.getResource());
}
- if (authzDS.getDecision() != null) {
- domElement.setAttributeNS(null, AuthzDecisionStatement.DECISION_ATTRIB_NAME, authzDS.getDecision()
- .toString());
+ final DecisionTypeEnumeration decision = authzDS.getDecision();
+ if (decision != null) {
+ domElement.setAttributeNS(null, AuthzDecisionStatement.DECISION_ATTRIB_NAME, decision.toString());
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/BaseIDMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/BaseIDMarshaller.java
index 8ecc00ade..95b568177 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/BaseIDMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/BaseIDMarshaller.java
@@ -21,6 +21,8 @@
package org.opensaml.saml.saml2.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -28,14 +30,16 @@ import org.opensaml.saml.saml2.core.BaseID;
import org.w3c.dom.Element;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.BaseID} objects.
+ * A thread-safe Marshaller for {@link BaseID} objects.
*/
public abstract class BaseIDMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final BaseID baseID = (BaseID) samlObject;
+ final BaseID baseID = (BaseID) xmlObject;
+
if (baseID.getNameQualifier() != null) {
domElement.setAttributeNS(null, BaseID.NAME_QUALIFIER_ATTRIB_NAME, baseID.getNameQualifier());
}
@@ -44,4 +48,5 @@ public abstract class BaseIDMarshaller extends AbstractSAMLObjectMarshaller {
domElement.setAttributeNS(null, BaseID.SP_NAME_QUALIFIER_ATTRIB_NAME, baseID.getSPNameQualifier());
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ConditionsMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ConditionsMarshaller.java
index da81466e2..f639e2365 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ConditionsMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ConditionsMarshaller.java
@@ -21,6 +21,10 @@
package org.opensaml.saml.saml2.core.impl;
+import java.time.Instant;
+
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -30,23 +34,25 @@ import org.w3c.dom.Element;
import net.shibboleth.shared.xml.AttributeSupport;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.Conditions} objects.
+ * A thread-safe Marshaller for {@link Conditions} objects.
*/
public class ConditionsMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final Conditions conditions = (Conditions) samlObject;
+ final Conditions conditions = (Conditions) xmlObject;
- if (conditions.getNotBefore() != null) {
- AttributeSupport.appendDateTimeAttribute(domElement, Conditions.NOT_BEFORE_ATTRIB_QNAME,
- conditions.getNotBefore());
+ Instant i = conditions.getNotBefore();
+ if (i != null) {
+ AttributeSupport.appendDateTimeAttribute(domElement, Conditions.NOT_BEFORE_ATTRIB_QNAME, i);
}
- if (conditions.getNotOnOrAfter() != null) {
- AttributeSupport.appendDateTimeAttribute(domElement, Conditions.NOT_ON_OR_AFTER_ATTRIB_QNAME,
- conditions.getNotOnOrAfter());
+ i = conditions.getNotOnOrAfter();
+ if (i != null) {
+ AttributeSupport.appendDateTimeAttribute(domElement, Conditions.NOT_ON_OR_AFTER_ATTRIB_QNAME, i);
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/EncryptedAssertionMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/EncryptedAssertionMarshaller.java
index 17a9da32c..ad87fa2f0 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/EncryptedAssertionMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/EncryptedAssertionMarshaller.java
@@ -17,8 +17,10 @@
package org.opensaml.saml.saml2.core.impl;
+import org.opensaml.saml.saml2.core.EncryptedAssertion;
+
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.EncryptedAssertion}.
+ * A thread-safe Marshaller for {@link EncryptedAssertion}.
*/
public class EncryptedAssertionMarshaller extends EncryptedElementTypeMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/EncryptedAttributeMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/EncryptedAttributeMarshaller.java
index 421324826..f75573bfe 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/EncryptedAttributeMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/EncryptedAttributeMarshaller.java
@@ -17,8 +17,10 @@
package org.opensaml.saml.saml2.core.impl;
+import org.opensaml.saml.saml2.core.EncryptedAttribute;
+
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.EncryptedAttribute}.
+ * A thread-safe Marshaller for {@link EncryptedAttribute}.
*/
public class EncryptedAttributeMarshaller extends EncryptedElementTypeMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/EncryptedElementTypeMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/EncryptedElementTypeMarshaller.java
index 1b2db1a1d..0e25bc98d 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/EncryptedElementTypeMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/EncryptedElementTypeMarshaller.java
@@ -18,9 +18,10 @@
package org.opensaml.saml.saml2.core.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.saml2.core.EncryptedElementType;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.EncryptedElementType}.
+ * A thread-safe Marshaller for {@link EncryptedElementType}.
*/
public class EncryptedElementTypeMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/EncryptedIDMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/EncryptedIDMarshaller.java
index c736796e3..2a81f3d39 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/EncryptedIDMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/EncryptedIDMarshaller.java
@@ -17,8 +17,10 @@
package org.opensaml.saml.saml2.core.impl;
+import org.opensaml.saml.saml2.core.EncryptedID;
+
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.EncryptedID}.
+ * A thread-safe Marshaller for {@link EncryptedID}.
*/
public class EncryptedIDMarshaller extends EncryptedElementTypeMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/EvidenceMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/EvidenceMarshaller.java
index 35ad2b81c..5c9096bb8 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/EvidenceMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/EvidenceMarshaller.java
@@ -22,9 +22,10 @@
package org.opensaml.saml.saml2.core.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.saml2.core.Evidence;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.Evidence}.
+ * A thread-safe Marshaller for {@link Evidence}.
*/
public class EvidenceMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ExtensionsMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ExtensionsMarshaller.java
index 6edb7cb0e..349fdf1d6 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ExtensionsMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ExtensionsMarshaller.java
@@ -17,35 +17,12 @@
package org.opensaml.saml.saml2.core.impl;
-import org.opensaml.core.xml.XMLObject;
-import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
-import org.w3c.dom.Element;
+import org.opensaml.saml.saml2.core.Extensions;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.Extensions} objects.
+ * A thread-safe Marshaller for {@link Extensions} objects.
*/
public class ExtensionsMarshaller extends AbstractSAMLObjectMarshaller {
- /**
- * Constructor.
- */
- public ExtensionsMarshaller() {
- super();
- }
-
- /**
- * {@inheritDoc}
- */
- protected void marshallAttributes(final XMLObject xmlObject, final Element domElement) throws MarshallingException {
- // no attributes
- }
-
- /**
- * {@inheritDoc}
- */
- protected void marshallElementContent(final XMLObject xmlObject, final Element domElement)
- throws MarshallingException {
- // no content
- }
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/IDPEntryMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/IDPEntryMarshaller.java
index 10d3921ee..597474e87 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/IDPEntryMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/IDPEntryMarshaller.java
@@ -21,6 +21,8 @@
package org.opensaml.saml.saml2.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -28,14 +30,15 @@ import org.opensaml.saml.saml2.core.IDPEntry;
import org.w3c.dom.Element;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.IDPEntry} objects.
+ * A thread safe Marshaller for {@link IDPEntry} objects.
*/
public class IDPEntryMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final IDPEntry entry = (IDPEntry) samlObject;
+ final IDPEntry entry = (IDPEntry) xmlObject;
if (entry.getProviderID() != null) {
domElement.setAttributeNS(null, IDPEntry.PROVIDER_ID_ATTRIB_NAME, entry.getProviderID());
@@ -47,4 +50,5 @@ public class IDPEntryMarshaller extends AbstractSAMLObjectMarshaller {
domElement.setAttributeNS(null, IDPEntry.LOC_ATTRIB_NAME, entry.getLoc());
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/IDPListMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/IDPListMarshaller.java
index bd839b6ab..d829ef3d0 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/IDPListMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/IDPListMarshaller.java
@@ -22,9 +22,10 @@
package org.opensaml.saml.saml2.core.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.saml2.core.IDPList;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.IDPList} objects.
+ * A thread safe Marshaller for {@link IDPList} objects.
*/
public class IDPListMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/LogoutRequestMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/LogoutRequestMarshaller.java
index 76ec8be83..bf3ee65ed 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/LogoutRequestMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/LogoutRequestMarshaller.java
@@ -21,6 +21,10 @@
package org.opensaml.saml.saml2.core.impl;
+import java.time.Instant;
+
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.saml2.core.LogoutRequest;
@@ -29,25 +33,26 @@ import org.w3c.dom.Element;
import net.shibboleth.shared.xml.AttributeSupport;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.LogoutRequest}.
+ * A thread-safe Marshaller for {@link LogoutRequest}.
*/
public class LogoutRequestMarshaller extends RequestAbstractTypeMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final LogoutRequest req = (LogoutRequest) samlObject;
+ final LogoutRequest req = (LogoutRequest) xmlObject;
if (req.getReason() != null) {
domElement.setAttributeNS(null, LogoutRequest.REASON_ATTRIB_NAME, req.getReason());
}
- if (req.getNotOnOrAfter() != null) {
- AttributeSupport.appendDateTimeAttribute(domElement, LogoutRequest.NOT_ON_OR_AFTER_ATTRIB_QNAME,
- req.getNotOnOrAfter());
+ final Instant i = req.getNotOnOrAfter();
+ if (i != null) {
+ AttributeSupport.appendDateTimeAttribute(domElement, LogoutRequest.NOT_ON_OR_AFTER_ATTRIB_QNAME, i);
}
- super.marshallAttributes(samlObject, domElement);
+ super.marshallAttributes(xmlObject, domElement);
}
-}
+}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/LogoutResponseMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/LogoutResponseMarshaller.java
index 14343afa5..13b443090 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/LogoutResponseMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/LogoutResponseMarshaller.java
@@ -21,8 +21,10 @@
package org.opensaml.saml.saml2.core.impl;
+import org.opensaml.saml.saml2.core.LogoutResponse;
+
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.LogoutResponse} objects.
+ * A thread safe Marshaller for {@link LogoutResponse} objects.
*/
public class LogoutResponseMarshaller extends StatusResponseTypeMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ManageNameIDRequestMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ManageNameIDRequestMarshaller.java
index d7e0d5397..7e8cef415 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ManageNameIDRequestMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ManageNameIDRequestMarshaller.java
@@ -21,8 +21,10 @@
package org.opensaml.saml.saml2.core.impl;
+import org.opensaml.saml.saml2.core.ManageNameIDRequest;
+
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.ManageNameIDRequest} objects.
+ * A thread safe Marshaller for {@link ManageNameIDRequest} objects.
*/
public class ManageNameIDRequestMarshaller extends RequestAbstractTypeMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ManageNameIDResponseMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ManageNameIDResponseMarshaller.java
index f51619726..be59b5832 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ManageNameIDResponseMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ManageNameIDResponseMarshaller.java
@@ -21,8 +21,10 @@
package org.opensaml.saml.saml2.core.impl;
+import org.opensaml.saml.saml2.core.ManageNameIDResponse;
+
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.ManageNameIDResponse} objects.
+ * A thread safe Marshaller for {@link ManageNameIDResponse} objects.
*/
public class ManageNameIDResponseMarshaller extends StatusResponseTypeMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NameIDMappingRequestMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NameIDMappingRequestMarshaller.java
index e17114816..c918ee682 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NameIDMappingRequestMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NameIDMappingRequestMarshaller.java
@@ -21,8 +21,10 @@
package org.opensaml.saml.saml2.core.impl;
+import org.opensaml.saml.saml2.core.NameIDMappingRequest;
+
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.NameIDMappingRequest}.
+ * A thread-safe Marshaller for {@link NameIDMappingRequest}.
*/
public class NameIDMappingRequestMarshaller extends RequestAbstractTypeMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NameIDMappingResponseMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NameIDMappingResponseMarshaller.java
index 62f3cb119..b721a4f64 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NameIDMappingResponseMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NameIDMappingResponseMarshaller.java
@@ -21,8 +21,10 @@
package org.opensaml.saml.saml2.core.impl;
+import org.opensaml.saml.saml2.core.NameIDMappingResponse;
+
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.NameIDMappingResponse} objects.
+ * A thread safe Marshaller for {@link NameIDMappingResponse} objects.
*/
public class NameIDMappingResponseMarshaller extends StatusResponseTypeMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NameIDPolicyMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NameIDPolicyMarshaller.java
index d164ff2ef..df2afc21a 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NameIDPolicyMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NameIDPolicyMarshaller.java
@@ -21,21 +21,25 @@
package org.opensaml.saml.saml2.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
+import org.opensaml.core.xml.schema.XSBooleanValue;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
import org.opensaml.saml.saml2.core.NameIDPolicy;
import org.w3c.dom.Element;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.NameIDPolicy} objects.
+ * A thread safe Marshaller for {@link NameIDPolicy} objects.
*/
public class NameIDPolicyMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final NameIDPolicy policy = (NameIDPolicy) samlObject;
+ final NameIDPolicy policy = (NameIDPolicy) xmlObject;
if (policy.getFormat() != null) {
domElement.setAttributeNS(null, NameIDPolicy.FORMAT_ATTRIB_NAME, policy.getFormat());
@@ -45,9 +49,10 @@ public class NameIDPolicyMarshaller extends AbstractSAMLObjectMarshaller {
domElement.setAttributeNS(null, NameIDPolicy.SP_NAME_QUALIFIER_ATTRIB_NAME, policy.getSPNameQualifier());
}
- if (policy.getAllowCreateXSBoolean() != null) {
- domElement.setAttributeNS(null, NameIDPolicy.ALLOW_CREATE_ATTRIB_NAME, policy.getAllowCreateXSBoolean()
- .toString());
+ final XSBooleanValue flag = policy.getAllowCreateXSBoolean();
+ if (flag != null) {
+ domElement.setAttributeNS(null, NameIDPolicy.ALLOW_CREATE_ATTRIB_NAME, flag.toString());
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NameIDTypeMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NameIDTypeMarshaller.java
index f9a81a006..c465ce07e 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NameIDTypeMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NameIDTypeMarshaller.java
@@ -17,6 +17,8 @@
package org.opensaml.saml.saml2.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.core.xml.schema.impl.XSStringMarshaller;
@@ -32,9 +34,10 @@ import net.shibboleth.shared.xml.ElementSupport;
public class NameIDTypeMarshaller extends XSStringMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final NameIDType nameID = (NameIDType) samlObject;
+ final NameIDType nameID = (NameIDType) xmlObject;
if (nameID.getNameQualifier() != null) {
domElement.setAttributeNS(null, NameID.NAME_QUALIFIER_ATTRIB_NAME, nameID.getNameQualifier());
@@ -54,10 +57,12 @@ public class NameIDTypeMarshaller extends XSStringMarshaller {
}
/** {@inheritDoc} */
- protected void marshallElementContent(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallElementContent(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final NameIDType nameID = (NameIDType) samlObject;
+ final NameIDType nameID = (NameIDType) xmlObject;
ElementSupport.appendTextContent(domElement, nameID.getValue());
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NewEncryptedIDMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NewEncryptedIDMarshaller.java
index 5ad613cbe..99f563226 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NewEncryptedIDMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/NewEncryptedIDMarshaller.java
@@ -17,8 +17,10 @@
package org.opensaml.saml.saml2.core.impl;
+import org.opensaml.saml.saml2.core.NewEncryptedID;
+
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.EncryptedID}.
+ * A thread-safe Marshaller for {@link NewEncryptedID}.
*/
public class NewEncryptedIDMarshaller extends EncryptedElementTypeMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/OneTimeUseMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/OneTimeUseMarshaller.java
index 204ff6518..1c4a85fbb 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/OneTimeUseMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/OneTimeUseMarshaller.java
@@ -22,9 +22,10 @@
package org.opensaml.saml.saml2.core.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.saml2.core.OneTimeUse;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.OneTimeUse} objects.
+ * A thread-safe Marshaller for {@link OneTimeUse} objects.
*/
public class OneTimeUseMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ProxyRestrictionMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ProxyRestrictionMarshaller.java
index a645918b8..81ffc181d 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ProxyRestrictionMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ProxyRestrictionMarshaller.java
@@ -21,6 +21,8 @@
package org.opensaml.saml.saml2.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -28,17 +30,20 @@ import org.opensaml.saml.saml2.core.ProxyRestriction;
import org.w3c.dom.Element;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.ProxyRestriction} objects.
+ * A thread-safe Marshaller for {@link ProxyRestriction} objects.
*/
public class ProxyRestrictionMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final ProxyRestriction proxyRestriction = (ProxyRestriction) samlObject;
- if (proxyRestriction.getProxyCount() != null) {
- domElement.setAttributeNS(null, ProxyRestriction.COUNT_ATTRIB_NAME, Integer.toString(proxyRestriction
- .getProxyCount()));
+ final ProxyRestriction proxyRestriction = (ProxyRestriction) xmlObject;
+
+ final Integer i = proxyRestriction.getProxyCount();
+ if (i != null) {
+ domElement.setAttributeNS(null, ProxyRestriction.COUNT_ATTRIB_NAME, i.toString());
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequestAbstractTypeMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequestAbstractTypeMarshaller.java
index 33d9a7285..62babc7ba 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequestAbstractTypeMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequestAbstractTypeMarshaller.java
@@ -21,10 +21,15 @@
package org.opensaml.saml.saml2.core.impl;
+import java.time.Instant;
+
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.core.xml.util.XMLObjectSupport;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.common.SAMLVersion;
import org.opensaml.saml.saml2.core.RequestAbstractType;
import org.w3c.dom.Element;
@@ -36,25 +41,23 @@ import net.shibboleth.shared.xml.AttributeSupport;
public abstract class RequestAbstractTypeMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final RequestAbstractType req = (RequestAbstractType) samlObject;
+ final RequestAbstractType req = (RequestAbstractType) xmlObject;
- if (req.getVersion() != null) {
- domElement.setAttributeNS(null, RequestAbstractType.VERSION_ATTRIB_NAME, req.getVersion().toString());
+ final SAMLVersion version = req.getVersion();
+ if (version != null) {
+ domElement.setAttributeNS(null, RequestAbstractType.VERSION_ATTRIB_NAME, version.toString());
}
if (req.getID() != null) {
domElement.setAttributeNS(null, RequestAbstractType.ID_ATTRIB_NAME, req.getID());
}
- if (req.getVersion() != null) {
- domElement.setAttributeNS(null, RequestAbstractType.VERSION_ATTRIB_NAME, req.getVersion().toString());
- }
-
- if (req.getIssueInstant() != null) {
- AttributeSupport.appendDateTimeAttribute(domElement, RequestAbstractType.ISSUE_INSTANT_ATTRIB_QNAME,
- req.getIssueInstant());
+ final Instant i = req.getIssueInstant();
+ if (i != null) {
+ AttributeSupport.appendDateTimeAttribute(domElement, RequestAbstractType.ISSUE_INSTANT_ATTRIB_QNAME, i);
}
if (req.getDestination() != null) {
@@ -67,7 +70,8 @@ public abstract class RequestAbstractTypeMarshaller extends AbstractSAMLObjectMa
}
/** {@inheritDoc} */
- protected void marshallAttributeIDness(final XMLObject xmlObject, final Element domElement)
+ @Override
+ protected void marshallAttributeIDness(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
XMLObjectSupport.marshallAttributeIDness(null, RequestAbstractType.ID_ATTRIB_NAME, domElement, true);
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequestedAuthnContextMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequestedAuthnContextMarshaller.java
index c9db3514c..f19dcb3f7 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequestedAuthnContextMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/RequestedAuthnContextMarshaller.java
@@ -21,6 +21,8 @@
package org.opensaml.saml.saml2.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -28,18 +30,20 @@ import org.opensaml.saml.saml2.core.RequestedAuthnContext;
import org.w3c.dom.Element;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.RequestedAuthnContext} objects.
+ * A thread safe Marshaller for {@link RequestedAuthnContext} objects.
*/
public class RequestedAuthnContextMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final RequestedAuthnContext rac = (RequestedAuthnContext) samlObject;
+ final RequestedAuthnContext rac = (RequestedAuthnContext) xmlObject;
- if (rac.getComparison() != null) {
- domElement.setAttributeNS(null, RequestedAuthnContext.COMPARISON_ATTRIB_NAME, rac.getComparison()
- .toString());
+ final var comp = rac.getComparison();
+ if (comp != null) {
+ domElement.setAttributeNS(null, RequestedAuthnContext.COMPARISON_ATTRIB_NAME, comp.toString());
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ResponseMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ResponseMarshaller.java
index e59463ece..667f6b341 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ResponseMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ResponseMarshaller.java
@@ -21,8 +21,10 @@
package org.opensaml.saml.saml2.core.impl;
+import org.opensaml.saml.saml2.core.Response;
+
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.Response} objects.
+ * A thread safe Marshaller for {@link Response} objects.
*/
public class ResponseMarshaller extends StatusResponseTypeMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ScopingMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ScopingMarshaller.java
index 2409776be..bc9643f01 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ScopingMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/ScopingMarshaller.java
@@ -21,6 +21,8 @@
package org.opensaml.saml.saml2.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -28,17 +30,20 @@ import org.opensaml.saml.saml2.core.Scoping;
import org.w3c.dom.Element;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.Scoping} objects.
+ * A thread safe Marshaller for {@link Scoping} objects.
*/
public class ScopingMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final Scoping scoping = (Scoping) samlObject;
+ final Scoping scoping = (Scoping) xmlObject;
- if (scoping.getProxyCount() != null) {
- domElement.setAttributeNS(null, Scoping.PROXY_COUNT_ATTRIB_NAME, scoping.getProxyCount().toString());
+ final Integer i = scoping.getProxyCount();
+ if (i != null) {
+ domElement.setAttributeNS(null, Scoping.PROXY_COUNT_ATTRIB_NAME, i.toString());
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusCodeMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusCodeMarshaller.java
index 2b4f0f5e9..2c9d4570a 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusCodeMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusCodeMarshaller.java
@@ -21,6 +21,8 @@
package org.opensaml.saml.saml2.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -28,14 +30,15 @@ import org.opensaml.saml.saml2.core.StatusCode;
import org.w3c.dom.Element;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.StatusCode} objects.
+ * A thread safe Marshaller for {@link StatusCode} objects.
*/
public class StatusCodeMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final StatusCode statusCode = (StatusCode) samlObject;
+ final StatusCode statusCode = (StatusCode) xmlObject;
if (statusCode.getValue() != null) {
domElement.setAttributeNS(null, StatusCode.VALUE_ATTRIB_NAME, statusCode.getValue());
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusDetailMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusDetailMarshaller.java
index db1d9abcd..cd2890874 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusDetailMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusDetailMarshaller.java
@@ -18,9 +18,10 @@
package org.opensaml.saml.saml2.core.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.saml2.core.StatusDetail;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.StatusDetail} objects.
+ * A thread safe Marshaller for {@link StatusDetail} objects.
*/
public class StatusDetailMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusMarshaller.java
index f1d094b53..1381a81e3 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusMarshaller.java
@@ -22,9 +22,10 @@
package org.opensaml.saml.saml2.core.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.saml2.core.Status;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.Status} objects.
+ * A thread safe Marshaller for {@link Status} objects.
*/
public class StatusMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusResponseTypeMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusResponseTypeMarshaller.java
index 4048fc864..bdaeeff56 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusResponseTypeMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/StatusResponseTypeMarshaller.java
@@ -21,10 +21,15 @@
package org.opensaml.saml.saml2.core.impl;
+import java.time.Instant;
+
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.core.xml.util.XMLObjectSupport;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.common.SAMLVersion;
import org.opensaml.saml.saml2.core.StatusResponseType;
import org.w3c.dom.Element;
@@ -36,12 +41,14 @@ import net.shibboleth.shared.xml.AttributeSupport;
public abstract class StatusResponseTypeMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final StatusResponseType sr = (StatusResponseType) samlObject;
+ final StatusResponseType sr = (StatusResponseType) xmlObject;
- if (sr.getVersion() != null) {
- domElement.setAttributeNS(null, StatusResponseType.VERSION_ATTRIB_NAME, sr.getVersion().toString());
+ final SAMLVersion version = sr.getVersion();
+ if (version != null) {
+ domElement.setAttributeNS(null, StatusResponseType.VERSION_ATTRIB_NAME, version.toString());
}
if (sr.getID() != null) {
@@ -52,13 +59,9 @@ public abstract class StatusResponseTypeMarshaller extends AbstractSAMLObjectMar
domElement.setAttributeNS(null, StatusResponseType.IN_RESPONSE_TO_ATTRIB_NAME, sr.getInResponseTo());
}
- if (sr.getVersion() != null) {
- domElement.setAttributeNS(null, StatusResponseType.VERSION_ATTRIB_NAME, sr.getVersion().toString());
- }
-
- if (sr.getIssueInstant() != null) {
- AttributeSupport.appendDateTimeAttribute(domElement, StatusResponseType.ISSUE_INSTANT_ATTRIB_QNAME,
- sr.getIssueInstant());
+ final Instant i = sr.getIssueInstant();
+ if (i != null) {
+ AttributeSupport.appendDateTimeAttribute(domElement, StatusResponseType.ISSUE_INSTANT_ATTRIB_QNAME, i);
}
if (sr.getDestination() != null) {
@@ -71,7 +74,8 @@ public abstract class StatusResponseTypeMarshaller extends AbstractSAMLObjectMar
}
/** {@inheritDoc} */
- protected void marshallAttributeIDness(final XMLObject xmlObject, final Element domElement)
+ @Override
+ protected void marshallAttributeIDness(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
XMLObjectSupport.marshallAttributeIDness(null, StatusResponseType.ID_ATTRIB_NAME, domElement, true);
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectConfirmationDataMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectConfirmationDataMarshaller.java
index 3edbd7a65..740885bc7 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectConfirmationDataMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectConfirmationDataMarshaller.java
@@ -21,6 +21,10 @@
package org.opensaml.saml.saml2.core.impl;
+import java.time.Instant;
+
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -30,23 +34,25 @@ import org.w3c.dom.Element;
import net.shibboleth.shared.xml.AttributeSupport;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.SubjectConfirmationData} objects.
+ * A thread-safe Marshaller for {@link SubjectConfirmationData} objects.
*/
public class SubjectConfirmationDataMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final SubjectConfirmationData subjectCD = (SubjectConfirmationData) samlObject;
+ final SubjectConfirmationData subjectCD = (SubjectConfirmationData) xmlObject;
- if (subjectCD.getNotBefore() != null) {
- AttributeSupport.appendDateTimeAttribute(domElement, SubjectConfirmationData.NOT_BEFORE_ATTRIB_QNAME,
- subjectCD.getNotBefore());
+ Instant i = subjectCD.getNotBefore();
+ if (i != null) {
+ AttributeSupport.appendDateTimeAttribute(domElement, SubjectConfirmationData.NOT_BEFORE_ATTRIB_QNAME, i);
}
- if (subjectCD.getNotOnOrAfter() != null) {
+ i = subjectCD.getNotOnOrAfter();
+ if (i != null) {
AttributeSupport.appendDateTimeAttribute(domElement, SubjectConfirmationData.NOT_ON_OR_AFTER_ATTRIB_QNAME,
- subjectCD.getNotOnOrAfter());
+ i);
}
if (subjectCD.getRecipient() != null) {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectConfirmationMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectConfirmationMarshaller.java
index 59b643b51..bfcd403d4 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectConfirmationMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectConfirmationMarshaller.java
@@ -21,6 +21,8 @@
package org.opensaml.saml.saml2.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -28,14 +30,15 @@ import org.opensaml.saml.saml2.core.SubjectConfirmation;
import org.w3c.dom.Element;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.SubjectConfirmation} objects.
+ * A thread-safe Marshaller for {@link SubjectConfirmation} objects.
*/
public class SubjectConfirmationMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final SubjectConfirmation subjectConfirmation = (SubjectConfirmation) samlObject;
+ final SubjectConfirmation subjectConfirmation = (SubjectConfirmation) xmlObject;
if (subjectConfirmation.getMethod() != null) {
domElement.setAttributeNS(null, SubjectConfirmation.METHOD_ATTRIB_NAME, subjectConfirmation.getMethod());
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectLocalityMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectLocalityMarshaller.java
index 7cf4a7340..9b1883c42 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectLocalityMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectLocalityMarshaller.java
@@ -21,6 +21,8 @@
package org.opensaml.saml.saml2.core.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -28,14 +30,15 @@ import org.opensaml.saml.saml2.core.SubjectLocality;
import org.w3c.dom.Element;
/**
- * A thread-safe Marshaler for {@link org.opensaml.saml.saml2.core.SubjectLocality}.
+ * A thread-safe Marshaller for {@link SubjectLocality}.
*/
public class SubjectLocalityMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final SubjectLocality subjectLocality = (SubjectLocality) samlObject;
+ final SubjectLocality subjectLocality = (SubjectLocality) xmlObject;
if (subjectLocality.getAddress() != null) {
domElement.setAttributeNS(null, SubjectLocality.ADDRESS_ATTRIB_NAME, subjectLocality.getAddress());
}
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectLocalityUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectLocalityUnmarshaller.java
index 1be980e8e..7376344fb 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectLocalityUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectLocalityUnmarshaller.java
@@ -28,7 +28,7 @@ import org.opensaml.saml.saml2.core.SubjectLocality;
import org.w3c.dom.Attr;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.SubjectLocality}.
+ * A thread-safe Marshaller for {@link SubjectLocality}.
*/
public class SubjectLocalityUnmarshaller extends AbstractSAMLObjectUnmarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectMarshaller.java
index c20d8a405..e7e30738f 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectMarshaller.java
@@ -22,9 +22,10 @@
package org.opensaml.saml.saml2.core.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.saml2.core.Subject;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.Subject} objects.
+ * A thread-safe Marshaller for {@link Subject} objects.
*/
public class SubjectMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectQueryMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectQueryMarshaller.java
index 74cc30975..959e1bcb0 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectQueryMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/SubjectQueryMarshaller.java
@@ -21,8 +21,10 @@
package org.opensaml.saml.saml2.core.impl;
+import org.opensaml.saml.saml2.core.SubjectQuery;
+
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.core.SubjectQuery}.
+ * A thread-safe Marshaller for {@link SubjectQuery}.
*/
public abstract class SubjectQueryMarshaller extends RequestAbstractTypeMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/TerminateMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/TerminateMarshaller.java
index b73f443e1..fd6ee7b82 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/TerminateMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/TerminateMarshaller.java
@@ -22,9 +22,10 @@
package org.opensaml.saml.saml2.core.impl;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
+import org.opensaml.saml.saml2.core.Terminate;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.core.Terminate} objects.
+ * A thread safe Marshaller for {@link Terminate} objects.
*/
public class TerminateMarshaller extends AbstractSAMLObjectMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/ecp/impl/RelayStateMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/ecp/impl/RelayStateMarshaller.java
index b6217b81d..a0fb084ca 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/ecp/impl/RelayStateMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/ecp/impl/RelayStateMarshaller.java
@@ -17,8 +17,11 @@
package org.opensaml.saml.saml2.ecp.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
+import org.opensaml.core.xml.schema.XSBooleanValue;
import org.opensaml.core.xml.schema.impl.XSStringMarshaller;
import org.opensaml.core.xml.util.XMLObjectSupport;
import org.opensaml.saml.saml2.ecp.RelayState;
@@ -30,12 +33,15 @@ import org.w3c.dom.Element;
public class RelayStateMarshaller extends XSStringMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject xmlObject, final Element domElement) throws MarshallingException {
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
+ throws MarshallingException {
final RelayState relayState = (RelayState) xmlObject;
- if (relayState.isSOAP11MustUnderstandXSBoolean() != null) {
+ final XSBooleanValue mustUnderstand = relayState.isSOAP11MustUnderstandXSBoolean();
+ if (mustUnderstand != null) {
XMLObjectSupport.marshallAttribute(RelayState.SOAP11_MUST_UNDERSTAND_ATTR_NAME,
- relayState.isSOAP11MustUnderstandXSBoolean().toString(), domElement, false);
+ mustUnderstand.toString(), domElement, false);
}
if (relayState.getSOAP11Actor() != null) {
XMLObjectSupport.marshallAttribute(RelayState.SOAP11_ACTOR_ATTR_NAME,
@@ -44,4 +50,4 @@ public class RelayStateMarshaller extends XSStringMarshaller {
}
-}
+}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/ecp/impl/RequestAuthenticatedMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/ecp/impl/RequestAuthenticatedMarshaller.java
index b6dc4eb0b..fc43998dc 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/ecp/impl/RequestAuthenticatedMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/ecp/impl/RequestAuthenticatedMarshaller.java
@@ -17,8 +17,11 @@
package org.opensaml.saml.saml2.ecp.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
+import org.opensaml.core.xml.schema.XSBooleanValue;
import org.opensaml.core.xml.util.XMLObjectSupport;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
import org.opensaml.saml.saml2.ecp.RequestAuthenticated;
@@ -30,12 +33,15 @@ import org.w3c.dom.Element;
public class RequestAuthenticatedMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject xmlObject, final Element domElement) throws MarshallingException {
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
+ throws MarshallingException {
final RequestAuthenticated ra = (RequestAuthenticated) xmlObject;
- if (ra.isSOAP11MustUnderstandXSBoolean() != null) {
+ final XSBooleanValue mustUnderstand = ra.isSOAP11MustUnderstandXSBoolean();
+ if (mustUnderstand != null) {
XMLObjectSupport.marshallAttribute(RequestAuthenticated.SOAP11_MUST_UNDERSTAND_ATTR_NAME,
- ra.isSOAP11MustUnderstandXSBoolean().toString(), domElement, false);
+ mustUnderstand.toString(), domElement, false);
}
if (ra.getSOAP11Actor() != null) {
XMLObjectSupport.marshallAttribute(RequestAuthenticated.SOAP11_ACTOR_ATTR_NAME,
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/ecp/impl/RequestMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/ecp/impl/RequestMarshaller.java
index 241704296..57d341115 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/ecp/impl/RequestMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/ecp/impl/RequestMarshaller.java
@@ -17,8 +17,11 @@
package org.opensaml.saml.saml2.ecp.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
+import org.opensaml.core.xml.schema.XSBooleanValue;
import org.opensaml.core.xml.util.XMLObjectSupport;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
import org.opensaml.saml.saml2.ecp.Request;
@@ -30,20 +33,26 @@ import org.w3c.dom.Element;
public class RequestMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject xmlObject, final Element domElement) throws MarshallingException {
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
+ throws MarshallingException {
final Request request = (Request) xmlObject;
if (request.getProviderName() != null) {
domElement.setAttributeNS(null, Request.PROVIDER_NAME_ATTRIB_NAME, request.getProviderName());
}
- if (request.isPassiveXSBoolean() != null) {
- domElement.setAttributeNS(null, Request.IS_PASSIVE_NAME_ATTRIB_NAME,
- request.isPassiveXSBoolean().toString());
+
+ XSBooleanValue flag = request.isPassiveXSBoolean();
+ if (flag != null) {
+ domElement.setAttributeNS(null, Request.IS_PASSIVE_NAME_ATTRIB_NAME, flag.toString());
}
- if (request.isSOAP11MustUnderstandXSBoolean() != null) {
- XMLObjectSupport.marshallAttribute(Request.SOAP11_MUST_UNDERSTAND_ATTR_NAME,
- request.isSOAP11MustUnderstandXSBoolean().toString(), domElement, false);
+
+ flag = request.isSOAP11MustUnderstandXSBoolean();
+ if (flag != null) {
+ XMLObjectSupport.marshallAttribute(Request.SOAP11_MUST_UNDERSTAND_ATTR_NAME, flag.toString(), domElement,
+ false);
}
+
if (request.getSOAP11Actor() != null) {
XMLObjectSupport.marshallAttribute(Request.SOAP11_ACTOR_ATTR_NAME,
request.getSOAP11Actor(), domElement, false);
@@ -51,4 +60,4 @@ public class RequestMarshaller extends AbstractSAMLObjectMarshaller {
}
-}
+}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/ecp/impl/ResponseMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/ecp/impl/ResponseMarshaller.java
index 8ac8a4525..b0e2e54c3 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/ecp/impl/ResponseMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/ecp/impl/ResponseMarshaller.java
@@ -17,8 +17,11 @@
package org.opensaml.saml.saml2.ecp.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
+import org.opensaml.core.xml.schema.XSBooleanValue;
import org.opensaml.core.xml.util.XMLObjectSupport;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
import org.opensaml.saml.saml2.ecp.Response;
@@ -30,22 +33,26 @@ import org.w3c.dom.Element;
public class ResponseMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject xmlObject, final Element domElement) throws MarshallingException {
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
+ throws MarshallingException {
final Response response = (Response) xmlObject;
if (response.getAssertionConsumerServiceURL() != null) {
domElement.setAttributeNS(null, Response.ASSERTION_CONSUMER_SERVICE_URL_ATTRIB_NAME,
response.getAssertionConsumerServiceURL());
}
- if (response.isSOAP11MustUnderstandXSBoolean() != null) {
- XMLObjectSupport.marshallAttribute(Response.SOAP11_MUST_UNDERSTAND_ATTR_NAME,
- response.isSOAP11MustUnderstandXSBoolean().toString(), domElement, false);
+
+ final XSBooleanValue mustUnderstand = response.isSOAP11MustUnderstandXSBoolean();
+ if (mustUnderstand != null) {
+ XMLObjectSupport.marshallAttribute(Response.SOAP11_MUST_UNDERSTAND_ATTR_NAME, mustUnderstand.toString(),
+ domElement, false);
}
+
if (response.getSOAP11Actor() != null) {
XMLObjectSupport.marshallAttribute(Response.SOAP11_ACTOR_ATTR_NAME,
response.getSOAP11Actor(), domElement, false);
}
}
-
-}
+}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/ecp/impl/SubjectConfirmationMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/ecp/impl/SubjectConfirmationMarshaller.java
index 46adb8567..2ee833901 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/ecp/impl/SubjectConfirmationMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/ecp/impl/SubjectConfirmationMarshaller.java
@@ -21,8 +21,11 @@
package org.opensaml.saml.saml2.ecp.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
+import org.opensaml.core.xml.schema.XSBooleanValue;
import org.opensaml.core.xml.util.XMLObjectSupport;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
import org.opensaml.saml.saml2.ecp.SubjectConfirmation;
@@ -34,13 +37,15 @@ import org.w3c.dom.Element;
public class SubjectConfirmationMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final SubjectConfirmation sc = (SubjectConfirmation) samlObject;
+ final SubjectConfirmation sc = (SubjectConfirmation) xmlObject;
- if (sc.isSOAP11MustUnderstandXSBoolean() != null) {
- XMLObjectSupport.marshallAttribute(SubjectConfirmation.SOAP11_MUST_UNDERSTAND_ATTR_NAME,
- sc.isSOAP11MustUnderstandXSBoolean().toString(), domElement, false);
+ final XSBooleanValue mustUnderstand = sc.isSOAP11MustUnderstandXSBoolean();
+ if (mustUnderstand != null) {
+ XMLObjectSupport.marshallAttribute(SubjectConfirmation.SOAP11_MUST_UNDERSTAND_ATTR_NAME,
+ mustUnderstand.toString(), domElement, false);
}
if (sc.getSOAP11Actor() != null) {
@@ -52,4 +57,5 @@ public class SubjectConfirmationMarshaller extends AbstractSAMLObjectMarshaller
domElement.setAttributeNS(null, SubjectConfirmation.METHOD_ATTRIB_NAME, sc.getMethod());
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AdditionalMetadataLocationMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AdditionalMetadataLocationMarshaller.java
index e36be7d2c..838fbeeda 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AdditionalMetadataLocationMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AdditionalMetadataLocationMarshaller.java
@@ -17,6 +17,8 @@
package org.opensaml.saml.saml2.metadata.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.core.xml.schema.impl.XSURIMarshaller;
@@ -29,9 +31,10 @@ import org.w3c.dom.Element;
public class AdditionalMetadataLocationMarshaller extends XSURIMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlElement, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final AdditionalMetadataLocation aml = (AdditionalMetadataLocation) samlElement;
+ final AdditionalMetadataLocation aml = (AdditionalMetadataLocation) xmlObject;
if (aml.getNamespaceURI() != null) {
domElement.setAttributeNS(null, AdditionalMetadataLocation.NAMESPACE_ATTRIB_NAME, aml.getNamespaceURI());
@@ -39,7 +42,8 @@ public class AdditionalMetadataLocationMarshaller extends XSURIMarshaller {
}
/** {@inheritDoc} */
- protected void marshallElementContent(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallElementContent(@Nonnull final XMLObject samlObject, @Nonnull final Element domElement)
throws MarshallingException {
final AdditionalMetadataLocation aml = (AdditionalMetadataLocation) samlObject;
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AffiliationDescriptorMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AffiliationDescriptorMarshaller.java
index 601b8e788..6884f0b61 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AffiliationDescriptorMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AffiliationDescriptorMarshaller.java
@@ -21,6 +21,11 @@
package org.opensaml.saml.saml2.metadata.impl;
+import java.time.Duration;
+import java.time.Instant;
+
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.core.xml.util.XMLObjectSupport;
@@ -38,9 +43,10 @@ import net.shibboleth.shared.xml.AttributeSupport;
public class AffiliationDescriptorMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlElement, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final AffiliationDescriptor descriptor = (AffiliationDescriptor) samlElement;
+ final AffiliationDescriptor descriptor = (AffiliationDescriptor) xmlObject;
// Set affiliationOwnerID
if (descriptor.getOwnerID() != null) {
@@ -53,22 +59,23 @@ public class AffiliationDescriptorMarshaller extends AbstractSAMLObjectMarshalle
}
// Set the validUntil attribute
- if (descriptor.getValidUntil() != null) {
- AttributeSupport.appendDateTimeAttribute(domElement, TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_QNAME,
- descriptor.getValidUntil());
+ final Instant i = descriptor.getValidUntil();
+ if (i != null) {
+ AttributeSupport.appendDateTimeAttribute(domElement, TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_QNAME, i);
}
// Set the cacheDuration attribute
- if (descriptor.getCacheDuration() != null) {
- AttributeSupport.appendDurationAttribute(domElement, CacheableSAMLObject.CACHE_DURATION_ATTRIB_QNAME,
- descriptor.getCacheDuration());
+ final Duration d = descriptor.getCacheDuration();
+ if (d != null) {
+ AttributeSupport.appendDurationAttribute(domElement, CacheableSAMLObject.CACHE_DURATION_ATTRIB_QNAME, d);
}
marshallUnknownAttributes(descriptor, domElement);
}
/** {@inheritDoc} */
- protected void marshallAttributeIDness(final XMLObject xmlObject, final Element domElement)
+ @Override
+ protected void marshallAttributeIDness(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
XMLObjectSupport.marshallAttributeIDness(null, AffiliationDescriptor.ID_ATTRIB_NAME, domElement, true);
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AttributeAuthorityDescriptorMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AttributeAuthorityDescriptorMarshaller.java
index 9a508948b..bfb0ef429 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AttributeAuthorityDescriptorMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AttributeAuthorityDescriptorMarshaller.java
@@ -21,8 +21,10 @@
package org.opensaml.saml.saml2.metadata.impl;
+import org.opensaml.saml.saml2.metadata.AttributeAuthorityDescriptor;
+
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.metadata.AttributeAuthorityDescriptor}s.
+ * A thread safe Marshaller for {@link AttributeAuthorityDescriptor}.
*/
public class AttributeAuthorityDescriptorMarshaller extends RoleDescriptorMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AttributeConsumingServiceImpl.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AttributeConsumingServiceImpl.java
index aae1f8851..50f52ca03 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AttributeConsumingServiceImpl.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AttributeConsumingServiceImpl.java
@@ -25,6 +25,8 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import javax.annotation.Nullable;
+
import org.opensaml.core.xml.AbstractXMLObject;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.schema.XSBooleanValue;
@@ -40,7 +42,7 @@ import org.opensaml.saml.saml2.metadata.ServiceName;
public class AttributeConsumingServiceImpl extends AbstractXMLObject implements AttributeConsumingService {
/** Index of this service. */
- private int index;
+ private Integer index;
/** isDefault attribute of this service. */
private XSBooleanValue isDefault;
@@ -70,16 +72,13 @@ public class AttributeConsumingServiceImpl extends AbstractXMLObject implements
}
/** {@inheritDoc} */
- public int getIndex() {
+ public Integer getIndex() {
return index;
}
/** {@inheritDoc} */
- public void setIndex(final int theIndex) {
- if (this.index != theIndex) {
- releaseThisandParentDOM();
- this.index = theIndex;
- }
+ public void setIndex(@Nullable final Integer theIndex) {
+ index = prepareForAssignment(index, theIndex);
}
/** {@inheritDoc} */
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AttributeConsumingServiceMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AttributeConsumingServiceMarshaller.java
index d8ff2237e..f70838282 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AttributeConsumingServiceMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AttributeConsumingServiceMarshaller.java
@@ -15,34 +15,37 @@
* limitations under the License.
*/
-/**
- *
- */
-
package org.opensaml.saml.saml2.metadata.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
+import org.opensaml.core.xml.schema.XSBooleanValue;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
import org.opensaml.saml.saml2.metadata.AttributeConsumingService;
import org.w3c.dom.Element;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.metadata.AttributeConsumingService} objects.
+ * A thread safe Marshaller for {@link AttributeConsumingService} objects.
*/
public class AttributeConsumingServiceMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final AttributeConsumingService service = (AttributeConsumingService) samlObject;
+ final AttributeConsumingService service = (AttributeConsumingService) xmlObject;
- domElement.setAttributeNS(null, AttributeConsumingService.INDEX_ATTRIB_NAME, Integer.toString(service
- .getIndex()));
+ final Integer i = service.getIndex();
+ if (i != null) {
+ domElement.setAttributeNS(null, AttributeConsumingService.INDEX_ATTRIB_NAME, i.toString());
+ }
- if (service.isDefaultXSBoolean() != null) {
- domElement.setAttributeNS(null, AttributeConsumingService.IS_DEFAULT_ATTRIB_NAME, service
- .isDefaultXSBoolean().toString());
+ final XSBooleanValue flag = service.isDefaultXSBoolean();
+ if (flag != null) {
+ domElement.setAttributeNS(null, AttributeConsumingService.IS_DEFAULT_ATTRIB_NAME, flag.toString());
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AuthnAuthorityDescriptorMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AuthnAuthorityDescriptorMarshaller.java
index abaebf842..1a80e7866 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AuthnAuthorityDescriptorMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/AuthnAuthorityDescriptorMarshaller.java
@@ -17,8 +17,10 @@
package org.opensaml.saml.saml2.metadata.impl;
+import org.opensaml.saml.saml2.metadata.AuthnAuthorityDescriptor;
+
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.metadata.AuthnAuthorityDescriptor} objects.
+ * A thread safe Marshaller for {@link AuthnAuthorityDescriptor} objects.
*/
public class AuthnAuthorityDescriptorMarshaller extends RoleDescriptorMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/ContactPersonMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/ContactPersonMarshaller.java
index 872604053..cdae1d562 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/ContactPersonMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/ContactPersonMarshaller.java
@@ -21,6 +21,8 @@
package org.opensaml.saml.saml2.metadata.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -28,19 +30,22 @@ import org.opensaml.saml.saml2.metadata.ContactPerson;
import org.w3c.dom.Element;
/**
- * A thread safe marshaller for {@link org.opensaml.saml.saml2.metadata.ContactPerson} objects.
+ * A thread safe marshaller for {@link ContactPerson} objects.
*/
public class ContactPersonMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final ContactPerson person = (ContactPerson) samlObject;
+ final ContactPerson person = (ContactPerson) xmlObject;
- if (person.getType() != null) {
- domElement.setAttributeNS(null, ContactPerson.CONTACT_TYPE_ATTRIB_NAME, person.getType().toString());
+ final var type = person.getType();
+ if (type != null) {
+ domElement.setAttributeNS(null, ContactPerson.CONTACT_TYPE_ATTRIB_NAME, type.toString());
}
marshallUnknownAttributes(person, domElement);
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EndpointMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EndpointMarshaller.java
index 880b221d7..ff10eff44 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EndpointMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EndpointMarshaller.java
@@ -17,30 +17,34 @@
package org.opensaml.saml.saml2.metadata.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
+import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
import org.opensaml.saml.saml2.metadata.Endpoint;
import org.w3c.dom.Element;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.metadata.Endpoint} objects.
+ * A thread safe Marshaller for {@link Endpoint} objects.
*/
public class EndpointMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- public void marshallAttributes(final XMLObject samlElement, final Element domElement) {
- final Endpoint endpoint = (Endpoint) samlElement;
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
+ throws MarshallingException {
+ final Endpoint endpoint = (Endpoint) xmlObject;
if (endpoint.getBinding() != null) {
- domElement.setAttributeNS(null, Endpoint.BINDING_ATTRIB_NAME, endpoint.getBinding().toString());
+ domElement.setAttributeNS(null, Endpoint.BINDING_ATTRIB_NAME, endpoint.getBinding());
}
if (endpoint.getLocation() != null) {
- domElement.setAttributeNS(null, Endpoint.LOCATION_ATTRIB_NAME, endpoint.getLocation().toString());
+ domElement.setAttributeNS(null, Endpoint.LOCATION_ATTRIB_NAME, endpoint.getLocation());
}
if (endpoint.getResponseLocation() != null) {
- domElement.setAttributeNS(null, Endpoint.RESPONSE_LOCATION_ATTRIB_NAME, endpoint.getResponseLocation()
- .toString());
+ domElement.setAttributeNS(null, Endpoint.RESPONSE_LOCATION_ATTRIB_NAME, endpoint.getResponseLocation());
}
marshallUnknownAttributes(endpoint, domElement);
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntitiesDescriptorMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntitiesDescriptorMarshaller.java
index b44a00c14..b5a2c2daf 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntitiesDescriptorMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntitiesDescriptorMarshaller.java
@@ -17,6 +17,11 @@
package org.opensaml.saml.saml2.metadata.impl;
+import java.time.Duration;
+import java.time.Instant;
+
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.core.xml.util.XMLObjectSupport;
@@ -29,31 +34,32 @@ import org.w3c.dom.Element;
import net.shibboleth.shared.xml.AttributeSupport;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.metadata.EntitiesDescriptor} objects.
+ * A thread safe Marshaller for {@link EntitiesDescriptor} objects.
*/
public class EntitiesDescriptorMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlElement, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final EntitiesDescriptor entitiesDescriptor = (EntitiesDescriptor) samlElement;
+ final EntitiesDescriptor entitiesDescriptor = (EntitiesDescriptor) xmlObject;
// Set the ID attribute
if (entitiesDescriptor.getID() != null) {
domElement.setAttributeNS(null, EntitiesDescriptor.ID_ATTRIB_NAME, entitiesDescriptor.getID());
}
-
+
// Set the validUntil attribute
- if (entitiesDescriptor.getValidUntil() != null) {
- AttributeSupport.appendDateTimeAttribute(domElement, TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_QNAME,
- entitiesDescriptor.getValidUntil());
+ final Instant i = entitiesDescriptor.getValidUntil();
+ if (i != null) {
+ AttributeSupport.appendDateTimeAttribute(domElement, TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_QNAME, i);
}
// Set the cacheDuration attribute
- if (entitiesDescriptor.getCacheDuration() != null) {
- AttributeSupport.appendDurationAttribute(domElement, CacheableSAMLObject.CACHE_DURATION_ATTRIB_QNAME,
- entitiesDescriptor.getCacheDuration());
+ final Duration d = entitiesDescriptor.getCacheDuration();
+ if (d != null) {
+ AttributeSupport.appendDurationAttribute(domElement, CacheableSAMLObject.CACHE_DURATION_ATTRIB_QNAME, d);
}
// Set the Name attribute
@@ -63,7 +69,8 @@ public class EntitiesDescriptorMarshaller extends AbstractSAMLObjectMarshaller {
}
/** {@inheritDoc} */
- protected void marshallAttributeIDness(final XMLObject xmlObject, final Element domElement)
+ @Override
+ protected void marshallAttributeIDness(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
XMLObjectSupport.marshallAttributeIDness(null, EntitiesDescriptor.ID_ATTRIB_NAME, domElement, true);
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntityDescriptorMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntityDescriptorMarshaller.java
index 916e5cb5e..33f41b2d4 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntityDescriptorMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/EntityDescriptorMarshaller.java
@@ -17,6 +17,11 @@
package org.opensaml.saml.saml2.metadata.impl;
+import java.time.Duration;
+import java.time.Instant;
+
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.core.xml.util.XMLObjectSupport;
@@ -34,10 +39,11 @@ import net.shibboleth.shared.xml.AttributeSupport;
public class EntityDescriptorMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlElement, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final EntityDescriptor entityDescriptor = (EntityDescriptor) samlElement;
+ final EntityDescriptor entityDescriptor = (EntityDescriptor) xmlObject;
// Set the entityID attribute
if (entityDescriptor.getEntityID() != null) {
@@ -50,22 +56,23 @@ public class EntityDescriptorMarshaller extends AbstractSAMLObjectMarshaller {
}
// Set the validUntil attribute
- if (entityDescriptor.getValidUntil() != null) {
- AttributeSupport.appendDateTimeAttribute(domElement, TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_QNAME,
- entityDescriptor.getValidUntil());
+ final Instant i = entityDescriptor.getValidUntil();
+ if (i != null) {
+ AttributeSupport.appendDateTimeAttribute(domElement, TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_QNAME, i);
}
// Set the cacheDuration attribute
- if (entityDescriptor.getCacheDuration() != null) {
- AttributeSupport.appendDurationAttribute(domElement, CacheableSAMLObject.CACHE_DURATION_ATTRIB_QNAME,
- entityDescriptor.getCacheDuration());
+ final Duration d = entityDescriptor.getCacheDuration();
+ if (d != null) {
+ AttributeSupport.appendDurationAttribute(domElement, CacheableSAMLObject.CACHE_DURATION_ATTRIB_QNAME, d);
}
marshallUnknownAttributes(entityDescriptor, domElement);
}
/** {@inheritDoc} */
- protected void marshallAttributeIDness(final XMLObject xmlObject, final Element domElement)
+ @Override
+ protected void marshallAttributeIDness(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
XMLObjectSupport.marshallAttributeIDness(null, EntityDescriptor.ID_ATTRIB_NAME, domElement, true);
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/ExtensionsMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/ExtensionsMarshaller.java
index f14b6d5b9..0f3c9851d 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/ExtensionsMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/ExtensionsMarshaller.java
@@ -17,35 +17,12 @@
package org.opensaml.saml.saml2.metadata.impl;
-import org.opensaml.core.xml.XMLObject;
-import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
-import org.w3c.dom.Element;
+import org.opensaml.saml.saml2.metadata.Extensions;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.metadata.Extensions} objects.
+ * A thread-safe Marshaller for {@link Extensions} objects.
*/
public class ExtensionsMarshaller extends AbstractSAMLObjectMarshaller {
- /**
- * Constructor.
- */
- public ExtensionsMarshaller() {
- super();
- }
-
- /**
- * {@inheritDoc}
- */
- protected void marshallAttributes(final XMLObject xmlObject, final Element domElement) throws MarshallingException {
- // no attributes
- }
-
- /**
- * {@inheritDoc}
- */
- protected void marshallElementContent(final XMLObject xmlObject, final Element domElement)
- throws MarshallingException {
- // no content
- }
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/IDPSSODescriptorMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/IDPSSODescriptorMarshaller.java
index 61bc2890f..c80d28821 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/IDPSSODescriptorMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/IDPSSODescriptorMarshaller.java
@@ -21,26 +21,31 @@
package org.opensaml.saml.saml2.metadata.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
+import org.opensaml.core.xml.schema.XSBooleanValue;
import org.opensaml.saml.saml2.metadata.IDPSSODescriptor;
import org.w3c.dom.Element;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.metadata.IDPSSODescriptor} objects.
+ * A thread safe Marshaller for {@link IDPSSODescriptor} objects.
*/
public class IDPSSODescriptorMarshaller extends SSODescriptorMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final IDPSSODescriptor descriptor = (IDPSSODescriptor) samlObject;
+ final IDPSSODescriptor descriptor = (IDPSSODescriptor) xmlObject;
- if (descriptor.getWantAuthnRequestsSignedXSBoolean() != null) {
- domElement.setAttributeNS(null, IDPSSODescriptor.WANT_AUTHN_REQ_SIGNED_ATTRIB_NAME, descriptor
- .getWantAuthnRequestsSignedXSBoolean().toString());
+ final XSBooleanValue flag = descriptor.getWantAuthnRequestsSignedXSBoolean();
+ if (flag != null) {
+ domElement.setAttributeNS(null, IDPSSODescriptor.WANT_AUTHN_REQ_SIGNED_ATTRIB_NAME, flag.toString());
}
- super.marshallAttributes(samlObject, domElement);
+ super.marshallAttributes(xmlObject, domElement);
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/IndexedEndpointMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/IndexedEndpointMarshaller.java
index 52bb5cf5a..39d6e7253 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/IndexedEndpointMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/IndexedEndpointMarshaller.java
@@ -21,28 +21,36 @@
package org.opensaml.saml.saml2.metadata.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
+import org.opensaml.core.xml.io.MarshallingException;
+import org.opensaml.core.xml.schema.XSBooleanValue;
import org.opensaml.saml.saml2.metadata.IndexedEndpoint;
import org.w3c.dom.Element;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.metadata.IndexedEndpoint} objects.
+ * A thread safe Marshaller for {@link IndexedEndpoint} objects.
*/
public class IndexedEndpointMarshaller extends EndpointMarshaller {
/** {@inheritDoc} */
- public void marshallAttributes(final XMLObject samlObject, final Element domElement) {
- final IndexedEndpoint iEndpoint = (IndexedEndpoint) samlObject;
-
- if (iEndpoint.getIndex() != null) {
- domElement.setAttributeNS(null, IndexedEndpoint.INDEX_ATTRIB_NAME, iEndpoint.getIndex().toString());
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
+ throws MarshallingException {
+ final IndexedEndpoint iEndpoint = (IndexedEndpoint) xmlObject;
+
+ final Integer i = iEndpoint.getIndex();
+ if (i != null) {
+ domElement.setAttributeNS(null, IndexedEndpoint.INDEX_ATTRIB_NAME, i.toString());
}
- if (iEndpoint.isDefaultXSBoolean() != null) {
- domElement.setAttributeNS(null, IndexedEndpoint.IS_DEFAULT_ATTRIB_NAME, iEndpoint.isDefaultXSBoolean()
- .toString());
+ final XSBooleanValue flag = iEndpoint.isDefaultXSBoolean();
+ if (flag != null) {
+ domElement.setAttributeNS(null, IndexedEndpoint.IS_DEFAULT_ATTRIB_NAME, flag.toString());
}
- super.marshallAttributes(samlObject, domElement);
+ super.marshallAttributes(xmlObject, domElement);
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/KeyDescriptorMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/KeyDescriptorMarshaller.java
index 3096b4f09..eb090370c 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/KeyDescriptorMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/KeyDescriptorMarshaller.java
@@ -17,6 +17,8 @@
package org.opensaml.saml.saml2.metadata.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -25,17 +27,18 @@ import org.opensaml.security.credential.UsageType;
import org.w3c.dom.Element;
/**
- * A thread-safe marshaller for {@link org.opensaml.saml.saml2.metadata.KeyDescriptor}s.
+ * A thread-safe marshaller for {@link KeyDescriptor}s.
*/
public class KeyDescriptorMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
@Override
- protected void marshallAttributes(final XMLObject xmlObject, final Element domElement) throws MarshallingException {
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
+ throws MarshallingException {
final KeyDescriptor keyDescriptor = (KeyDescriptor) xmlObject;
- if (keyDescriptor.getUse() != null) {
- final UsageType use = keyDescriptor.getUse();
+ final UsageType use = keyDescriptor.getUse();
+ if (use != null) {
// UsageType enum contains more values than are allowed by SAML 2 schema
if (use.equals(UsageType.SIGNING) || use.equals(UsageType.ENCRYPTION)) {
domElement.setAttributeNS(null, KeyDescriptor.USE_ATTRIB_NAME, use.toString().toLowerCase());
@@ -47,4 +50,5 @@ public class KeyDescriptorMarshaller extends AbstractSAMLObjectMarshaller {
}
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/LocalizedNameMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/LocalizedNameMarshaller.java
index 5f8e63b91..5d8984f47 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/LocalizedNameMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/LocalizedNameMarshaller.java
@@ -21,6 +21,8 @@ import net.shibboleth.shared.xml.AttributeSupport;
import net.shibboleth.shared.xml.ElementSupport;
import net.shibboleth.shared.xml.XMLConstants;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.LangBearing;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
@@ -37,9 +39,10 @@ public class LocalizedNameMarshaller extends XSStringMarshaller {
/**
* {@inheritDoc}
*/
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final LocalizedName name = (LocalizedName) samlObject;
+ final LocalizedName name = (LocalizedName) xmlObject;
if (name.getXMLLang() != null) {
final Attr attribute = AttributeSupport.constructAttribute(domElement.getOwnerDocument(),
@@ -50,7 +53,8 @@ public class LocalizedNameMarshaller extends XSStringMarshaller {
}
/** {@inheritDoc} */
- protected void marshallElementContent(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallElementContent(@Nonnull final XMLObject samlObject, @Nonnull final Element domElement)
throws MarshallingException {
final LocalizedName name = (LocalizedName) samlObject;
@@ -58,4 +62,5 @@ public class LocalizedNameMarshaller extends XSStringMarshaller {
ElementSupport.appendTextContent(domElement, name.getValue());
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/LocalizedURIMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/LocalizedURIMarshaller.java
index c7814b71d..f5266c1f6 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/LocalizedURIMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/LocalizedURIMarshaller.java
@@ -21,6 +21,8 @@ import net.shibboleth.shared.xml.AttributeSupport;
import net.shibboleth.shared.xml.ElementSupport;
import net.shibboleth.shared.xml.XMLConstants;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.LangBearing;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
@@ -37,9 +39,10 @@ public class LocalizedURIMarshaller extends XSURIMarshaller {
/**
* {@inheritDoc}
*/
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final LocalizedURI name = (LocalizedURI) samlObject;
+ final LocalizedURI name = (LocalizedURI) xmlObject;
if (name.getXMLLang() != null) {
final Attr attribute = AttributeSupport.constructAttribute(domElement.getOwnerDocument(),
@@ -50,7 +53,8 @@ public class LocalizedURIMarshaller extends XSURIMarshaller {
}
/** {@inheritDoc} */
- protected void marshallElementContent(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallElementContent(@Nonnull final XMLObject samlObject, @Nonnull final Element domElement)
throws MarshallingException {
final LocalizedURI name = (LocalizedURI) samlObject;
@@ -58,4 +62,5 @@ public class LocalizedURIMarshaller extends XSURIMarshaller {
ElementSupport.appendTextContent(domElement, name.getURI());
}
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/OrganizationMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/OrganizationMarshaller.java
index cfa57f86d..8b21566a9 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/OrganizationMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/OrganizationMarshaller.java
@@ -21,6 +21,8 @@
package org.opensaml.saml.saml2.metadata.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.saml.common.AbstractSAMLObjectMarshaller;
@@ -28,16 +30,19 @@ import org.opensaml.saml.saml2.metadata.Organization;
import org.w3c.dom.Element;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.metadata.Organization} objects.
+ * A thread safe Marshaller for {@link Organization} objects.
*/
public class OrganizationMarshaller extends AbstractSAMLObjectMarshaller {
/**
* {@inheritDoc}
*/
- protected void marshallAttributes(final XMLObject xmlObject, final Element domElement) throws MarshallingException {
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
+ throws MarshallingException {
final Organization org = (Organization) xmlObject;
marshallUnknownAttributes(org, domElement);
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/PDPDescriptorMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/PDPDescriptorMarshaller.java
index 107b7832e..37c46ee6d 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/PDPDescriptorMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/PDPDescriptorMarshaller.java
@@ -21,8 +21,10 @@
package org.opensaml.saml.saml2.metadata.impl;
+import org.opensaml.saml.saml2.metadata.PDPDescriptor;
+
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.metadata.PDPDescriptor} objects.
+ * A thread safe Marshaller for {@link PDPDescriptor} objects.
*/
public class PDPDescriptorMarshaller extends RoleDescriptorMarshaller {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/RequestedAttributeMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/RequestedAttributeMarshaller.java
index de2e7354a..c5f81dc5c 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/RequestedAttributeMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/RequestedAttributeMarshaller.java
@@ -21,27 +21,32 @@
package org.opensaml.saml.saml2.metadata.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
+import org.opensaml.core.xml.schema.XSBooleanValue;
import org.opensaml.saml.saml2.core.impl.AttributeMarshaller;
import org.opensaml.saml.saml2.metadata.RequestedAttribute;
import org.w3c.dom.Element;
/**
- * A thread-safe Marshaller for {@link org.opensaml.saml.saml2.metadata.RequestedAttribute} objects.
+ * A thread-safe Marshaller for {@link RequestedAttribute} objects.
*/
public class RequestedAttributeMarshaller extends AttributeMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final RequestedAttribute requestedAttribute = (RequestedAttribute) samlObject;
+ final RequestedAttribute requestedAttribute = (RequestedAttribute) xmlObject;
- if (requestedAttribute.isRequiredXSBoolean() != null) {
- domElement.setAttributeNS(null, RequestedAttribute.IS_REQUIRED_ATTRIB_NAME, requestedAttribute
- .isRequiredXSBoolean().toString());
+ final XSBooleanValue flag = requestedAttribute.isRequiredXSBoolean();
+ if (flag != null) {
+ domElement.setAttributeNS(null, RequestedAttribute.IS_REQUIRED_ATTRIB_NAME, flag.toString());
}
- super.marshallAttributes(samlObject, domElement);
+ super.marshallAttributes(xmlObject, domElement);
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/RoleDescriptorMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/RoleDescriptorMarshaller.java
index c1c34ee29..963d4f776 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/RoleDescriptorMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/RoleDescriptorMarshaller.java
@@ -17,8 +17,12 @@
package org.opensaml.saml.saml2.metadata.impl;
+import java.time.Duration;
+import java.time.Instant;
import java.util.List;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.core.xml.util.XMLObjectSupport;
@@ -31,14 +35,15 @@ import org.w3c.dom.Element;
import net.shibboleth.shared.xml.AttributeSupport;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.metadata.RoleDescriptor} objects.
+ * A thread safe Marshaller for {@link RoleDescriptor} objects.
*/
public abstract class RoleDescriptorMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlElement, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final RoleDescriptor roleDescriptor = (RoleDescriptor) samlElement;
+ final RoleDescriptor roleDescriptor = (RoleDescriptor) xmlObject;
// Set the ID attribute
if (roleDescriptor.getID() != null) {
@@ -46,20 +51,20 @@ public abstract class RoleDescriptorMarshaller extends AbstractSAMLObjectMarshal
}
// Set the validUntil attribute
- if (roleDescriptor.getValidUntil() != null) {
- AttributeSupport.appendDateTimeAttribute(domElement, TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_QNAME,
- roleDescriptor.getValidUntil());
+ final Instant i = roleDescriptor.getValidUntil();
+ if (i != null) {
+ AttributeSupport.appendDateTimeAttribute(domElement, TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_QNAME, i);
}
// Set the cacheDuration attribute
- if (roleDescriptor.getCacheDuration() != null) {
- AttributeSupport.appendDurationAttribute(domElement, CacheableSAMLObject.CACHE_DURATION_ATTRIB_QNAME,
- roleDescriptor.getCacheDuration());
+ final Duration d = roleDescriptor.getCacheDuration();
+ if (d != null) {
+ AttributeSupport.appendDurationAttribute(domElement, CacheableSAMLObject.CACHE_DURATION_ATTRIB_QNAME, d);
}
// Set the protocolSupportEnumeration attribute
final List<String> supportedProtocols = roleDescriptor.getSupportedProtocols();
- if (supportedProtocols != null && supportedProtocols.size() > 0) {
+ if (supportedProtocols != null && !supportedProtocols.isEmpty()) {
final StringBuilder builder = new StringBuilder();
for (final String protocol : supportedProtocols) {
@@ -79,7 +84,8 @@ public abstract class RoleDescriptorMarshaller extends AbstractSAMLObjectMarshal
}
/** {@inheritDoc} */
- protected void marshallAttributeIDness(final XMLObject xmlObject, final Element domElement)
+ @Override
+ protected void marshallAttributeIDness(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
XMLObjectSupport.marshallAttributeIDness(null, RoleDescriptor.ID_ATTRIB_NAME, domElement, true);
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/SPSSODescriptorMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/SPSSODescriptorMarshaller.java
index 173bbbdab..cd6d01ede 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/SPSSODescriptorMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/SPSSODescriptorMarshaller.java
@@ -21,31 +21,36 @@
package org.opensaml.saml.saml2.metadata.impl;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.MarshallingException;
+import org.opensaml.core.xml.schema.XSBooleanValue;
import org.opensaml.saml.saml2.metadata.SPSSODescriptor;
import org.w3c.dom.Element;
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.metadata.SPSSODescriptor} objects.
+ * A thread safe Marshaller for {@link SPSSODescriptor} objects.
*/
public class SPSSODescriptorMarshaller extends SSODescriptorMarshaller {
/** {@inheritDoc} */
- protected void marshallAttributes(final XMLObject samlObject, final Element domElement)
+ @Override
+ protected void marshallAttributes(@Nonnull final XMLObject xmlObject, @Nonnull final Element domElement)
throws MarshallingException {
- final SPSSODescriptor descriptor = (SPSSODescriptor) samlObject;
+ final SPSSODescriptor descriptor = (SPSSODescriptor) xmlObject;
- if (descriptor.isAuthnRequestsSignedXSBoolean() != null) {
- domElement.setAttributeNS(null, SPSSODescriptor.AUTH_REQUESTS_SIGNED_ATTRIB_NAME, descriptor
- .isAuthnRequestsSignedXSBoolean().toString());
+ XSBooleanValue flag = descriptor.isAuthnRequestsSignedXSBoolean();
+ if (flag != null) {
+ domElement.setAttributeNS(null, SPSSODescriptor.AUTH_REQUESTS_SIGNED_ATTRIB_NAME, flag.toString());
}
- if (descriptor.getWantAssertionsSignedXSBoolean() != null) {
- domElement.setAttributeNS(null, SPSSODescriptor.WANT_ASSERTIONS_SIGNED_ATTRIB_NAME, descriptor
- .getWantAssertionsSignedXSBoolean().toString());
+ flag = descriptor.getWantAssertionsSignedXSBoolean();
+ if (flag != null) {
+ domElement.setAttributeNS(null, SPSSODescriptor.WANT_ASSERTIONS_SIGNED_ATTRIB_NAME, flag.toString());
}
- super.marshallAttributes(samlObject, domElement);
+ super.marshallAttributes(xmlObject, domElement);
}
+
}
\ No newline at end of file
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/SSODescriptorMarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/SSODescriptorMarshaller.java
index eab83ea86..6abb284b8 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/SSODescriptorMarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/metadata/impl/SSODescriptorMarshaller.java
@@ -17,8 +17,10 @@
package org.opensaml.saml.saml2.metadata.impl;
+import org.opensaml.saml.saml2.metadata.SSODescriptor;
+
/**
- * A thread safe Marshaller for {@link org.opensaml.saml.saml2.metadata.SSODescriptor} objects.
+ * A thread safe Marshaller for {@link SSODescriptor} objects.
*/
public abstract class SSODescriptorMarshaller extends RoleDescriptorMarshaller {
diff --git a/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/SPSSODescriptorChildElements.xml b/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/SPSSODescriptorChildElements.xml
index 6bf197644..cc7cae888 100644
--- a/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/SPSSODescriptorChildElements.xml
+++ b/opensaml-saml-impl/src/test/resources/org/opensaml/saml/saml2/metadata/impl/SPSSODescriptorChildElements.xml
@@ -29,5 +29,5 @@
<md:NameIDFormat />
<md:AssertionConsumerService />
<md:AssertionConsumerService />
- <md:AttributeConsumingService index="0" />
+ <md:AttributeConsumingService />
</md:SPSSODescriptor>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list