You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Marco Piraccini <ma...@acm.org> on 2008/01/23 17:18:52 UTC

Jaxb char mapping

I'm using CXF with jaxws and jaxb. My problem is that the "char" java  
types are mapped to xs:unsignedShort (instead of xs:string with size 1  
as i expected).

I read the jaxb 2.0 specs, but the char primitive type mapping seems  
not to be defined.

There is a quick way to configure/customize jaxb to map char to xs:string?

Bye,

Marco.


Re: Jaxb char mapping

Posted by Daniel Kulp <dk...@apache.org>.
Marco,

You can probably add an @XmlType(...) annotation to the char field in 
your beans to make it a string.   There isn't a way in JAXB to do the 
facets required to add the size 1 restriction though.   That's a JAXB 
limitation.

Dan


On Wednesday 23 January 2008, Marco Piraccini wrote:
> I'm using CXF with jaxws and jaxb. My problem is that the "char" java
> types are mapped to xs:unsignedShort (instead of xs:string with size 1
> as i expected).
>
> I read the jaxb 2.0 specs, but the char primitive type mapping seems
> not to be defined.
>
> There is a quick way to configure/customize jaxb to map char to
> xs:string?
>
> Bye,
>
> Marco.



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog