1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.opensaml.xacml.ctx.impl;
20
21 import org.opensaml.xacml.ctx.AttributeType;
22 import org.opensaml.xacml.ctx.AttributeValueType;
23 import org.opensaml.xml.XMLObject;
24 import org.opensaml.xml.io.AbstractXMLObjectUnmarshaller;
25 import org.opensaml.xml.io.UnmarshallingException;
26 import org.w3c.dom.Attr;
27
28
29 public class AttributeTypeUnmarshaller extends AbstractXMLObjectUnmarshaller {
30
31
32 public AttributeTypeUnmarshaller() {
33 super();
34 }
35
36
37
38
39
40
41
42
43
44 protected AttributeTypeUnmarshaller(String targetNamespaceURI, String targetLocalName) {
45 super(targetNamespaceURI, targetLocalName);
46 }
47
48
49 protected void processChildElement(XMLObject parentObject, XMLObject childObject) throws UnmarshallingException {
50 AttributeType attribute = (AttributeType) parentObject;
51
52 if (childObject instanceof AttributeValueType) {
53 attribute.getAttributeValues().add((AttributeValueType)childObject);
54 }
55 }
56
57
58 protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
59
60 AttributeType attrib = (AttributeType) samlObject;
61
62 if (attribute.getLocalName().equals(AttributeType.ATTRIBUTEID_ATTTRIB_NAME)) {
63 attrib.setAttributeID(attribute.getValue());
64 } else if (attribute.getLocalName().equals(AttributeType.DATATYPE_ATTRIB_NAME)) {
65 attrib.setDataType(attribute.getValue());
66 } else if (attribute.getLocalName().equals(AttributeType.ISSUER_ATTRIB_NAME)) {
67 attrib.setIssuer(attribute.getValue());
68 }
69 }
70
71
72 protected void processElementContent(XMLObject xmlObject, String elementContent) {
73
74 }
75 }