use of org.codehaus.jettison.mapped.MappedXMLInputFactory in project cxf by apache.
the class JSONUtils method createStreamReader.
public static XMLStreamReader createStreamReader(InputStream is, boolean readXsiType, ConcurrentHashMap<String, String> namespaceMap, String namespaceSeparator, List<String> primitiveArrayKeys, DocumentDepthProperties depthProps, String enc) throws Exception {
if (readXsiType) {
namespaceMap.putIfAbsent(XSI_URI, XSI_PREFIX);
}
Configuration conf = new Configuration(namespaceMap);
if (namespaceSeparator != null) {
conf.setJsonNamespaceSeparator(namespaceSeparator);
}
if (primitiveArrayKeys != null) {
conf.setPrimitiveArrayKeys(new HashSet<>(primitiveArrayKeys));
}
XMLInputFactory factory = depthProps != null ? new JettisonMappedReaderFactory(conf, depthProps) : new MappedXMLInputFactory(conf);
return new JettisonReader(namespaceMap, factory.createXMLStreamReader(is, enc));
}
Aggregations