Functional Specification: JAXB Schema Validation
[enter bug location here]
|Date||Author||Version Description & Notes|
This feature is about validating project JAXB content against one or more XML schemas
- Allow users to specify none or more schemas against which to validate their JAXB classes
- Allow for as many different ways of specifying a schema as possible
This concept of validation is different from the concept of validation covered in the JAXB specification. That concept dictates how and when XML instance documents are to be validated against the schema that defines them, whereas this concept dictates how the java (and associated) metadata is to be validated against the metadata of the schema. That is, it is an application of the rules of the JAXB specification in a user friendly format.
When a user generates a java object model from a schema, it is assumed that the object model is already valid. When a user is generating a schema from a java object model, obviously there is no schema yet against which to validate. But when a user is defining a meet-in-the-middle java object model against an existing XML schema (or when he is modifying a java object model that he has either generated from a schema or from which he has already generated a schema) this validation will describe where there are inconsistencies.
The @XMLSchema annotation describes the namespace and prefixes of the schema with which the package is associated. It also describes a 'location' variable, but it is not required, and it seems to be more a setting for generation, or more specifically, for *no* generation. That is, if it is specified, then the schema is not generated.
Requirements / Functionality
Allowing a user to enter namespace:schema location values for a project would be analogous to a user setting a connection for JPA projects. This would likely be a project setting, possibly done during project creation.
It would be good to try and tie either schema generation or class generation into this. That is, if a user generates classes from a schema, or a schema from classes, it would be nice to add that schema's namespace and location to the project settings.
A variety of formats of schema location would be desirable. Examples include project relative resources, workspace resources (e.g. platform:/plugin/<location>), file system resources (e.g. file:/C:/<file location>), and web resources.