1

I'm get used using XJC tool from command line. But I realized that I'm not able to generate Java classes with equals() and hashCode() methods using it. I used this:

xjc -dtd -d directory -p com.example.package file.dtd

I don't know how to generate the methods. My version is:

xjc version "JAXB 2.1.10 in JDK 6" 
JavaTM Architecture for XML Binding(JAXB) Reference Implementation, (build JAXB 2.1.10 in JDK 6)

1. Is it possible to generate equals() and hashCode() methods from a DTD file with XJC tool?

Moreover, I know I can use Maven plugins to achieve this kind of goals. I'm very happy with The CXF XJC Maven Plugin. I would be very happy if I can do the same job with this Maven plugin.

1. Is it possible to generate equals() and hashCode() methods from a DTD file with The CXF XJC Maven Plugin?

logoff
  • 3,347
  • 5
  • 41
  • 58
  • possible duplicate of [Generating hashCode() and equals() when creating Java classes using Mojo Jaxb2 maven plugin](http://stackoverflow.com/questions/9062539/generating-hashcode-and-equals-when-creating-java-classes-using-mojo-jaxb2-m) – bdoughan Jan 14 '14 at 19:33
  • @BlaiseDoughan I'm aware of this question, but I was asking about command line XJC tool in the first question and The CXF XJC Maven Plugin in the second one, not answered there. – logoff Jan 15 '14 at 09:12

1 Answers1

0

JAXB2 Basics includes plug-ins for hashCode() and equals()

bdoughan
  • 147,609
  • 23
  • 300
  • 400