Package org.codehaus.jettison.mapped

Examples of org.codehaus.jettison.mapped.Configuration


        boolean readNullAsString,
        DocumentDepthProperties depthProps) throws Exception {
        if (readXsiType) {
            namespaceMap.putIfAbsent(XSI_URI, XSI_PREFIX);
        }
        Configuration conf = new Configuration(namespaceMap);
        if (primitiveArrayKeys != null) {
            conf.setPrimitiveArrayKeys(
                new HashSet<String>(primitiveArrayKeys));
        }
        conf.setReadNullAsEmptyString(readNullAsString);
        XMLInputFactory factory = depthProps != null
            ? new JettisonMappedReaderFactory(conf, depthProps)
            : new MappedXMLInputFactory(conf);
        return new JettisonReader(namespaceMap, factory.createXMLStreamReader(is));
    }
View Full Code Here


        }
        if (BADGER_FISH_CONVENTION.equals(convention)) {
            return JSONUtils.createBadgerFishWriter(os);
        }
       
        Configuration config =
            JSONUtils.createConfiguration(namespaceMap,
                                          writeXsiType && !ignoreNamespaces,
                                          attributesToElements,
                                          typeConverter);
       
View Full Code Here

        QName qname = actualClass == Document.class ? null : getQName(actualClass, genericType, actualObject);
        if (qname != null && ignoreNamespaces && (isCollection || dropRootNeeded)) {       
            qname = new QName(qname.getLocalPart());
        }
       
        Configuration config =
            JSONUtils.createConfiguration(namespaceMap,
                                          writeXsiType && !ignoreNamespaces,
                                          attributesToElements,
                                          typeConverter);
        if (!dropElementsInXmlStream && super.outDropElements != null) {
            config.setIgnoredElements(outDropElements);
        }
        if (!writeNullAsString) {
            config.setWriteNullAsString(writeNullAsString);
        }
       
        boolean dropRootInJsonStream = dropRootElement && !dropElementsInXmlStream;
        if (dropRootInJsonStream) {
            config.setDropRootElement(true);
        }
        if (ignoreNamespaces && serializeAsArray && (arrayKeys == null || dropRootInJsonStream)) {
            if (arrayKeys == null) {
                arrayKeys = new LinkedList<String>();
            } else if (dropRootInJsonStream) {
View Full Code Here

        }
        if (BADGER_FISH_CONVENTION.equals(convention)) {
            return JSONUtils.createBadgerFishWriter(os);
        }
       
        Configuration config =
            JSONUtils.createConfiguration(namespaceMap,
                                          writeXsiType && !ignoreNamespaces,
                                          attributesToElements,
                                          typeConverter);
       
View Full Code Here

        }
        if (BADGER_FISH_CONVENTION.equals(convention)) {
            return JSONUtils.createBadgerFishWriter(os);
        }
       
        Configuration config =
            JSONUtils.createConfiguration(namespaceMap,
                                          writeXsiType && !ignoreNamespaces,
                                          attributesToElements,
                                          typeConverter);
       
View Full Code Here

                                                    boolean attributesAsElements,
                                                    TypeConverter converter) {
        if (writeXsiType) {
            namespaceMap.putIfAbsent(XSI_URI, XSI_PREFIX);
        }
        Configuration c = new Configuration(namespaceMap);
        c.setSupressAtAttributes(attributesAsElements);
        if (converter != null) {
            c.setTypeConverter(converter);
        }
        return c;
    }
View Full Code Here

    private static class JettisonMappedReaderFactory extends AbstractXMLInputFactory {
        private static final int INPUT_BUF_SIZE = 4096;
        private MappedNamespaceConvention convention;
        private DocumentDepthProperties depthProps;
        public JettisonMappedReaderFactory(Map<?, ?> nstojns, DocumentDepthProperties depthProps) {
            convention = new MappedNamespaceConvention(new Configuration(nstojns));
            this.depthProps = depthProps;
        }
View Full Code Here

    }

    @Override
    protected XMLStreamWriter createStreamWriter(QName typeQName, OutputStream os) throws Exception {
       
        Configuration config =
            JSONUtils.createConfiguration(namespaceMap,
                                          writeXsiType && !ignoreNamespaces, false, null);
        XMLStreamWriter writer = JSONUtils.createStreamWriter(os, typeQName,
             writeXsiType && !ignoreNamespaces, config, serializeAsArray, arrayKeys, dropRootElement);
        return JSONUtils.createIgnoreNsWriterIfNeeded(writer, ignoreNamespaces);
View Full Code Here

        QName qname = actualClass == Document.class ? null : getQName(actualClass, genericType, actualObject);
        if (qname != null && ignoreNamespaces && (isCollection || dropRootNeeded)) {       
            qname = new QName(qname.getLocalPart());
        }
       
        Configuration config =
            JSONUtils.createConfiguration(namespaceMap,
                                          writeXsiType && !ignoreNamespaces,
                                          attributesToElements,
                                          typeConverter);
        if (!dropElementsInXmlStream && super.outDropElements != null) {
            config.setIgnoredElements(outDropElements);
        }
        if (!writeNullAsString) {
            config.setWriteNullAsString(writeNullAsString);
        }
       
        boolean dropRootInJsonStream = dropRootElement && !dropElementsInXmlStream;
        if (dropRootInJsonStream) {
            config.setDropRootElement(true);
        }
        if (ignoreNamespaces && serializeAsArray && (arrayKeys == null || dropRootInJsonStream)) {
            if (arrayKeys == null) {
                arrayKeys = new LinkedList<String>();
            } else if (dropRootInJsonStream) {
View Full Code Here

                                                    boolean attributesAsElements,
                                                    TypeConverter converter) {
        if (writeXsiType) {
            namespaceMap.putIfAbsent(XSI_URI, XSI_PREFIX);
        }
        Configuration c = new Configuration(namespaceMap);
        c.setSupressAtAttributes(attributesAsElements);
        if (converter != null) {
            c.setTypeConverter(converter);
        }
        return c;
    }
View Full Code Here

TOP

Related Classes of org.codehaus.jettison.mapped.Configuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.