XStream Aliasing- XStream Implicit Collections Aliasing - XStream

What is the use of XStream Implicit Collections Aliasing?

Implicit collections aliasing is used when a collection has to be represented in XML without displaying the roots. For example, in our case, we should display each note one by one but not in the 'notes' root node. Let us modify our example again and add the following code to it.

Let us test the above objects serialization using XStream.

Create a java class file named XStreamTester in C:\>XStream_WORKSPACE\com\wisdomjobs\xstream.

File: XStreamTester.java

Verify the Result

Compile the classes using javac compiler as follows:

Now run the XStreamTester to see the result:

Verify the output as follow:

In the above result, we can see that name is coming as a child node and we need it as an attribute of the root node.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

XStream Topics