1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.opensaml.ws.wssecurity.impl;
18
19 import org.opensaml.ws.wssecurity.AttributedURI;
20 import org.opensaml.xml.XMLObject;
21 import org.opensaml.xml.io.MarshallingException;
22 import org.opensaml.xml.util.DatatypeHelper;
23 import org.opensaml.xml.util.XMLHelper;
24 import org.w3c.dom.Element;
25
26
27
28
29 public class AttributedURIMarshaller extends AbstractWSSecurityObjectMarshaller {
30
31
32 protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
33 AttributedURI attributedURI = (AttributedURI) xmlObject;
34
35 if (!DatatypeHelper.isEmpty(attributedURI.getWSUId())) {
36 XMLHelper.marshallAttribute(AttributedURI.WSU_ID_ATTR_NAME, attributedURI.getWSUId(), domElement, true);
37 }
38
39 XMLHelper.marshallAttributeMap(attributedURI.getUnknownAttributes(), domElement);
40
41 }
42
43
44 protected void marshallElementContent(XMLObject xmlObject, Element domElement) throws MarshallingException {
45 AttributedURI attributedURI = (AttributedURI) xmlObject;
46 XMLHelper.appendTextContent(domElement, attributedURI.getValue());
47 }
48
49 }