Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/evant/fasax
The fastest way to unmarshall XML to Java on Android
https://github.com/evant/fasax
Last synced: about 1 month ago
JSON representation
The fastest way to unmarshall XML to Java on Android
- Host: GitHub
- URL: https://github.com/evant/fasax
- Owner: evant
- Created: 2014-01-27T04:35:07.000Z (almost 11 years ago)
- Default Branch: main
- Last Pushed: 2022-05-31T17:19:05.000Z (over 2 years ago)
- Last Synced: 2023-03-22T12:35:38.925Z (almost 2 years ago)
- Language: Java
- Size: 132 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
fasax
=====The fastest way to unmarshall XML to Java on Android.
Note: This project is far from complete, but can unmarshell simple xml
documments.Unlike other implementations, this libary generates SAX parsing code at compile
time. This makes it's performace virtually the same as a handwritten SAX parser.
Annotations are inspired from [Simple XML](http://simple.sourceforge.net/).Example
-------```xml
Agile Analytics
Agile Analytics Software Licences™
Cloud Big Data Management
JVMXMLRPP
Addition as a Service
Vendelín Gamil
Senior Architect
2010-12-01
Huw Andrea
Junior Architect
2013-06-12
Benjy Teodors
Head Senior Architect
2011-10-24
```
```java
@Xml
pubic class Enterprise {
@Element
public String corperation;@Element(name="software-license")
public SoftwareLicense softwareLicense;@ElementList(entry="software", inline=true)
public List software;@ElementList(entry="employee")
public List employees;@Xml
public static class SoftwareLicense {
@Attribute
public String type;@Attribute
public String year;@Text
public String name;
}@Xml
public static class Employee {
@Element
public String name;@Element
public String title;@Converter(DateConverter.class)
@Element(name="date-started")
public Date dateStarted;
}
}
``````java
Fasax fasax = new Fasax();
InputStream in = getXmlInputStream();
Enterprise enterprise = fasax.fromXml(in, Enterprise.class);
```TODO
----
- Allow use of setters instead of public fields
- Write XML
- Namespaces
- Split compile-time and runtime dependencies