2

I am working on jaxb2-maven-plugin, I am generating Java POJOs from XSD.

I need to add @Data annotation on top of the class without setters getters.

The output file should look like this.

@Data
public class Employee {

    @JsonProperty("name")
    private Name name;
    @JsonProperty("joindate")
    private String joindate;
    @JsonProperty("payload")
    private String payload;
}

My XSD is like this

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="employee">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="name">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="lastname" type="xs:string"  />
              <xs:element name="firstname" type="xs:string" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="hiredate" type="xs:string" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

I need to add annotation on Name.java as well. I have around 100 XSDs. I need to do this for all XSDs

Pradeep Charan
  • 653
  • 2
  • 7
  • 28

0 Answers0