Comments (3)
You can use @Element
on a List like List<SomeClass>
but not on a list of primitives like List<String>
, List<Int>
and List`.
For List<String>
a workaround is needed right now:
@Xml
public class SomeData {
@Element
List<String> someStrings;
}
@Xml
public class StringWorkaround {
@TextContent String stringValue;
}
then you can parse it as a List<StringWorkaround>
from tikxml.
On Latest also i.e 0.8.13, Can't we use @element List directly?
it is giving exception like com.tickaroo.tikxml.TypeAdapterNotFoundException: No TypeAdapter for class java.lang.String found. Expected name of the type adapter is java.lang.String$$TypeAdapter
from tikxml.
@sockeqwe
But in my case not working. items always null
@Xml(name = "data")
public class Data{
...
@Path("Items")
@Element
private List<Item> items;
....
@Xml(name = "item")
public static class Item {
@PropertyElement(name = "type")
private int type;
....
}
XML content
<?xml version="1.0" encoding="utf-8"?>
<data>
…xml
<Items>
<item>
…
<type>1</type>
</item>
</Items>
…
</workspace>
from tikxml.
Related Issues (20)
- Not skipping <!DOCTYPE> entirely
- error: incompatible types: Object cannot be converted to RequestBody HOT 1
- How to use NameSpace HOT 1
- How to initiate the lib in kotlin HOT 1
- The Future of TikXML HOT 4
- Dynamic root tag name HOT 6
- XML not generate in defined order HOT 2
- Parsing not work HOT 3
- exception while reading rss feed HOT 7
- Type converter for inserting into database HOT 2
- Problemas de parseo con dos objetos y arraylist dentro de cada uno HELP HOT 2
- Support for generic elements
- Support for iso-8859-1 HOT 7
- No TypeAdapter for class HOT 2
- java: incompatible types: java.lang.Object cannot be converted to Book HOT 2
- Docs don't mention how to make a model class for an xml like the following HOT 3
- addTypeConverter
- Support for empty lists HOT 1
- "isXXX: String" compile error
- Plans to release 0.9.x?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tikxml.