use of org.codehaus.jettison.badgerfish.BadgerFishXMLStreamWriter in project jersey by jersey.
the class Stax2JettisonFactory method createWriter.
public static XMLStreamWriter createWriter(final Writer writer, final JettisonConfig config) throws IOException {
switch(config.getNotation()) {
case BADGERFISH:
return new BadgerFishXMLStreamWriter(writer);
case MAPPED_JETTISON:
Configuration jmConfig;
if (null == config.getXml2JsonNs()) {
jmConfig = new Configuration();
} else {
jmConfig = new Configuration(config.getXml2JsonNs());
}
final MappedXMLStreamWriter result = new MappedXMLStreamWriter(new MappedNamespaceConvention(jmConfig), writer);
for (String array : config.getArrayElements()) {
result.serializeAsArray(array);
}
return result;
default:
return null;
}
}
Aggregations