Package com.fasterxml.jackson.xml

Examples of com.fasterxml.jackson.xml.XmlMapper


   * @param rp
   * @return
   */
  public String getFeeds(ResponsePojo rp) {
    String xml = null;
    XmlMapper mapper = new XmlMapper();
    AnnotationIntrospector ai = new JaxbAnnotationIntrospector();
    // make deserializer use JAXB annotations (only)
    mapper.getDeserializationConfig().setAnnotationIntrospector(ai);
      // make serializer use JAXB annotations (only)
      mapper.getSerializationConfig().setAnnotationIntrospector(ai);
    try {
      xml = mapper.writeValueAsString(rp);
    } catch (Exception ex) {
     
    }
    return xml;
  }
View Full Code Here


      throws Exception {
   
    response.setContentType(getContentType());
    response.setCharacterEncoding(request.getCharacterEncoding());
   
    XmlMapper mapper = new XmlMapper();
    mapper.configure(Feature.AUTO_CLOSE_TARGET, false);
    mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
    mapper.configure(ToXmlGenerator.Feature.WRITE_XML_DECLARATION, true);
    mapper.writeValue(response.getOutputStream(), filterModel(model));
  }
View Full Code Here

TOP

Related Classes of com.fasterxml.jackson.xml.XmlMapper

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.