From f71531346c6be197957311712ba093e024545e37 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Fri, 7 Aug 2015 13:24:09 +0200 Subject: preparing the old code for the merge --- .../core/impl/RequestedAttributeUnmarshaller.java | 98 +++++++++++----------- 1 file changed, 47 insertions(+), 51 deletions(-) (limited to 'id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/RequestedAttributeUnmarshaller.java') 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()); + } } - } } -- cgit v1.2.3