1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.opensaml.saml2.metadata.impl;
18
19 import javax.xml.namespace.QName;
20
21 import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
22 import org.opensaml.saml2.metadata.Endpoint;
23 import org.opensaml.xml.XMLObject;
24 import org.opensaml.xml.io.UnmarshallingException;
25 import org.opensaml.xml.util.XMLHelper;
26 import org.w3c.dom.Attr;
27
28
29
30
31 public class EndpointUnmarshaller extends AbstractSAMLObjectUnmarshaller {
32
33
34 protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
35 Endpoint endpoint = (Endpoint) samlObject;
36
37 if (attribute.getLocalName().equals(Endpoint.BINDING_ATTRIB_NAME)) {
38 endpoint.setBinding(attribute.getValue());
39 } else if (attribute.getLocalName().equals(Endpoint.LOCATION_ATTRIB_NAME)) {
40 endpoint.setLocation(attribute.getValue());
41 } else if (attribute.getLocalName().equals(Endpoint.RESPONSE_LOCATION_ATTRIB_NAME)) {
42 endpoint.setResponseLocation(attribute.getValue());
43 } else {
44 QName attribQName = XMLHelper.getNodeQName(attribute);
45 if (attribute.isId()) {
46 endpoint.getUnknownAttributes().registerID(attribQName);
47 }
48 endpoint.getUnknownAttributes().put(attribQName, attribute.getValue());
49 }
50 }
51
52
53
54
55 protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
56 throws UnmarshallingException {
57 Endpoint endpoint = (Endpoint) parentSAMLObject;
58
59 endpoint.getUnknownXMLObjects().add(childSAMLObject);
60 }
61 }