users@jersey.java.net

RE: [Jersey] List<T> Use Sentence Case instead of Camel Case

From: James Allchin <james_at_knowledgemill.com>
Date: Tue, 13 Oct 2009 01:53:46 -0700

Hi Paul,

Thanks for update. Yep had noticed that the java.net sites have been getting very slow / unresponsive in recent weeks.

If we know it's a known issue, we'll live with it until resolved sometime in the future.

Cheers

James.
________________________________________
From: Paul Sandoz [Paul.Sandoz_at_Sun.COM]
Sent: 13 October 2009 09:16
To: users_at_jersey.dev.java.net
Subject: Re: [Jersey] List<T> Use Sentence Case instead of Camel Case

Hi James,

This is an open issue. I would point you to it, but unfortunately
java.net is still having it's own issues coping with DoS attacks. For
example, Hudson has not managed to complete a successful build for
over a week! things are in a terrible state. At this point we are
seriously considering moving off java.net after our EE 6 work is
complete

Paul.

On Oct 9, 2009, at 7:03 PM, James Allchin wrote:

> Hi All,
>
> I have a number of JAXB beans that are directly marshalled and
> unmarshalled using Jersey.
>
> E.g.
>
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlType(name = "Artifact", propOrder = {
> "artifactId",
> "artifactType",
> "contentHash"
> })
> @XmlSeeAlso({
> EmailArtifact.class,
> ManagedDocArtifact.class
> })
> @XmlRootElement(name ="Artifact")
> public class Artifact {
>
> protected String artifactId;
> protected String artifactType;
> protected String contentHash;
>
> ...
> ...
> ...
>
> }
>
> If I create a GET method that returns a single artifact object. It
> correctly produces the XML:
>
> <Artifact>
> <artifactId>293289392839283</artifactId>
> <artifactType>EMAIL</artifactType>
> <contentHash>2837873827322</contentHash>
> </Artifact>
>
> Here I have been able to successfully control the name of the
> Artifact element to have a capital "A" at the beginning.
>
> However, I create a GET method that returns collection of artifact
> objects, I end up with:
>
> <artifacts>
> <Artifact>
> <artifactId>293289392839283</artifactId>
> <artifactType>EMAIL</artifactType>
> <contentHash>2837873827322</contentHash>
> </Artifact>
> <Artifact>
> <artifactId>293289392839283</artifactId>
> <artifactType>EMAIL</artifactType>
> <contentHash>2837873827322</contentHash>
> </Artifact>
> </artifacts>
>
> As you can see the outer element for the collection has a lower case
> "A". In order to conform to our own internal standard I would like
> this to be a capital "A" - Artifacts.
>
> I can not see where this is possible to define within JAXB, is it
> actually the Jersey framework that is controlling this?
>
> Can we control of the element name generated for collections?
>
> Many thanks,
>
> James
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>