1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.opensaml.xacml.policy.impl;
20
21 import org.opensaml.xacml.policy.AttributeAssignmentType;
22 import org.opensaml.xml.XMLObject;
23 import org.opensaml.xml.io.MarshallingException;
24 import org.opensaml.xml.util.DatatypeHelper;
25 import org.w3c.dom.Element;
26
27
28 public class AttributeAssignmentTypeMarshaller extends AttributeValueTypeMarshaller {
29
30
31 public AttributeAssignmentTypeMarshaller() {
32 super();
33 }
34
35
36 protected void marshallElementContent(XMLObject samlObject, Element domElement) throws MarshallingException {
37 super.marshallElementContent(samlObject, domElement);
38 }
39
40
41 protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException {
42 AttributeAssignmentType attributeAssignment = (AttributeAssignmentType) samlElement;
43
44 if (!DatatypeHelper.isEmpty(attributeAssignment.getAttributeId())) {
45 domElement.setAttributeNS(null, AttributeAssignmentType.ATTR_ID_ATTRIB_NAME, attributeAssignment
46 .getAttributeId());
47 }
48 if(!DatatypeHelper.isEmpty(attributeAssignment.getDataType())){
49 super.marshallAttributes(samlElement, domElement);
50 }
51
52 }
53 }