Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Well, there are a couple of things worth pointing out here:</p> <p>Firstly, you've annotated the <code>pokemon</code> field in the <code>Data</code> class, but this is not going to work unless you supply the name of the xml tag the field should be bound up to. SimpleXML won't know that you actually mean the bind up <code>Pkmn</code> to <code>pokemon</code>. In short, add:</p> <pre><code>@Element(name="Pkmn") private Pokemon pokemon; </code></pre> <p>Last time I checked, SimpleXML does support auto-binding, but that will require the <a href="http://simple.sourceforge.net/download/stream/doc/javadoc/org/simpleframework/xml/Default.html" rel="nofollow"><code>@Default</code> annotation</a> and the field names have to match the xml tags. </p> <p>That being said, the safest option here is to not use <code>@Default</code> and explicitly supply the name with every annotation. That is, go through your <code>Pokemon</code> class and declare the name for every <code>@Element</code> annotation. For example:</p> <pre><code>... @Element(name="ablt") private String abilities; ... </code></pre> <p>After that, you should be close to have working code. To clean up, you may want to remove <code>strict=false</code> from the <code>@Root</code> declaration of your <code>Data</code> class. That was probably your initial attempt to bypass the <code>ValueRequiredException</code>? If the <code>Data</code> tag not having a <code>Pkmn</code> tag is a valid scenario, then potentially leave it in there, but otherwise you should remove it to avoid undesired side effects.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload