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

  • SEARCH
  • Home
  • 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 4172180
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T00:31:54+00:00 2026-05-21T00:31:54+00:00

if you take a look on jsr-303 (bean validation) you notice that annotations can

  • 0

if you take a look on jsr-303 (bean validation) you notice that annotations can be be put on ANNOTATION_TYPE in @target like (e.g. javax.validation.constraints.Min)

By this the bean validation are easily extended to @OnlyPositiveNumber.

in jaxb for Example (a bad one) I could have created @XmlAlwaysRequiredElement

Is there a good reason why JAXB annotations like XmlElement are not using the same technique?

  • 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-05-21T00:31:55+00:00Added an answer on May 21, 2026 at 12:31 am

    I doubt you could say “it wasn’t done because of X” – it is the way it is, and either the spec leads didn’t consider it necessary, or they didn’t think of it at all. Who knows.

    However, in the case, I don’t really see much need for it. You example concerns data validation, and JAXB is designed to work with XML Schema to do that, rather than doing to validation using annotations.

    If we want to have annotation-based validation for JAXB, then it would make more sense to use JSR-303 validations for this, and have the JAXB runtime pick them up and use them, rather than, or in addition to, XML Schema validation. None of the current implementations do that, though (I think).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Take a look at: http://jsfiddle.net/nHdAp want it to look like that in internet explorer
take look at this: http://www.templatemonster.com/demo/35403.html In this template you can click on the image
Take a look that the following code snippet: A a = null try {
Take look at the code that follows. Hello World!; The number is , 37;
Take a look at my fiddle: http://jsfiddle.net/jVsQY/ As you can see, I'm using text-align:
Take a look at http://new.reyniersaudio.com/test.html The idea here is that I want the container
Take a look here: http://jsfiddle.net/ELKHq/ , now I would like to set up minimum
Take a look at: http://groups.google.com/group/android-beginners/msg/61802d28a8335809 ive done that a got it to work but
take a look at this validation demo: http://jquery.bassistance.de/validate/demo/ the error messages are placed on
take a look of this: http://jsfiddle.net/PFQke/ I want to add some icons to that

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.