XStream perfectly transforms XML, JSON

Source: Internet
Author: User

XStream is a simple library to serialize objects to XML and back again.

Features
  • Ease of use. A High level facade are supplied that simplifies common use cases.
  • No mappings required. Most objects can is serialized without need for specifying mappings.
  • performance. Speed and low memory footprint is a crucial part of the design, making it suitable for large object graphs or system s with high message throughput.
  • Clean XML. No information is duplicated this can be obtained via reflection. This results in XML, easier to read for humans and more compact than native Java serialization.
  • Requires no modifications to objects. serializes internal fields, including private and final. Supports Non-public and inner classes. Classes is required to has the default constructor.
  • Full object graph support. Duplicate references encountered in the Object-model would be maintained. Supports circular references.
  • integrates with other XML APIs. by implementing a interface, XStream can serialize directly to/from any tree structure (not just XML).
  • customizable conversion strategies. strategies can registered allowing customization of how particular types is represented as XML.
  • Security Framework. Fine-control about the unmarshalled types to prevent security issues with manipulated input.
  • Error messages. When a exception occurs due to malformed XML, detailed diagnostics is provided to help isolate and fix the problem.
  • alternative output format. The modular design allows other output formats. XStream ships currently with JSON support and morphing.
Typical Uses
    • Transport
    • Persistence
    • Configuration
    • Unit Tests
Known Limitations

If using the enhanced mode, XStream can re-instantiate classes that does not have a default constructor. However, if using a different JVM like an old JRockit version, a JDK 1.4 or you have restrictions because of a securityman Ager, a default constructor is required.

The enhanced mode is also necessary to restore final fields for any JDK < 1.5. This implies deserialization of instances of a inner class.

Auto-detection of annotations may cause race conditions. Preprocessing annotations is safe though.

Tutorials
    • Minute Tutorial
    • Alias Tutorial
    • Annotations Tutorial
    • Converter Tutorial
    • Object Streams Tutorial
    • Persistence API Tutorial
    • JSON Tutorial

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.