1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.opensaml.saml2.metadata.impl;
22
23 import org.opensaml.saml2.core.impl.AttributeUnmarshaller;
24 import org.opensaml.saml2.metadata.RequestedAttribute;
25 import org.opensaml.xml.XMLObject;
26 import org.opensaml.xml.io.UnmarshallingException;
27 import org.opensaml.xml.schema.XSBooleanValue;
28 import org.w3c.dom.Attr;
29
30
31
32
33 public class RequestedAttributeUnmarshaller extends AttributeUnmarshaller {
34
35
36 protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
37 RequestedAttribute requestedAttribute = (RequestedAttribute) samlObject;
38 if (attribute.getLocalName().equals(RequestedAttribute.IS_REQUIRED_ATTRIB_NAME)) {
39 requestedAttribute.setIsRequired(XSBooleanValue.valueOf(attribute.getValue()));
40 } else {
41 super.processAttribute(samlObject, attribute);
42 }
43 }
44 }