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.ActionType;
22 import org.opensaml.xacml.ctx.EnvironmentType;
23 import org.opensaml.xacml.ctx.RequestType;
24 import org.opensaml.xacml.ctx.ResourceType;
25 import org.opensaml.xacml.ctx.SubjectType;
26 import org.opensaml.xml.XMLObject;
27 import org.opensaml.xml.io.AbstractXMLObjectUnmarshaller;
28 import org.opensaml.xml.io.UnmarshallingException;
29 import org.w3c.dom.Attr;
30
31
32 public class RequestTypeUnmarshaller extends AbstractXMLObjectUnmarshaller {
33
34
35 public RequestTypeUnmarshaller() {
36 super();
37 }
38
39
40
41
42
43
44
45
46
47 protected RequestTypeUnmarshaller(String targetNamespaceURI, String targetLocalName) {
48 super(targetNamespaceURI, targetLocalName);
49 }
50
51
52 protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
53 throws UnmarshallingException {
54 RequestType request = (RequestType) parentSAMLObject;
55
56 if (childSAMLObject instanceof ActionType) {
57 request.setAction((ActionType) childSAMLObject);
58 } else if (childSAMLObject instanceof EnvironmentType) {
59 request.setEnvironment((EnvironmentType) childSAMLObject);
60 } else if (childSAMLObject instanceof SubjectType) {
61 request.getSubjects().add((SubjectType) childSAMLObject);
62 } else if (childSAMLObject instanceof ResourceType) {
63 request.getResources().add((ResourceType) childSAMLObject);
64 }
65 }
66
67
68 protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
69 }
70
71
72 protected void processElementContent(XMLObject xmlObject, String elementContent) {
73 }
74 }