クラスにJAXB を実装したいのですが、Test変数がfinalの場合、JAXB を注入することはできませんか? XmlAdapterこの場合に役立ちますか?
public class Test implements Serializable {
private final int limit;
private Map<String, Object> results;
private final Sub sub;
@XmlElementWrapper(name = "item") //tried with this also,but not successfull
@XmlAnyElement
private final List<Item> item;
public Test(final Sub sub, final List<Item> item, final int limit) {
this(pattern, results, 0, limit, offset);
}
}
public class Item implements Serializable {
private Base base;// Interface
public Item(final Base base) {
this.base = base;
}
}
private final List<Item> item;Itemインターフェースも持つ反復クラスBaseです。実装したい場合は、xmlAdapterそれを行う必要がItemありTestますか?