Take the 2-minute tour ×

For a project I'm working on, I send queries to StackExchange and transform the JSON result into POJOs using jsonschema2pojo maven plugin. The problem is quite simple : that plugin always name the wrapper class Data and its contained data Item, when I would like wrapper to be named *Wrapper and the contained class Answer for a call to the answers endpoint (as an example).

Well, anyway, how could I rename the Data class to AnswerWrapper and the Item class to Answer ? I know the folder they're in, the package used to define, and so on. The only missing thing is a tool/plugin/java application to perform that operation. I was directed to JRefactory, but the downloaded JAR doesn't look like it can provide the operation I want (and its lack of doc makes it unusable).

So, is there any more modern/efficient solution ? (or at least some I could integrate in my maven build) ?

share|improve this question
add comment

1 Answer

Maybe not the easiest solution but one that would fit nicely with your requirements would be to actually add functionality to the maven plugin to support customizing the names of the generated classes. It would of course include building your own version and maybe submitting a patch to get it included in the mainline.

share|improve this answer
Yes, my immediate thought was "this is something the plugin should allow you to configure". –  Duncan Nov 1 '12 at 15:57
indeed a nice solution, but a long development that would drive me away from current work –  Riduidel Nov 1 '12 at 17:23
add comment

Your Answer


