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