if (writeXsiType) {
namespaceMap.putIfAbsent(XSI_URI, XSI_PREFIX);
}
Configuration c = new Configuration(namespaceMap);
MappedNamespaceConvention convention = new MappedNamespaceConvention(c);
AbstractXMLStreamWriter xsw = new MappedXMLStreamWriter(
convention,
new OutputStreamWriter(os, UTF8));
if (serializeAsArray) {
if (arrayKeys != null) {
for (String key : arrayKeys) {
xsw.seriliazeAsArray(key);
}
} else {
String key = getKey(convention, qname);
xsw.seriliazeAsArray(key);
}
}
XMLStreamWriter writer = !writeXsiType || dropRootElement
? new IgnoreContentJettisonWriter(xsw, writeXsiType,
dropRootElement ? qname : null) : xsw;