1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package edu.internet2.middleware.shibboleth.common.xmlobject.impl;
19
20 import org.opensaml.xml.XMLObject;
21 import org.opensaml.xml.io.AbstractXMLObjectUnmarshaller;
22 import org.opensaml.xml.io.UnmarshallingException;
23 import org.slf4j.Logger;
24 import org.slf4j.LoggerFactory;
25 import org.w3c.dom.Attr;
26
27 import edu.internet2.middleware.shibboleth.common.xmlobject.ShibbolethMetadataScope;
28
29
30
31
32 public class ShibbolethMetadataScopeUnmarshaller extends AbstractXMLObjectUnmarshaller {
33
34
35 private final Logger log = LoggerFactory.getLogger(ShibbolethMetadataScopeUnmarshaller.class);
36
37
38 protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
39 ShibbolethMetadataScope scope = (ShibbolethMetadataScope) xmlObject;
40
41 if (attribute.getLocalName().equals(ShibbolethMetadataScope.REGEXP_ATTRIB_NAME)) {
42 scope.setRegexp(Boolean.valueOf(attribute.getValue()));
43 } else {
44 log.debug("Ignorning unknown attribute {}", attribute.getLocalName());
45 }
46
47 }
48
49
50 protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
51 throws UnmarshallingException {
52 log.debug("Ignorning unknown child element {}", childXMLObject.getElementQName());
53 }
54
55
56 protected void processElementContent(XMLObject xmlObject, String elementContent) {
57 ShibbolethMetadataScope scope = (ShibbolethMetadataScope) xmlObject;
58 scope.setValue(elementContent);
59 }
60
61 }