Search in sources :

Example 1 with MappedXMLInputFactory

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));
}
Also used : Configuration(org.codehaus.jettison.mapped.Configuration) XMLInputFactory(javax.xml.stream.XMLInputFactory) BadgerFishXMLInputFactory(org.codehaus.jettison.badgerfish.BadgerFishXMLInputFactory) MappedXMLInputFactory(org.codehaus.jettison.mapped.MappedXMLInputFactory) MappedXMLInputFactory(org.codehaus.jettison.mapped.MappedXMLInputFactory)

Aggregations

XMLInputFactory (javax.xml.stream.XMLInputFactory)1 BadgerFishXMLInputFactory (org.codehaus.jettison.badgerfish.BadgerFishXMLInputFactory)1 Configuration (org.codehaus.jettison.mapped.Configuration)1 MappedXMLInputFactory (org.codehaus.jettison.mapped.MappedXMLInputFactory)1