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

  • SEARCH
  • Home
  • 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 920327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:41:42+00:00 2026-05-15T18:41:42+00:00

I am using IBM Rational Software Architect for creating a UML Model and then

  • 0

I am using IBM Rational Software Architect for creating a UML Model and then transforming it to Java Code.
Unfortunately the generated Java Souce Code format isn’t the greatest, at least it is not the format I want to use. An example:

/**
 * 
 */
package net.game3.shared.entity;

/** 
 * <!-- begin-UML-doc -->
 * <!-- end-UML-doc -->
 * @author Heinrich
 * @generated "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)"
 */
public class Structure {
    /** 
     * <!-- begin-UML-doc -->
     * <!-- end-UML-doc -->
     * @generated "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)"
     */
    private String type;

    /** 
     * @return the type
     * @generated "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)"
     */
    public String getType() {
        // begin-user-code
        return type;
        // end-user-code
    }

    /** 
     * @param type the type to set
     * @generated "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)"
     */
    public void setType(String type) {
        // begin-user-code
        this.type = type;
        // end-user-code
    }

    /** 
     * <!-- begin-UML-doc -->
     * <!-- end-UML-doc -->
     * @generated "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)"
     */
    private Integer id;

    /** 
     * @return the id
     * @generated "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)"
     */
    public Integer getId() {
        // begin-user-code
        return id;
        // end-user-code
    }

    /** 
     * @param id the id to set
     * @generated "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)"
     */
    public void setId(Integer id) {
        // begin-user-code
        this.id = id;
        // end-user-code
    }
}

One point is, I would like to see all private member variables to be declared first and then the getter/setter methods follow.

Both RSA and Eclipse are very powerful tools why I hope that someone of you knows a way to change or specify the Source Code Layout/Format.

Best Regards,
Erik

  • 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-05-15T18:41:43+00:00Added an answer on May 15, 2026 at 6:41 pm

    Preferences > Java > Editor > Save Actions. One of the “additional actions” is “Sort members”. It’ll reorganize the class members (like privates fields being grouped) after each save. Might also want to look into the Java > Code Style > Formatter to see if it helps.

    Edit: If you’re not going to edit the files and still want to Sort Members, you can do it via the Project Explorer context menu under Source > Sort Members....

    Every time I’ve used generated code, I had to massage it a bit anyway and assumed you would too. My bad.

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

Sidebar

Related Questions

I'm using IBM's Rational Software Architect (essentially Eclipse I suppose). I have a JAR
We are using version 7 of IBM RAD/RSA (Rational Application Developer/IBM Rational Software Architect).
I am generating WSDL/XSD for SOAP services from a UML model using IBM Rational
I am creating a test project using IBM's Rational Functional Tester(RFT) tool(we are using
Using IBM Rational ClearCase: - I have only access to Snapshot Views so NO
I am investigating a Java issue (using IBM JVM 1.4.2 64-bit) on Red Hat
I am using IBM Websphere Application Server v6 and Java 1.4 and am trying
I am using IBM CPLEX to model a constraint program using the C++ API.
We are using IBM (formerly Telelogic) Rhapsody for a new project to do model
We are using RDI (IBM Rational Developer for System i) to do cobol development

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.