Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9269253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:04:18+00:00 2026-06-18T15:04:18+00:00

My application contains a lot of objects that implement an interface. Those objects all

  • 0

My application contains a lot of objects that implement an interface.

Those objects all have the same functions, and what mainly depends between them is the number of class variables and their type.

I think about creating a general template that could be filled with only a few parameters (name of the class, name of each variable and its type).

Here is a (really) simple example (having two parameters ):

    public class myClass implements anotherClass {

    private int a;
    /** Image reference */
    private int myInt;    

    /** Security elements */
    private String myString;

    public myClass() {
    }


    public myObj getValueObject() {
        myObj value = new myObj();

        value.setmyInt(myInt);
        value.setmyString(myString);

        return value;
    }    

    public String getmyInt() {
        return myInt;
    }

    public void setmyInt(String myInt) {
        this.myString = myString;
        if (a == 10) {
            a =0;
        }
    }    

    public String getmyString() {
        return myInt;
    }

    public void setmyString(String myString) {
        this.myString = myString;
        if (a == 10) {
            a =0;
        }
    }    

    public int doIt() {
        int number = 0;
        number = number + toNumber(myInt);
        number = number + toNumber(myString);
        return number ;
    }    

}

As I said, the only difference between classes is the number, name and type of the variables.

I looked at code templates in Eclipse, but it seems to be simple (but efficient) string replacement.
I would like a bit more, as it needs to write more or less code depending on the number of input variables.

I could hard code something in Java with string replacement by myself, but I wonder is there is not a tool somewhere that could help me in my task.

I would feed it with prototypes of my methods and my inputs variables.

Any hint is appreciated,
Thanks !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T15:04:19+00:00Added an answer on June 18, 2026 at 3:04 pm

    I found JDynamiTe that does what I want.

    I use it to dynamically generate my files given lists of inputs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a console application that contains quite a lot of threads. There are
I'm working on a C# application that contains a lot of DataGridViews which are
I have an application that contains many controls on a panel, each with its
I have a WPF application that contains some Window s with few UserControl s
Currently, I have to fix an existing Silverlight application that's leaking a lot of
I've got a WPF application which contains a standard DataGrid showing a lot of
To make things simple, my Delphi XE application contains objects in charge of generating
I have an existing C++ win32 console app. This application contains a main program
I've been tasked with porting/refactoring a Web Application Platform that we have from ASP.NET
In my Rails application, I have a variety of database tables that contain user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.