Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Which class types can be serialized by XStream?

class serialized types xStream
0
Posted

Which class types can be serialized by XStream?

0

In contrast to the JDK XStream is not tied to a marker interface to serialize a class. XStream ships with some specialized converters, but will use reflection by default for “unknown” classes to examine, read and write the class’ data. Therefore XStream can handle quite any class, especially the ones referred as POJO (Plain Old Java Object). However, some types of classes exist with typical characteristics, that cannot be handled – at least not out of the box: • Objects that are based on threads or thread local data: Thread, Timer, ThreadLocal and so on. These classes keep different data for different threads and there’s no possibility to recreate a thread in a generic way nor recreating thread specific data. There might be special use cases, but this will always involve a custom converter where threads can be recreated in a specific way tied to that use case. • Class types that are based on generated classes. Such types have often names that are unique to the current process and will

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123