1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.opensaml.ws.wstrust.impl;
19
20 import org.opensaml.ws.wstrust.BinaryExchange;
21 import org.opensaml.xml.XMLObject;
22 import org.opensaml.xml.io.UnmarshallingException;
23 import org.opensaml.xml.schema.impl.XSStringUnmarshaller;
24 import org.opensaml.xml.util.XMLHelper;
25 import org.w3c.dom.Attr;
26
27
28
29
30
31
32
33 public class BinaryExchangeUnmarshaller extends XSStringUnmarshaller {
34
35
36 protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
37 BinaryExchange binaryExchange = (BinaryExchange) xmlObject;
38
39 String attrName = attribute.getLocalName();
40 if (BinaryExchange.VALUE_TYPE_ATTRIB_NAME.equals(attrName)) {
41 binaryExchange.setValueType(attribute.getValue());
42 } else if (BinaryExchange.ENCODING_TYPE_ATTRIB_NAME.equals(attrName)) {
43 binaryExchange.setEncodingType(attribute.getValue());
44 } else {
45 XMLHelper.unmarshallToAttributeMap(binaryExchange.getUnknownAttributes(), attribute);
46 }
47 }
48
49 }