Package com.thoughtworks.xstream.io.xml

Examples of com.thoughtworks.xstream.io.xml.QNameMap


        if(! MessageProperties.CONTENT_TYPE_JSON.equalsIgnoreCase(contentType))
            throw new MessageConversionException("Cannot understand a message of type "+contentType);

        try {
            ByteArrayInputStream inStream = new ByteArrayInputStream(body);
            StaxReader reader = new StaxReader(new QNameMap(), this.inputFactory.createXMLStreamReader(inStream, messageEncoding));
            return this.objectMapper.unmarshal(reader);
        } catch (XMLStreamException ex) {
            String typeId = (String) messageProperties.getHeaders().get(DefaultClassMapper.DEFAULT_CLASSID_FIELD_NAME);
            LOG.error("XMLStreamException trying to unmarshal message of type {}", typeId, ex);
            throw new MessageConversionException("Could not unmarshal message of type "+typeId, ex);
View Full Code Here


        updateCharactorEncodingInfo(exchange);
        if (getXstreamDriver() != null) {
            return getXstreamDriver().createWriter(stream);
        }
        XMLStreamWriter xmlWriter = getStaxConverter().createXMLStreamWriter(stream, exchange);
        return new StaxWriter(new QNameMap(), xmlWriter);
    }
View Full Code Here

        updateCharactorEncodingInfo(exchange);
        if (getXstreamDriver() != null) {
            return getXstreamDriver().createReader(stream);
        }
        XMLStreamReader xmlReader = getStaxConverter().createXMLStreamReader(stream, exchange);
        return new StaxReader(new QNameMap(), xmlReader);
    }
View Full Code Here

        xs.setMode(XStream.NO_REFERENCES);
        return xs;
    }

    protected HierarchicalStreamWriter createHierarchicalStreamWriter(Exchange exchange, Object body, OutputStream stream) throws XMLStreamException {       
        return new StaxWriter(new QNameMap(), mof.createXMLStreamWriter(stream));
    }
View Full Code Here

    protected HierarchicalStreamWriter createHierarchicalStreamWriter(Exchange exchange, Object body, OutputStream stream) throws XMLStreamException {       
        return new StaxWriter(new QNameMap(), mof.createXMLStreamWriter(stream));
    }

    protected HierarchicalStreamReader createHierarchicalStreamReader(Exchange exchange, InputStream stream) throws XMLStreamException {       
        return new StaxReader(new QNameMap(), mif.createXMLStreamReader(stream));
    }
View Full Code Here

  private List<Class> typesToEnhance = new ArrayList<Class>();

  private List<String> names = new ArrayList<String>();

  public XmlMediaType(Enhancer enhancer) {
    QNameMap qnameMap = new QNameMap();
    QName qname = new QName("http://www.w3.org/2005/Atom", "atom");
    qnameMap.registerMapping(qname, DefaultRelation.class);
    // we need the replacer because
    // xstream replaces an _ with __ (two underscore) more information at
    // http://xstream.codehaus.org/faq.html#XML_double_underscores
    XmlFriendlyReplacer replacer = new XmlFriendlyReplacer("$", "_");
    helper = new XStreamHelper(new StaxDriver(qnameMap, replacer), enhancer);
View Full Code Here

TOP

Related Classes of com.thoughtworks.xstream.io.xml.QNameMap

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.