0

I am using JAXB to serialize and deserialize java objects.
Classes are as:

    public class Level1Class
    {
        String Id;

        HashMap<String,Level2Class> level2Map = new HashMap<String,Level2Class>();


    }

    public class Level2Class
    {
        String Id;
    }

I want to serialize and deserialize object of Level1Class.
Please suggest annotation for classes and fields.
What else do I need to include
1. default constructor
2. getter setter of fields

Chaturvedi Dewashish
  • 1,469
  • 2
  • 15
  • 39
  • http://stackoverflow.com/questions/7534500/how-to-serialize-hashtablestring-string-to-xml-using-jaxb This may help. – Rohit Feb 19 '14 at 07:12

1 Answers1

0

To make an object serializable, you just have to let it implement Serializable and make sure that every field of this object is serializable as well.

Smutje
  • 17,733
  • 4
  • 24
  • 41