Wiley-Cordone, Peter wrote:
> I am trying to add a method to my value objects via custom
> templates that will call the trim function on all persistent
> fields that are string type. I have included the snippet below:
> 
>         <XDtType:ifIsOfType type="java.lang.String">
>          <XDtMethod:propertyName/>.trim();
>        </XDtType:ifIsOfType>

I haven't delved too deeply into the XDT, except to make some very
simple changes, but I can tell you that calling trim() on a String will
not alter the underlying String. Instead it returns a *new* String that
has been trimmed, which you are promptly dropping on the floor. If you
solve the code-generation problem, you'll still need to assign trim()'s
result back to the property:

    <XDtMethod:propertyName/> = <XDtMethod:propertyName/>.trim();

David Harkness
Sr. Software Engineer
Sony Pictures Digital Networks
(310) 482-4756


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to