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.SubjectType;
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 SubjectTypeUnmarshaller extends AbstractXMLObjectUnmarshaller {
30
31
32 public SubjectTypeUnmarshaller() {
33 super();
34 }
35
36
37
38
39
40
41
42
43
44 protected SubjectTypeUnmarshaller(String targetNamespaceURI, String targetLocalName) {
45 super(targetNamespaceURI, targetLocalName);
46 }
47
48
49 protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
50 SubjectType attrib = (SubjectType) samlObject;
51 if (attribute.getLocalName().equals(SubjectType.SUBJECT_CATEGORY_ATTTRIB_NAME)) {
52 attrib.setSubjectCategory(attribute.getValue());
53 }
54 }
55
56
57 protected void processChildElement(XMLObject parentObject, XMLObject childObject) throws UnmarshallingException {
58 SubjectType subject = (SubjectType) parentObject;
59 if (childObject instanceof AttributeType) {
60 subject.getAttributes().add((AttributeType) childObject);
61 }
62 }
63
64
65 protected void processElementContent(XMLObject xmlObject, String elementContent) {
66 }
67 }