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 8854717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:56:53+00:00 2026-06-14T13:56:53+00:00

I have some new xsd schema version updates for which I need to generate

  • 0

I have some new xsd schema version updates for which I need to generate corresponding java classes. In the past, I understand that the classes where always generated using EclipseLink’s Moxy JAXB implementation and I can see that if the schemas contained <xs:restriction/> patterns such as <xs:pattern value="[a-zA-Z]"/>, then the corresponding java classes would be generated with @Pattern(regexp="[a-zA-Z]", message= "...") annotations in them.

When I use Moxy in my setup to generate these java classes, the classes are generated okay but without the @Pattern annotations in them. I am not too familiar with JAXB and I am wondering what I may be missing to allow for these annotations to be derived from the schemas and inserted into the java classes themselves automatically.

I am not too sure if this is because I am not using a new enough version of Moxy (currently using 2.1.2 version of EclipseLink) which allows for these annotations to be automatically created or, whether previously another tool was used for inserting these annotations into the classes.

Any help on this matter would be much appreciated.

Regards,
PM.

  • 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-14T13:56:54+00:00Added an answer on June 14, 2026 at 1:56 pm

    Note: I’m the EclipseLink JAXB (MOXy) lead and a member of the JAXB (JSR-222) expert group.

    Generating Classes

    EclipseLink JAXB (MOXy) includes the XML Schema to Java Compiler (XJC) from the JAXB reference implementation. Currently the XJC tool does not have a built in mechanism to generate Bean Validation (JSR-303) annotations in the model.

    XJC Extensions

    I have not tried the following extension myself but it looks like it may do what you are looking for. As XJC is very extensible there may be other plug-ins available as well.

    • http://code.google.com/p/krasa-jaxb-tools/

    Current Versions of EclipseLink

    I am not too sure if this is because I am not using a new enough
    version of Moxy (currently using 2.1.2 version of EclipseLink)

    The current version is EclipseLink 2.4.1 and can be obtained from the link below. It contains new extensions such as JSON binding.

    • http://www.eclipse.org/eclipselink/downloads/
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some problem with my open new window popup which it can read
I am new to java and I have some problem on Casting. I have
I have the following start of an XSD: <?xml version=1.0 encoding=UTF-8?> <xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema xmlns:no=http://www.sychophants.com>
Guys I'm new to xml in Java. I have the following task. I need
Suppose I have some schema: <xsd:schema ...> <xsd:element name=foo> <xsd:complexType> <xsd:sequence> <xsd:element name=fooElement type=xs:string
If I have a lot of complex-types in xsd, which for example has some
I have some Java code that validates XML against an XSD. I am using
i have simple xsd file: <?xml version=1.0?> <xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema> <xs:element name=note> <xs:complexType> <xs:sequence> <xs:element
I have some common types which are defined in an xsd file which is
I have some code that dynamically creates a new button through JavaScript that when

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.