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.
Compile the classes using javac compiler as follows:
Now run the XStreamTester to see the result:
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.
XStream Related Interview Questions
|File Maker Interview Questions||J2EE Interview Questions|
|Core Java Interview Questions||Android Interview Questions|
|JavaServer Faces (JSF) Interview Questions||Java Swing Interview Questions|
|JavaMail API Interview Questions||Java collections framework Interview Questions|
|Java 8 Interview Questions||Java Collections Interview Questions|
|Java Exception Handling Interview Questions||Java Concurrency Interview Questions|
|Java String Interview Questions||Java Hadoop Developer Interview Questions|
|Java Serialization Interview Questions||Java Programmer Interview Questions|
|Java Inheritance Interview Questions||Java IO Interview Questions|
|Hadoop Testing Interview Questions|
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.