users@jaxb.java.net

Re: initcap element names?

From: Dmitri Colebatch <colebatchd_at_gmail.com>
Date: Wed, 22 Jun 2005 07:35:01 +1000

Hi - comments at the end:

On 6/21/05, Sekhar Vajjhala <Sekhar.Vajjhala_at_sun.com> wrote:
> Dmitri Colebatch wrote:
>
> >Hi again,
> >
> >I'm finding the default bindings almost very useful, with one problem
> >- my schemas have initcap names almost excusively. So I want
> >
> >@XmlRootElement
> >@XmlAccessorType(AccessType.FIELD)
> >class Foo
> >{
> > private String bar;
> >
> > public String getBar()
> > {
> > return bar;
> > }
> >
> > public void setBar(String bar)
> > {
> > this.bar = bar;
> > }
> >}
> >
> >to become
> >
> ><Foo>
> > <Bar>wertyui</Bar>
> ></Foo>
> >
> >but unfortunately spits out
> >
> ><foo>
> > <bar>wertyui</bar>
> ></foo>
> >
> >I don't suppose there's an easy switch to 'fix' this for me?
> >
> There is no such switch at this time.
>
> To clarify, are you asking for WYSWIG for element names not just retaining
> the init capital letter for element names. For e.g.
> - Foo maps to element name Foo
> - PurchaseOrder would map to element name PurchaseOrder
>
> Is the above correct ?

Type Foo maps to element Foo, yes. Although the field may be foo.
There is certainly no question that the current default is correct, as
the field called 'foo' is mapped to an element called 'foo' - just so
happens this doesn't match what I've been asked to do (o:

cheers
dim