1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.opensaml.saml1.core.impl;
18
19 import org.opensaml.saml1.core.AttributeDesignator;
20 import org.opensaml.saml1.core.AttributeQuery;
21 import org.opensaml.xml.XMLObject;
22 import org.opensaml.xml.io.UnmarshallingException;
23 import org.w3c.dom.Attr;
24
25
26
27
28 public class AttributeQueryUnmarshaller extends SubjectQueryUnmarshaller {
29
30
31 protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
32 throws UnmarshallingException {
33
34 AttributeQuery attributeQuery = (AttributeQuery) parentSAMLObject;
35
36 if (childSAMLObject instanceof AttributeDesignator) {
37 attributeQuery.getAttributeDesignators().add((AttributeDesignator) childSAMLObject);
38 } else {
39 super.processChildElement(parentSAMLObject, childSAMLObject);
40 }
41 }
42
43
44 protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
45
46 AttributeQuery attributeQuery = (AttributeQuery) samlObject;
47
48 if (attribute.getLocalName().equals(AttributeQuery.RESOURCE_ATTRIB_NAME)) {
49 attributeQuery.setResource(attribute.getValue());
50 } else {
51 super.processAttribute(samlObject, attribute);
52 }
53 }
54 }