Package org.codehaus.jettison.mapped

Examples of org.codehaus.jettison.mapped.Configuration


    /**
     * Construct a JettisonMappedXmlDriver.
     */
    public JettisonMappedXmlDriver() {
        this(new Configuration());
    }
View Full Code Here


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

        if (!InjectionUtils.isSupportedCollectionOrArray(type)) {
            qname = getQName(type);
        } else {
            qname = getQName(InjectionUtils.getActualType(genericType));
        }
        Configuration config =
            JSONUtils.createConfiguration(namespaceMap, writeXsiType && !ignoreNamespaces, null);
        XMLStreamWriter writer = JSONUtils.createStreamWriter(os, qname,
             writeXsiType && !ignoreNamespaces, config, serializeAsArray, arrayKeys, dropRootElement);
        writer = JSONUtils.createIgnoreMixedContentWriterIfNeeded(writer, ignoreMixedContent);
        return JSONUtils.createIgnoreNsWriterIfNeeded(writer, ignoreNamespaces);
View Full Code Here

    }

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

            return JSONUtils.createBadgerFishWriter(os);
        }
       
        QName qname = getQName(actualClass, genericType, actualObject, true);
       
        Configuration config =
            JSONUtils.createConfiguration(namespaceMap, writeXsiType && !ignoreNamespaces, typeConverter);
       
        XMLStreamWriter writer = JSONUtils.createStreamWriter(os, qname,
             writeXsiType && !ignoreNamespaces, config, serializeAsArray, arrayKeys,
             isCollection || dropRootElement);
View Full Code Here

            case MAPPED:
                return JsonXmlStreamWriter.createWriter(writer, config, JSONHelper.getRootElementName((Class<Object>) expectedType));
            case BADGERFISH:
                return new BadgerFishXMLStreamWriter(writer);
            case MAPPED_JETTISON:
                Configuration jmConfig;
                if (null == config.getXml2JsonNs()) {
                    jmConfig = new Configuration();
                } else {
                    jmConfig = new Configuration(config.getXml2JsonNs());
                }
                return new MappedXMLStreamWriter(new MappedNamespaceConvention(jmConfig), writer);
            default:
                return null;
        }
View Full Code Here

            case NATURAL:
            case MAPPED:
                return JsonXmlStreamReader.create(nonEmptyReader, config, rootName, expectedType, jaxbContext, readingList);
            case MAPPED_JETTISON:
                try {
                    Configuration jmConfig;
                    if (null == config.getXml2JsonNs()) {
                        jmConfig = new Configuration();
                    } else {
                        jmConfig = new Configuration(config.getXml2JsonNs());
                    }
                    return new MappedXMLStreamReader(
                            new JSONObject(new JSONTokener(ReaderWriter.readFromAsString(nonEmptyReader))),
                            new MappedNamespaceConvention(jmConfig));
                } catch (Exception ex) {
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

        List<String> primitiveArrayKeys,
        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));
        }
       
        XMLInputFactory factory = depthProps != null
            ? new JettisonMappedReaderFactory(conf, depthProps)
View Full Code Here

        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);
        }
        if (ignoreEmptyArrayValues) {
            config.setIgnoreEmptyArrayValues(ignoreEmptyArrayValues);
        }
       
       
        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

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.