<?xml version="1.0" encoding="utf-8"?>
<pointmanager>
<pointshelf name="bj_game">
<pointid name="chip500">
<pointkind>
<point>
<x>10.27f</x>
<y>539.55f</y>
</point>
<diff>0</diff>
</pointkind>
<pointkind>
<point>
<x>7.71f</x>
<y>404.66f</y>
</point>
<diff>0</diff>
</pointkind>
<pointkind>
<point>
<x>5.14f</x>
<y>269.77f</y>
</point>
<diff>0</diff>
</pointkind>
<pointkind>
<point>
<x>3.85f</x>
<y>202.33f</y>
</point>
<diff>0</diff>
</pointkind>
</pointid>
<pointid name="chip100">
<pointkind>
<point>
<x>113.77f</x>
<y>539.55f</y>
</point>
<diff>0</diff>
</pointkind>
<pointkind>
<point>
<x>85.331f</x>
<y>404.66f</y>
</point>
<diff>0</diff>
</pointkind>
<pointkind>
<point>
<x>56.89f</x>
<y>269.77f</y>
</point>
<diff>0</diff>
</pointkind>
<pointkind>
<point>
<x>42.66f</x>
<y>202.33f</y>
</point>
<diff>0</diff>
</pointkind>
</pointid>
--- 以下、繰り返しのため略 ---
</pointshelf>
</pointmanager>
■各クラス
@Root
public class PointManager{
@ElementList(name="pointshelf")
public List<PointShelf> pointshelf;
}
public class PointShelf {
@ElementList(name="pointid")
public List<PointId> pointid;
@Attribute(name="name")
public String name;
}
public class PointId {
@ElementList(name="pointkind")
public List<PointKind> pointkind;
@Attribute(name="name")
public String name;
}
public class PointKind {
@ElementList(name="point")
public List<Point> point;
@Element(name="diff")
public String diff;
}
public class Point {
@Element(name="x")
public String x;
@Element(name="y")
public String y;
}
■xmlから値を取得する部分
InputStream is = context.getResources().openRawResource(R.raw.point);
Persister persister = new Persister();
try {
this.pManager = persister.read(PointManager.class, is, false);
}catch (Exception e){
System.out.println(e); // エラー出力。ココで下記のエラー
}
■表示エラー文 ※パッケージ名は変更しております。
02-12 13:48:57.538: I/System.out(13305): org.simpleframework.xml.core.ValueRequiredException: Unable to satisfy @org.simpleframework.xml.ElementList(data=false, empty=true, entry=, inline=false, name=pointid, required=true, type=void) on field 'pointid' public java.util.List com.hoge.blackjack.PointShelf.pointid for class com.hoge.blackjack.PointShelf at line 4
エラーを見る限りPointShelfにpointidが存在しないとのエラーのようですが、見ていただくと分かるとおり存在します。
また、required=falseを付与するとコンパイルは通りますが、帰ってくる値はnullなので座標データは取得できていません。
xml本文等かなり見にくいかとは思いますが、よろしくお願い致します。