History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: XDT-608
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Trivial Trivial
Assignee: Heiko W. Rupp
Reporter: Sven Künzler
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
XDoclet

<fieldName> capitalize attribute

Created: 15/Aug/03 05:37 AM   Updated: 18/Jun/04 11:14 AM
Component/s: Core
Affects Version/s: 1.2 Beta 3
Fix Version/s: 1.2.2

Time Tracking:
Original Estimate: Not Specified
Remaining Estimate: 0 minutes
Time Spent - 15 minutes
Time Spent: 15 minutes
Time Spent - 15 minutes

File Attachments: 1. File namecap.diff (1 kb)
2. Text File new_patch.txt (2 kb)
3. Text File patch.txt (2 kb)
4. Text File patch.txt (2 kb)

Environment: Any


 Description  « Hide
When using the field tagss for Java source generation, it is ofen necessary to convert the first letter of the field name to upper case (field foo --> doFooCommand() etc).

Unless there is not a way to achieve this already, I'd like to propose a "capitalize" attribute for the fieldTag-Tag. When set to true, it will convert the first letter to upper case, otherwise the tag's behaviour is unchanged.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Sven Künzler - 15/Aug/03 05:39 AM
Proposed functionality as patch

Felipe Leme - 02/May/04 07:38 PM
I agree - the capitalization feature is quite interesting. I created a patch too, although with a slightly different approach: my patch creates 2 new methods for the FieldTagsHandler: setterName() and getterName().

These methods use xdoclet.ConfigParamIntrospector to create the setter and getters for a field. Here is an example on how I'm using it to create a JSP custom tag:

<XDtField:forAllFields>
   public abstract void <XDtField:setterName/>( <XDtField:fieldType/> <XDtField:fieldName/> );
</XDtField:forAllFields>

I think this improvement is very important - unless there is anothe way to achieve what we are looking for.

Regards,

Felipe



Felipe Leme - 02/May/04 07:39 PM
Here is the patch I mentioned - it creates 2 new methods on FieldsTagHandler.java

Felipe Leme - 02/May/04 08:15 PM
After reading Sven's comments more carefully, I decided to create a new patch, as my previous patch would not solve his problems.

Felipe Leme - 02/May/04 08:18 PM
Oops, I uploaded the wrong patch earlier. Sorry...

Heiko W. Rupp - 16/May/04 01:12 AM
Patch applied - Thanks.
(I was looking for such a thing about a 1.5 years ago, when I was trying to produce Swing GUIs from EntityBeans declarations).

Felipe Leme - 18/Jun/04 11:14 AM
Just as a side note, I mentioned this patch in my article (which is what motivated my patch :-):

http://today.java.net/pub/a/today/2004/06/18/el-taglib.html