Close

Results 1 to 3 of 3
  1. #1
    DF VIP Member OrangeJuicey's Avatar
    Join Date
    Aug 2006
    Location
    London
    Posts
    1,283
    Thanks
    1
    Thanked:        4
    Karma Level
    289

    Having java code create new java classes.

    hi,

    I've got about 10 classes each with 50 methods inside them, I need to create a seperate class for each method inside each class.

    The first thing i need to do is get all the methods using reflection so i have an array of methods for each class. I then want to loop through this array and for every method have the code create a new class with the name method.getName(); and then place the code from that method into that class automatically. Any ideas on how to do this?

    (I've got some ideas but i just thought i'd see what everyone thought)

    thanks


  2. #2
    DF VIP Member blacksheep's Avatar
    Join Date
    Jun 2006
    Location
    Manchester
    Posts
    3,877
    Thanks
    87
    Thanked:        265
    Karma Level
    546

    Default Re: Having java code create new java classes.

    One of the ways I've seen it done, not saying that it's def the best way out there, is to have the original java code produce xml which once run through an xslt style sheet produces the code.

  3. #3
    DF VIP Member OrangeJuicey's Avatar
    Join Date
    Aug 2006
    Location
    London
    Posts
    1,283
    Thanks
    1
    Thanked:        4
    Karma Level
    289

    Default Re: Having java code create new java classes.

    I think i'm gonna give up trying to do this and just do it long handed, got another developer to help me but it's still gonna be effort. Theres too much refactoring requried for each method that needs to go to a class to be able to automate it.

    Just in case you were interested i'm creating a fake rules engine implementation for conversion of java rules to iLog rules engine. By using the fake rules engine its one step closer to the real thing so its much easier to convert the rules this way.

    Thanks for the reply

Similar Threads

  1. Code for Blaupunkt Car 300 Radio?
    By fais in forum Radio Decoding
    Replies: 8
    Last Post: 30th March 2004, 03:38 PM
  2. Replies: 133
    Last Post: 20th December 2002, 03:10 AM
  3. sony z5:security code
    By Danger Mouse in forum Unlocking Questions & Solutions
    Replies: 1
    Last Post: 6th September 2002, 05:41 PM
  4. Eurotunnel cheap fare or discount code - priviledge member?
    By shedsounds in forum Cheapskates Corner
    Replies: 2
    Last Post: 5th September 2002, 10:21 AM

Social Networking Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •