file Questions about reverse engineering

4 years 1 month ago #2717 by Julie
I tried the reverse engineering feature provided by the Java Designer which shipped with the default package of Modelio. I got two questions.

The environment configuration is here.
Version 3.1.1
Build: 201402210039
Metamodel: 9020
System: win32 (6.1)
Architecture: x86_64

Now the questions.
1. There is a warning after the reverse process is done that complains about static import. I am not sure if this is fine. The message is like this.
"The import 'static java.math.RoundingMode.CEILING' cannot be resolved.
A 'JavaImport' tagged value was generated for this import."

2. The Javadoc comments using /**... */ are gone after I generated the code after reverse engineering from the model. Other commands using /*...*/ and // are there. Did I miss anything?

Any feedback is welcome. Thanks!

Please Log in or Create an account to join the conversation.

4 years 1 month ago #2724 by cde
Hi Julie,

1. As it is impossible to create an 'Element Import' link from a Class towards an Enumeration Literal, Modelio will use a JavaImport tagged value to model your static import.
When you will generate your reversed code, the 'import static java.math.RoundingMode.CEILING;' line will be generated.

2. The /**...*/ javadoc type works the same way as the /*...*/ one. The problem is more probably due the location of the /*...*/ in the source code. For example, if the javadoc is located between import lines, it will not be reversed...
Can you post the content of one source file producing the problem, so we can investigate?

Best regards,
cde.

Please Log in or Create an account to join the conversation.

4 years 1 month ago #2726 by Julie
Thanks for your answer.

Question 1. Yes, I verified the static imports are in the generated code. So it's fine to ignore those warnings.

QUestion 2. Regardless of the location, all Javadoc style comments are gone. Please see the following code.

Original code: Test.java
================================================
/**
* Class comment 1
*/
// Class comment 2
/*
* class comment 3
*/
public class Test {
/**
* Field comment 1
*/
// Field comment 2
/*
* Field comment 3
*/
String value;

/**
* Method comment 1
*/
// Method comment 2
/*
* Method comment 3
*/
public String getValue() {
return value;
}

public void setValue(String value) {
this.value = value;
}
}

Generated code after reverse engineering
=======================================
import com.modeliosoft.modelio.javadesigner.annotations.objid;

// Class comment 2
/*
* class comment 3
*/
@objid ("5757891a-c5e4-4b70-bbe3-d506a171d9a0")
public class Test {
// Field comment 2
/*
* Field comment 3
*/
@objid ("498660f7-a911-460f-9380-a197ab4b6976")
String value;

// Method comment 2
/*
* Method comment 3
*/
@objid ("743029f6-65b4-41b3-ba83-0a164eb915c1")
public String getValue() {
if (value == null)
return CEILING.toString();
return value;
}

@objid ("13cfad36-43ed-443f-8f8f-b47dfb001f92")
public void setValue(String value) {
this.value = value;
}
}

Please Log in or Create an account to join the conversation.

4 years 1 month ago #2729 by cde
Hi Julie,

I've just realized what is the problem...
The JavaDoc generation is not activated (only Java Comments are generated in your example), so you just need to activate it.

To do so, click on the 'Configuration\Modules...' menu item.



In the appearing window, select the Java Designer module -> The Java Designer parameters appear.
Expand the 'JavaDoc' entry and check the 'Generate JavaDoc' tickbox.



Then your javadoc will be generated :)

Best regards,
cde
Attachments:

Please Log in or Create an account to join the conversation.

4 years 1 month ago #2735 by Julie
Hi cde,

You are right. After I activated the option to generate Javadoc, it works nicely. Thank you very much!

I got one more question regarding reverse engineering. Is there anyway to keep the order of the fields and methods in the original class in the class generated from the reverse engineered model?

Thanks,
Julie

Please Log in or Create an account to join the conversation.

4 years 1 month ago #2738 by chm
Hi Julie,

as far as I know, you can't change the order during the reverse itself, but you should be able to reorder attributes and operation afterwards in the model.

Hope this helps,


chm

Please Log in or Create an account to join the conversation.

Moderators: andy
Time to create page: 0.178 seconds
^ Back to Top