I'm not sure this will be necessary.  The one field I know of that needs no 
trimming (env-entry value) has a special adapter apparently so it doesn't get 
trimmed.  I did some experiments which I think indicate that strings are 
normally trimmed, but I sure can't find any documentation and found a comment 
from kohsuke that I think indicates trimming shouldn't happen for strings.

http://forums.java.net/jive/message.jspa?messageID=132369

anyone know more??

thanks
david jencks


On Sep 29, 2010, at 6:38 PM, Ivan wrote:

> Agree to have a trim adapter, actually, most fields should be trimmed. While
> looking at the web deployment codes in Geronimo, too many trim() methods are
> invoked on those web elements, e.g. servlet-class. http-method ...
> 
> 2010/9/30 David Jencks <[email protected]>
> 
>> I think that most javaee schema string element content is supposed to have
>> whitespace trimmed off before trying to interpret it, and I think that jaxb
>> doesn't do that by default unless you specify a suitable XmlJavaTypeAdapter.
>> A few fields in our jee tree use the CollapsedStringAdapter but IIUC that
>> also does something to whitespace inside the string.
>> 
>> So I'm wondering if there's any reason I shouldn't write a
>> TrimStringAdapter that just trims strings and use it with all the fields
>> that are supposed to be trimmed but not collapsed?
>> 
>> An example of a field that should not be trimmed is an env-entry value.....
>> whitespace is a legal value here.
>> 
>> thanks
>> david jencks
>> 
>> 
> 
> 
> -- 
> Ivan

Reply via email to