Every <Node/> only ever has one <Entry/>, but there are multiple <Node/>s.
My model (Kotlin) looks like this:
import androidx.annotation.Keep
import com.tickaroo.tikxml.annotation.Element
import com.tickaroo.tikxml.annotation.Xml
@Keep
@Xml(name="ArrayOfNodes")
data class ArrayOfNodes( @field:Element var nodes: List<Node>? = null ) {}
@Keep
@Xml(name="Node")
data class Node ( @field:Element var entry: Entry? = null ) {}
@Keep
@Xml(name="Entry")
data class Entry(
@field:Element(name = "ID")
var id: String? = null,
@field:Element(name = "Name")
var name: String? = null
) {}
I'm using retrofit and have exceptionOnUnreadXml set to false.
I'm getting the following runtime exception:
com.tickaroo.tikxml.TypeAdapterNotFoundException: No TypeAdapter for class java.lang.String found. Expected name of the type adapter is java.lang.String$$TypeAdapter
Upon inspection of the full stack trace, it looks like my ArrayOfNodes and Nodes TypeAdapers are working properly, but as soon as the Entry$TypeAdapter tries to parse the ID, it fails - the "offending" code in the generated type adapter looks like this:
childElementBinders.put("ID", new ChildElementBinder<Entry>() {
@Override
public void fromXml(XmlReader reader, TikXmlConfig config, Entry value) throws IOException {
value.setId((String)config.getTypeAdapter(String.class).fromXml(reader, config));
}
});
It appears to be failing on the config.getTypeAdapter(String.class).
I have XML that looks like this:
Every <Node/> only ever has one <Entry/>, but there are multiple <Node/>s.
My model (Kotlin) looks like this:
I'm using retrofit and have exceptionOnUnreadXml set to false.
I'm getting the following runtime exception:
com.tickaroo.tikxml.TypeAdapterNotFoundException: No TypeAdapter for class java.lang.String found. Expected name of the type adapter is java.lang.String$$TypeAdapter
Upon inspection of the full stack trace, it looks like my ArrayOfNodes and Nodes TypeAdapers are working properly, but as soon as the Entry$TypeAdapter tries to parse the ID, it fails - the "offending" code in the generated type adapter looks like this:
It appears to be failing on the config.getTypeAdapter(String.class).