users@jaxb.java.net

JAXB 2.0 XJC Value-Constructor Plugin

From: Dave Hoffer <DHoffer_at_xrite.com>
Date: Wed, 28 Nov 2007 17:08:49 -0500

I notice the value-constructor plugin creates constructors for all
parameters irregardless if they are required. Is this customizable?
What I would really like are over-loaded constructors that take all the
required parameters and then optionally the others.

Also I have one other request that I don't know fits into this plugin or
not. Here goes...for all attributes with type of xs:ID I want to auto
set this to be _[GUID] where [GUID] is an actual auto generated GUID
value. I have the code to generate the GUID I just need a way to feed
this to the value-constructor (or something) such that in all
constructors, default no-arg and fully-initializing, these member
variables are set with this value. In this case I would prefer the
element not be included in the fully-initializing constructors.

The reason for this is that I want to use ID/IDREF in the schema to
limit duplication but I do not want the Java object users to have to
'know' to set the xs:ID value since it is not part of the object model,
rather it is just part of the XML implementation details that I want to
fully isolate Java users from.

Are there ways other than using the value-constructor to get this
effect?

-Dave