aboutsummaryrefslogtreecommitdiff
path: root/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeUnmarshaller.java
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeUnmarshaller.java')
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeUnmarshaller.java98
1 files changed, 47 insertions, 51 deletions
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeUnmarshaller.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeUnmarshaller.java
index c07f852d9..098ece427 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeUnmarshaller.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeUnmarshaller.java
@@ -33,64 +33,60 @@ import eu.stork.peps.auth.engine.core.SAMLCore;
*
* @author fjquevedo
*/
-public class RequestedAttributeUnmarshaller extends
- AbstractSAMLObjectUnmarshaller {
+public class RequestedAttributeUnmarshaller extends AbstractSAMLObjectUnmarshaller {
- /**
- * Process child element.
- *
- * @param parentSAMLObject parent SAMLObject
- * @param childSAMLObject child SAMLObject
- *
- * @throws UnmarshallingException error at unmarshall XML object
- */
- protected final void processChildElement(final XMLObject parentSAMLObject,
- final XMLObject childSAMLObject) throws UnmarshallingException {
+ /**
+ * Process child element.
+ *
+ * @param parentSAMLObject
+ * parent SAMLObject
+ * @param childSAMLObject
+ * child SAMLObject
+ *
+ * @throws UnmarshallingException
+ * error at unmarshall XML object
+ */
+ protected final void processChildElement(final XMLObject parentSAMLObject, final XMLObject childSAMLObject) throws UnmarshallingException {
- final RequestedAttribute requestedAttr = (RequestedAttribute) parentSAMLObject;
+ final RequestedAttribute requestedAttr = (RequestedAttribute) parentSAMLObject;
- final QName childQName = childSAMLObject.getElementQName();
- if (childQName.getLocalPart().equals("AttributeValue")
- && childQName.getNamespaceURI().equals(SAMLCore.STORK10_NS.getValue())) {
- requestedAttr.getAttributeValues().add(childSAMLObject);
- } else {
- super.processChildElement(parentSAMLObject, childSAMLObject);
+ final QName childQName = childSAMLObject.getElementQName();
+ if (childQName.getLocalPart().equals("AttributeValue") && childQName.getNamespaceURI().equals(SAMLCore.STORK10_NS.getValue())) {
+ requestedAttr.getAttributeValues().add(childSAMLObject);
+ } else {
+ super.processChildElement(parentSAMLObject, childSAMLObject);
+ }
}
- }
- /**
- * Process attribute.
- *
- * @param samlObject the SAML object
- * @param attribute the attribute
- * @throws UnmarshallingException the unmarshalling exception
- */
- protected final void processAttribute(final XMLObject samlObject,
- final Attr attribute) throws UnmarshallingException {
+ /**
+ * Process attribute.
+ *
+ * @param samlObject
+ * the SAML object
+ * @param attribute
+ * the attribute
+ * @throws UnmarshallingException
+ * the unmarshalling exception
+ */
+ protected final void processAttribute(final XMLObject samlObject, final Attr attribute) throws UnmarshallingException {
- final RequestedAttribute requestedAttr = (RequestedAttribute) samlObject;
+ final RequestedAttribute requestedAttr = (RequestedAttribute) samlObject;
- if (attribute.getLocalName()
- .equals(RequestedAttribute.NAME_ATTRIB_NAME)) {
- requestedAttr.setName(attribute.getValue());
- } else if (attribute.getLocalName().equals(
- RequestedAttribute.NAME_FORMAT_ATTR)) {
- requestedAttr.setNameFormat(attribute.getValue());
- } else if (attribute.getLocalName().equals(
- RequestedAttribute.FRIENDLY_NAME_ATT)) {
- requestedAttr.setFriendlyName(attribute.getValue());
- } else if (attribute.getLocalName().equals(
- RequestedAttribute.IS_REQUIRED_ATTR)) {
- requestedAttr.setIsRequired(attribute
- .getValue());
+ if (attribute.getLocalName().equals(RequestedAttribute.NAME_ATTRIB_NAME)) {
+ requestedAttr.setName(attribute.getValue());
+ } else if (attribute.getLocalName().equals(RequestedAttribute.NAME_FORMAT_ATTR)) {
+ requestedAttr.setNameFormat(attribute.getValue());
+ } else if (attribute.getLocalName().equals(RequestedAttribute.FRIENDLY_NAME_ATT)) {
+ requestedAttr.setFriendlyName(attribute.getValue());
+ } else if (attribute.getLocalName().equals(RequestedAttribute.IS_REQUIRED_ATTR)) {
+ requestedAttr.setIsRequired(attribute.getValue());
- } else {
- final QName attribQName = XMLHelper.getNodeQName(attribute);
- if (attribute.isId()) {
- requestedAttr.getUnknownAttributes().registerID(attribQName);
- }
- requestedAttr.getUnknownAttributes().put(attribQName,
- attribute.getValue());
+ } else {
+ final QName attribQName = XMLHelper.getNodeQName(attribute);
+ if (attribute.isId()) {
+ requestedAttr.getUnknownAttributes().registerID(attribQName);
+ }
+ requestedAttr.getUnknownAttributes().put(attribQName, attribute.getValue());
+ }
}
- }
}