Gradle build: converting xml datatype into application specific datatype in jaxb task

I am trying to generate POJOs from a bunch of .xsd files I have in my project using jaxb plugin in my gradle 2 build.
In my .xsd file the datatype for a particular parameter is date. Currently it converts into XmlCalendar when the class is generated, but I want the datatype to be of an application specific date type.
I have an Adapter class that does the marshalling and unmarshalling. But I don’t know how to use it with my build.gradle. Can anyone please explain it to me along with an example?