#9 allow to alter field name prefix

open
nobody
5
2011-11-02
2011-11-02
Anonymous
No

Beans generated using the BeanGenerator have their final field names prefixed with a string. This is because of a hard coded string in the method 'add_properties' of class EmitUtils. The prefix is always: '$cglib_prop_'

I came accross a situation where I needed to dynamically duplicate an object model and feed this into existing legacy application. The legacy code used some sort of reflection mechanism to access bean properties. I had to recompile cglib applying a fix which makes it possible to alter the fieldname prefix.

My solution is attached. The default value is '$cglib_prop_'. Applications which rely on this prefix will still work.

Discussion

  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2011-11-02

    sample solution

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2011-11-02
    • summary: allow to alter property name prefix --> allow to alter field name prefix
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks