Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1.5
    • Fix Version/s: not determined
    • Component/s: spec
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      430

      Description

      Enhance JAXB to allow validation based on annotations, without requiring a schema.

      One of the benefits of JAXB 2 is that a schema is not required; annotating Java
      classes alone allows for XML serialization/deserialization. With the deprecation
      of the Unmarshaller.setValidating() in favor of the unmarshaller.setSchema()
      method, however, validation is only available when an XSD is present. Ideally,
      validation can occur during unarshalling (or marshalling) without a physical
      schema file.

        Activity

        Hide
        ovy9086 added a comment -

        now it's 2013... and still no updates on this. I just started with JAXB and in the first day I needed this and... BUMMER. Not available...

        Show
        ovy9086 added a comment - now it's 2013... and still no updates on this. I just started with JAXB and in the first day I needed this and... BUMMER. Not available...
        Hide
        areami added a comment -

        please have a look at https://github.com/whummer/jaxb-facets; they may have implemented this there

        Show
        areami added a comment - please have a look at https://github.com/whummer/jaxb-facets ; they may have implemented this there
        Hide
        Iaroslav Savytskyi added a comment -

        May be MOXy JAXB implementation can help.

        http://www.eclipse.org/eclipselink/moxy.php

        Show
        Iaroslav Savytskyi added a comment - May be MOXy JAXB implementation can help. http://www.eclipse.org/eclipselink/moxy.php
        Hide
        lennartj added a comment -

        Actually, being able to validate XSDs generated from annotated POJOs in a simple
        and useable form is still very important for JAXB. It is puzzling that this is not a
        trivial operation in the year 2013.

        My workaround has been the implementation in

        <dependency>
            <groupId>se.jguru.nazgul.core.xmlbinding.spi.jaxb</groupId>
            <artifactId>nazgul-core-xmlbinding-spi-jaxb</artifactId>
            <version>1.5.0</version>
        </dependency>
        

        It generates schema from annotated POJOs and performs validation during marshalling and unmarshalling.

        Show
        lennartj added a comment - Actually, being able to validate XSDs generated from annotated POJOs in a simple and useable form is still very important for JAXB. It is puzzling that this is not a trivial operation in the year 2013. My workaround has been the implementation in <dependency> <groupId>se.jguru.nazgul.core.xmlbinding.spi.jaxb</groupId> <artifactId>nazgul-core-xmlbinding-spi-jaxb</artifactId> <version>1.5.0</version> </dependency> It generates schema from annotated POJOs and performs validation during marshalling and unmarshalling.
        Hide
        olmath added a comment -

        It's now year 2015. This jira issue is open since 2007. Is there a chance to have this improvement implemented in a near future ?
        Could you please update this ticket with the current status of consideration ?

        Show
        olmath added a comment - It's now year 2015. This jira issue is open since 2007. Is there a chance to have this improvement implemented in a near future ? Could you please update this ticket with the current status of consideration ?

          People

          • Assignee:
            Martin Grebac
            Reporter:
            shelleyb
          • Votes:
            16 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated: