0

I am using following code in writing one of my JAVA web service. But while rendering, JAXBException is coming, as it cannot properly parse the multilevel hashmap that I have used in following code.

import java.util.HashMap;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "XYZEntry")
public class XYZEntry extends BaseEntry{
    private static final long serialVersionUID = 1L;
    private HashMap< String, HashMap< String, String>> component;
    @XmlElement(name = "orderWiseComponent")
    public HashMap< String, HashMap< String, String>> getComponent() {
        return component;
    }
    public void setComponent(HashMap< String, HashMap< String, String>> component) {
        this.component = component;
    }
Joy
  • 4,197
  • 14
  • 61
  • 131
  • Compiler warning in `setComponent()`: *Unqualified access to the field XYZEntry.component*. That is because parameter name is `breakUp`, so the line `this.component = component` actually means `this.component = this.component`. – Andreas May 09 '16 at 04:06
  • @Andreas, sorry, it was a typo. – Joy May 09 '16 at 04:08

0 Answers0