It's done now - fromString(String) will also be checked, after valueOf, with the only exceptions being enums, where fromString will be tried first.

org.apache.cxf.jaxrs.ext.ParameterHandler implementations can also be registered when the default construction algorithm for parameters annotated with @PathParam (or other *Param annotations) is not suitable.

For ex, one can provide a JAXBParameterHandler which will deal with deserializing XML passed through uri query parameters. Perhaps we can extend our JAXBElementProvider to also implement ParameterHandler... ParameterHandler for types with no constructor with single String or valueOf(String) or fromString(String) can also be registered

Cheers, Sergey

Hi

UUID has a static fromString(String) method. I'll update the JAXRS runtime to check for static fromString(String) in addition to valueOf(String)... Adding ParameterHandlers extensions would be useful too, so that one can register ParameterHandler<Foo>, ParameterHandler<Bar>, etc

Cheers, Sergey

----- Original Message ----- From: "Vishal.a" <[email protected]>
To: <[email protected]>
Sent: Wednesday, January 07, 2009 5:09 PM
Subject: Re: MessageBodyReader For UUID



Thanks Ian.
Is there any other way i can make the use of UUID?



ianroberts wrote:

Vishal.a wrote:
Hello,

I have created a rest service which takes UUID as one of the parameters

@GET
@Path("/person/{id}")
public Person getPerson(@PathParam("id")UUID id);

I have also written a MessageBodyReader  for the UUID

MessageBodyReaders are only for reading the message body, they're not
used for PathParams.

PathParams can be any type with a constructor taking a String or with a
valueOf(String) method - UUID has neither, so I guess your only option
is to have a parameter of type String and do UUID.fromString in the body
of your method.

Ian

--
Ian Roberts               | Department of Computer Science
[email protected]  | University of Sheffield, UK



--
View this message in context: 
http://www.nabble.com/MessageBodyReader-For-UUID-tp21319272p21335914.html
Sent from the cxf-user mailing list archive at Nabble.com.



Reply via email to