Skip to content

Instantly share code, notes, and snippets.

@nazartm
Created January 13, 2013 15:13
Show Gist options
  • Save nazartm/4524538 to your computer and use it in GitHub Desktop.
Save nazartm/4524538 to your computer and use it in GitHub Desktop.
Binding file for customizing JAXB.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
version="2.1" jaxb:extensionBindingPrefixes="xjc">
<jaxb:globalBindings>
<!-- Use java.util.Calendar instead of javax.xml.datatype.XMLGregorianCalendar for xs:dateTime -->
<jaxb:javaType name="java.util.Calendar" xmlType="xs:dateTime"
parseMethod="javax.xml.bind.DatatypeConverter.parseDateTime"
printMethod="javax.xml.bind.DatatypeConverter.printDateTime" />
<!-- Use java.util.Calendar instead of javax.xml.datatype.XMLGregorianCalendar for xs:date -->
<jaxb:javaType name="java.util.Calendar" xmlType="xs:date"
parseMethod="javax.xml.bind.DatatypeConverter.parseDateTime"
printMethod="javax.xml.bind.DatatypeConverter.printDateTime" />
<!-- Generated classes should implement Serializable interface -->
<xjc:serializable uid="1" />
<xjc:simple />
</jaxb:globalBindings>
</jaxb:bindings>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment