0

I have below class

public class RootElement
{
    protected String code;
    protected RootElement.SubElement subElement;

    public static class SubElement
    {
        protected String desc;
        // Getter-Setter methods
    }
    // Getter-Setter methods
}

Below is JiBX mapping (binding) file

<binding name="binding" package="com.test.jibx">
   <mapping class="com.test.jibx.RootElement" name="Root">
       <value name="Code" field="code"/>
       <structure name="SubElement">
           <value name="Desc" field="desc"/>
       </structure>
   </mapping>
</binding>

When i try to bind this XML i am getting following error message.

Nonstatic field desc not found in class com.test.jibx.RootElement

How to bind or map a static class? Please help.

Ankur Raiyani
  • 1,509
  • 5
  • 21
  • 49

1 Answers1

0

http://jibx.sourceforge.net/binding/tutorial/binding-advanced.html

Read the first part of the page: inner classes are denoted by the standard java $ notation.

Kurt Du Bois
  • 7,550
  • 4
  • 25
  • 33