}
}
private static void writeAttributes(XMLStreamWriter writer, Map<String, Object> attributes) throws XMLStreamException {
for (Entry<String, Object> entry : attributes.entrySet()) {
AttributeValue attval = AttributeValue.create(entry.getValue());
writer.writeStartElement(Element.ATTRIBUTE.getLocalName());
writer.writeAttribute(Attribute.NAME.getLocalName(), entry.getKey());
if (attval.isListType()) {
writer.writeAttribute(Attribute.VALUE.getLocalName(), attval.getValueString());
writer.writeAttribute(Attribute.TYPE.getLocalName(), "List<" + attval.getType() + ">");
} else {
writer.writeAttribute(Attribute.VALUE.getLocalName(), attval.getValueString());
if (attval.getType() != AttributeValueHandler.Type.String) {
writer.writeAttribute(Attribute.TYPE.getLocalName(), attval.getType().toString());
}
}
writer.writeEndElement();
}
}