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.AttributedString;
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 AttributedStringMarshaller extends AbstractWSSecurityObjectMarshaller {
30
31
32 protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
33 AttributedString attributedString = (AttributedString) xmlObject;
34
35 if (!DatatypeHelper.isEmpty(attributedString.getWSUId())) {
36 XMLHelper.marshallAttribute(AttributedString.WSU_ID_ATTR_NAME, attributedString.getWSUId(), domElement, true);
37 }
38
39 XMLHelper.marshallAttributeMap(attributedString.getUnknownAttributes(), domElement);
40
41 }
42
43
44 protected void marshallElementContent(XMLObject xmlObject, Element domElement) throws MarshallingException {
45 AttributedString attributedString = (AttributedString) xmlObject;
46 XMLHelper.appendTextContent(domElement, attributedString.getValue());
47 }
48
49 }