-
Notifications
You must be signed in to change notification settings - Fork 37
Configuration
Jsonix Schema Compiler supports a number of configuration options.
Configuration can be provided in binding files.
You can configure modules and mappings which will be generated as well as how they will be written out.
Please refer to the following pages for more information.
Assume we have a purchase order schema defined in the file purchaseorder.xsd
.
You can compile this schema without any configuration:
java -jar jsonix-schema-compiler-full.jar -p PO purchaseorder.xsd
Generates the PO.js
module which exports the PO
mapping.
You can provide configuration in the binding file (binings.xjb
):
java -jar jsonix-schema-compiler-full.jar -b bindings.xjb purchaseorder.xsd
Example of the bindings.xjb
file:
<jaxb:bindings
version="1.0"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jsonix="http://jsonix.highsource.org/customizations"
jaxb:extensionBindingPrefixes="jsonix">
<jaxb:bindings schemaLocation="purchaseorder.xsd"
node="/xs:schema">
<jaxb:schemaBindings>
<jaxb:package name="com.acme.foo.po"/>
</jaxb:schemaBindings>
<jsonix:mapping package="com.acme.foo.po" name="PO"/>
</jaxb:bindings>
</jaxb:bindings>
Also generates the PO.js
module which exports the PO
mapping.
<jsonix:output naming="standard" fileName="#{module.name}.std.js"/>
<jsonix:output naming="compact" fileName="#{module.name}.cmp.js"/>
Generates PO.std.js
with standard naming and PO.cmp.js
with compact naming.
<jsonix:mapping package="com.acme.foo.po" name="PurOrd"/>
Generates a PurOrd.js
which exports the PurOrd
mapping
<jsonix:module name="PurchaseOrder">
<jsonix:mapping package="com.acme.foo.po" name="PO"/>
<jsonix:output naming="compact" fileName="${module.name}.js"/>
<jsonix:output naming="standard" fileName="${module.name}.standard.js"/>
</jsonix:module>
Generates the PurchaseOrder.js
(compact naming) and PurchaseOrder.standard.js
(standard naming) which export the PO
mapping.
- Usage
- Basic Concepts
- Generation
- Configuration
- Advanced Topics
- Sample Projects
- Troubleshooting
- Development