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.core.impl;
22
23 import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
24 import org.opensaml.saml2.core.Attribute;
25 import org.opensaml.saml2.core.AttributeStatement;
26 import org.opensaml.saml2.core.EncryptedAttribute;
27 import org.opensaml.xml.XMLObject;
28 import org.opensaml.xml.io.UnmarshallingException;
29
30
31
32
33 public class AttributeStatementUnmarshaller extends AbstractSAMLObjectUnmarshaller {
34
35
36 protected void processChildElement(XMLObject parentObject, XMLObject childObject) throws UnmarshallingException {
37 AttributeStatement attributeStatement = (AttributeStatement) parentObject;
38
39 if (childObject instanceof Attribute) {
40 attributeStatement.getAttributes().add((Attribute) childObject);
41 } else if (childObject instanceof EncryptedAttribute) {
42 attributeStatement.getEncryptedAttributes().add((EncryptedAttribute) childObject);
43 } else {
44 super.processChildElement(parentObject, childObject);
45 }
46 }
47 }