1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.opensaml.xacml.ctx.impl;
20
21 import org.opensaml.xacml.ctx.AttributeType;
22 import org.opensaml.xml.XMLObject;
23 import org.opensaml.xml.io.AbstractXMLObjectMarshaller;
24 import org.opensaml.xml.io.MarshallingException;
25 import org.w3c.dom.Element;
26
27
28 public class AttributeTypeMarshaller extends AbstractXMLObjectMarshaller {
29
30
31 public AttributeTypeMarshaller() {
32 super();
33 }
34
35
36
37
38
39
40
41
42
43 protected AttributeTypeMarshaller(String targetNamespaceURI, String targetLocalName) {
44 super(targetNamespaceURI, targetLocalName);
45 }
46
47
48 protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException {
49 AttributeType attribute = (AttributeType) samlElement;
50
51 if (attribute.getIssuer() != null) {
52 domElement.setAttributeNS(null, AttributeType.ISSUER_ATTRIB_NAME, attribute.getIssuer());
53 }
54
55 if (attribute.getDataType() != null) {
56 domElement.setAttributeNS(null, AttributeType.DATATYPE_ATTRIB_NAME, attribute.getDataType());
57 }
58
59 if (attribute.getAttributeID() != null) {
60 domElement.setAttributeNS(null, AttributeType.ATTRIBUTEID_ATTTRIB_NAME, attribute.getAttributeID());
61 }
62 }
63
64
65 protected void marshallElementContent(XMLObject xmlObject, Element domElement) throws MarshallingException {
66 }
67 }