Questions tagged [xstream]

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

XStream

XStream is a simple library to serialize objects to XML and back again. It is typical used for Transport, Persistence, Configuration and Unit Tests.

Features

  • Ease of use. A high level facade is supplied that simplifies common use cases.

  • No mappings required. Most objects can be serialized without need for specifying mappings.

  • Performance. Speed and low memory footprint are a crucial part of the design, making it suitable for large object graphs or systems with high message throughput.

  • Clean XML. No information is duplicated that can be obtained via reflection. This results in XML that is 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 are not required to have default constructor.

  • Full object graph support. Duplicate references encountered in the object-model will be maintained. Supports circular references.

  • Integrates with other XML APIs. By implementing an interface, XStream can serialize directly to/from any tree structure (not just XML).

  • Customizable conversion strategies. Strategies can be registered allowing customization of how particular types are represented as XML.

  • Error messages. When an exception occurs due to malformed XML, detailed diagnostics are 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.

References

1024 questions
-1
votes
0 answers

module java.base does not "opens java.util" to unnamed module @

We have recently upgraded our Java project from httpclient4 to httpclient5. After upgrading we are seeing the below issue in the logs: ---- Debugging information ---- message : No converter available type :…
ketan
  • 23
  • 3
-1
votes
2 answers

new dependency not recognised by Maven

Using maven version 3.6.3 and JDK version "openjdk-17" I've tried using Maven's dependencies so I could use the xstream library in my project. Following a guide I added com.thoughtworks.xstream to my pom.xml file: I then tried to use xstream, but…
James Green
  • 125
  • 12
-1
votes
1 answer

Serializing static nested class members on XStream

I have an application that uses XStream to serialize and deserialize classes to XML. It works great. I got a question whether static inner classes are serializable. Per the XStream's FAQs, it can. However, a Test class that has a nested static class…
dmachop
  • 824
  • 1
  • 21
  • 39
-1
votes
1 answer

XStream - Make a class in custom converter (unmarshal)

I'm programming a Java application and using XStream, I need to make the entire Unmarshal on my own, I could make the code to get the XML propertie but there is a problem: I can't take the other class (Agent). I've tried "reader.getValue()" and then…
-1
votes
1 answer

What is the use of converters?

I'm learning to work with with XStream and converters, but I don't understand properly what converters are used for. I think we can do the same tasks by using xstream aliasing - setter methods at the time before serialisation and getter methods when…
Vikas Taank
  • 101
  • 1
  • 12
-1
votes
1 answer

JAXB / XStream - Unmarshall Different POJO by particular tag

Suppose i have an XML like this: TYPE1 The content of field 1 TYPE2 The content of field 2
Mistre83
  • 2,677
  • 6
  • 40
  • 77
-1
votes
1 answer

Remove '@class' in XStream for Java primitive types

I have this field in a POJO that is serialized into JSON: @XStreamAlias("tags") List tags; My problem is that the output looks like this: "tags": [ { "@class": "linked-list", "string": [ "test", …
quarks
  • 33,478
  • 73
  • 290
  • 513
-1
votes
1 answer

generating xml from object through xstream in java

I am using xstream for parsing that is converting object to xml i have the below pojo along with setters and getter public class InvoiceReferenceNotificationMessage { private String InvoiceReference; private String ABSReference; …
ndsfd ddsfd
  • 235
  • 1
  • 5
  • 13
-1
votes
1 answer

com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$UnknownFieldException

This is the frist time I am trying XStream. But when I try to parse my xml file i am getting this exception : com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$UnknownFieldException: No such field xmlread.Type.type ----…
-1
votes
2 answers

Convert XML file to class variable?

I am messing around on XStream to get used using it. I can convert my Person variable to XML to give me this Mitch 17 Yehaaa Programming
-1
votes
1 answer

How to convert xml into Java Object which contains ArrayList through XStream Library?

I want to convert the XML file to Java object which have array. Objective is to store the xml values into the array of the object. Suppose XML file as: John 19 2225364 Now the…
Samraan
  • 204
  • 1
  • 2
  • 14
-1
votes
1 answer

Json parsing using XStream and JettisonMappedXmlDriver

Please help me to parse below JSON string Using XStream and JettisonMappedXmlDriver In Java ?? [{ "uuid": "{empid}", "attributes": { "name": "Prem", "surname": "Nath", "year": 1965 …
Anand K Nair
  • 597
  • 1
  • 6
  • 18
-1
votes
1 answer

Spring 3 with json and xstream output not working

I have this working now now, but am lost as to why this problem occurred.. I followed the following http://pfelitti87.blogspot.co.uk/2012/07/rest-services-with-spring-3-xml-json.html but i changed the controller method and added…
user1555190
  • 2,803
  • 8
  • 47
  • 80
-1
votes
1 answer

Xstream date attribute

I want to format the date attribute in my xstream output, i created a date converter which converts tot eh right format however, it creates a new sub-element rather than adding tot he parent element attribute. I want the following When i register…
user1555190
  • 2,803
  • 8
  • 47
  • 80
-1
votes
1 answer

What's the lightest xstream convertion?

I'm using XSTREAM to serialize my messages in my application. I see that there's more way to generate COMPACT MESSAGES in xstream but i need to know which is the lightest (talking about memory) method to convert my messages. Thanks All!
Matteo Gatto
  • 616
  • 11
  • 28
1 2 3
68
69