Book a Demo

Author Topic: Propertys instead of Attribut (Importing Java)  (Read 2417 times)

baz

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Propertys instead of Attribut (Importing Java)
« on: November 24, 2005, 01:57:47 am »
Hello,
I'd like to import (reverse engineer) a Java Source directory.
Each of my Sources have a couple of propertys and i like to import them as 'Propertys'
The goal is:
Using 'Hide  property method' in the class diagramm so that only the other methods (not getter or setter) are displayed.

But as far as i discovered all of my propertys are imported as Attributes together with getter/setter Method.

For example:
Code: [Select]
public class BAZurl {

private String name;
private String url;

public BAZurl(String synonym, String url) {
   super();
   this.name = synonym;
   this.url = url;
}

public BAZurl() {
}

public String getName() {
   return name;
}

public String getUrl() {
   return url;
}

public void setName(String name) {
   this.name = name;
}

public void setUrl(String url) {
   this.url = url;
}

public void blogic(){...}

Only the constructors and the method blogic should show up in the class diagramm after importing this class.

I could change the status of all the attributes(over 300) by hand. And i really have tried this aproach on a couple of classes with a handful of Propertys. But when it comes to synchronization (reverse) the Propertys will become attributes again.
How can i import Java files with all propertys (An attribute with a getter and a setter method) as property?
Ciao,
Carsten

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Propertys instead of Attribut (Importing Java)
« Reply #1 on: November 24, 2005, 01:36:45 pm »
EA should identify the properties, so long as you tell it what properties should look like.

Play around with the following settings to get it right.

Source Code engineering
  • Remove Prefixes ...
  • Treat as suffixes
  • Capitalized Attribute name ...
  • Use 'Is' for Boolean ...
Java
  • Get Prefix
  • Set Prefix

Edit: You can even modify the 'New diagram options' on the Import Directory Structure dialog to automatically hide property methods that are imported.
« Last Edit: November 24, 2005, 01:39:47 pm by simonm »

baz

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Propertys instead of Attribut (Importing Java)
« Reply #2 on: November 25, 2005, 12:25:19 am »
Hello,
Many many Thanks. That helped. Especially
   Capitalized Attribute name
Ciao,
Carsten