The Mobile Architecture for XML Binding (MAXB) provides a XSD to IOS Objective-C and Android Java binding compiler based on JAXB XJC.
##Note MAXB is initially a fork of mxjc.
MXJC (and related projects: mwsc, nano & pico) has been developed by bulldog2011 but stayed as is from 2013. As it is very well designed and implemented, I decided to fork and upgrade it.
##Feature Highlight
- Standard based : based on Oracle JAXB 2.1 XJC, recognize most standard XML Schema components.
- Objective-c Pico Binding Support : auto-generate PicoKit for IOS bindable classes from XML Schema or WSDL.
- Android Nano Binding Support : auto-generate NanoKit for Android bindable classes from XML Schema or WSDL.
- Doc Auto Generation : auto-generate code comments from XML Schema or WSDL annotations.
- JAXB Binding Customization : support JAXB binding customization in case the code generated by defaut binding does not meet real needs.
##How to Use
Download zip package from repository mentioned in version history below, latest stable release is 0.7.0, then extract the zip file and run mxjc script in command line:
Usage: maxb [-options ...] <schema file/URL/dir> ... [-b <bindinfo>] ...
If dir is specified, all schema files in it will be compiled.
Options:
-nano : target Nano for Android as code generation target (default)
-privateField : generate private fields, accessed by public accessors, only for nano binding
-pico : target Pico for IOS as code generation target
-prefix <prefix> : add prefix to the target classes, only for pico binding
(recommended to avoid possible name conflict)
-nv : do not perform strict validation of the input schema(s)
-b <file/dir> : specify external bindings files (each <file> must have its own -b)
If a directory is given, **/*.xjb is searched
-d <dir> : generated files will go into this directory
-p <pkg> : specifies the target package
-httpproxy <proxy> : set HTTP/HTTPS proxy. Format is [user[:password]@]proxyHost:proxyPort
-httpproxyfile <f> : Works like -httpproxy but takes the argument in a file to protect password
-readOnly : generated files will be in read-only mode
-xmlschema : treat input as W3C XML Schema (default)
-wsdl : treat input as WSDL and compile schemas inside it (experimental,unsupported)
-verbose : be extra verbose
-quiet : suppress compiler output
-help : display this help message
-version : display version information
0.7.0 — April 9, 2015 : repository
- This version is compatible with Nano 0.7.0 and PicoKit 0.6.0
- Enhancement: support ARC for PicoKit 0.6.0
0.6.1 — April 14, 2013 : repository
- This version is compatible with Nano 0.7.0 and Pico 0.5.0
- Enhancement: support generating public fields(default) for Nano
- Enhancement: support generating fields ordering for Nano
- Enhancement: support generating XSD any element for Nano
0.6.0 — March 25, 2013 : repository
- This version is compatible with Nano 0.6.3 and Pico 0.5.0
- Feature: support Pico binding for IOS 0.5.0
- Enhancement: support generating XSD any element for Pico 0.5.0
0.5.1 — February 5, 2013 : repository
- Initial version supporting Nano binding for Android.
- This version is compatible with Nano 0.6.3
##Docs
- Scheam driven data binding with Nano and mxjc
- Schema Driven Web Serivce Client Development on Android, Part 1 : Hello eBay Finding
- Schema Driven Web Serivce Client Development on Android, Part 2 : eBay Search App
##Faq Link to Faq on Wiki
##Current Limitation
- xsd:choice is not supported and will be ignored if presents
- xsd nest anonymous type is only experimentally supported and is not recommended to use.
- only single target namespace is supported
- xsd any attribute is not supported
MAXB is available under the MIT license. See the LICENSE file for more info.