Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8667633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:00:50+00:00 2026-06-12T18:00:50+00:00

I am using JAXB for generating beans from XSD’s using a JAXB plugin in

  • 0

I am using JAXB for generating beans from XSD’s using a JAXB plugin in Maven.
This is working fine, expect that the code contains isSetXXXXXX() methods for each field.

e.g.

for a field firstName, it is producing the following code:

@XmlElement(name = "FirstName", required = true)
    protected String firstName;

  public String getFirstName() {
        return firstName;
    }

 public void setFirstName(String firstName) {
        this.token = firstName;
    }

    public boolean isSetFirstName() {
        return (this.firstName!= null);
    }

This isSetFirstName() method is causing issues and I don’t want JAXB to generate these.

Is there a way to stop this behaviour?

Thanks.

UPDATE

Solved this: Problem was in the xjb file, generateIsSetMethod was set to true.

<xs:annotation>
   <xs:appinfo>
      <jaxb:globalBindings generateIsSetMethod="true">

      bindingStyle="modelGroupBinding"
         choiceContentProperty="true" >

           <xjc:serializable uid="12343"/>
           <jaxb:javaType name="short" 
              xmlType="xs:long" 
              printMethod="javax.xml.bind.DatatypeConverter.printShort"   
              parseMethod="javax.xml.bind.DatatypeConverter.parseShort"/>

      </jaxb:globalBindings>
   </xs:appinfo>
</xs:annotation>

And this answered my previous question as well.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T18:00:52+00:00Added an answer on June 12, 2026 at 6:00 pm

    By default a JAXB (JSR-222) implementation will not generate isSet methods. Since you are getting them one of the following must be true:

    1. You can a schema annotation that specifies: <jaxb:globalBindings generateIsSetMethod="true"/>
    2. You have an external binding file that specifies: <jaxb:globalBindings generateIsSetMethod="true"/>
    3. You are specifying a property to the Maven plug-in to generate the isSet methods.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on generating Java objects from an XSD file using JAXB 2.1.
I'm trying to generate beans from an xsd by using the jaxb2-maven-plugin maven plugin,
I am using jaxb maven plugin to generate classes from schemas. I have 3
I want to generate java code from xsd using JAXB 2.1 XJC. I have
I have a project that does JAXB generation with framework.xsd. This generates a jar
I have multiple WSDL/XSD files and using JAXB I'm generating it's clients. But there
I am using JAXB and maven-jaxb2-plugin and I am able right now to bind
I'm using JAXB with Scala, my marshalling code looks like this: def marshalToXml(): String
I've got this API using JAXB to conveniently use object models, generated from XML
I work with a datamodel created using JAXB, from that I can generate XML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.