Installation instructions
The reverse engineering capabilities are part of the Java feature of Papyrus SW designer. Java reverse is available, once the Java feature is installed via update site or marketplace. See Getting started
How to use Reverse
Using Command
Reverse-engineer a Java class
A Java class can be reverse-engineered into a Papyrus class diagram:
A UML class is created in Model Explorer. You can now add it to your diagram. Note that all associated classes have also been added to the model.
Reverse-engineer a package
A Java package (and all classes included) can be reverse-engineered into a Papyrus class diagram:
Packages and classes have been created in Model Explorer. Your can now add them to your diagram. Note that all associated classes have also been added to the model.
Reverse-engineering settings
By default, a package named "generated" is created for reverse-engineering. You can choose another package name in the options menu.
This option menu allows one to:
-
Change the default package of the reverse-engineering,
-
Add or remove search path. The reverse generator search existing UML classes and regenerate them.
-
Add or remove creation path. The reverse generator search on existing Java classes to generate a UML class. Useful for creating Java imports (e.g.: String, Integer).
Using Drag & Drop
You can reverse-engineer a class or a package by just dragging & dropping it on a Papyrus diagram:
-
Drag one or more classes and/or packages,
-
Drop the selection into an open diagram.
A settings dialog is opened. You can modify settings (please see Reverse settings). When you are reverse-engineering via the drag & drop method, you can also choose to display model, packages, and classes / interfaces / enumerations in the Papyrus diagram. To enable display, just click the check-boxes:
When you click the OK button, your components are displayed in the Papyrus diagram. Note: while all selected components are reversed-engineered, only components which are selected, but not in the Papyrus diagram are displayed.
Change default reverse-engineering settings
The Java code reverse-engineering plugin allows you to change default settings on eclipse preferences
-
Open Eclipse Preferences,
-
Search for the Papyrus section,
-
Choose Java Code Reverse sub-section
On this preferences page, you can change
-
default search path values,
-
default creation path values.
Note that there are default values; if you have changed these values for a project, your changes are saved, and default values are not used.
Developer resources
-
Git repo: https://gitlab.eclipse.org/eclipse/papyrus/org.eclipse.papyrus-designer
-
Java plugins path: plugins/languages/java/
-
Java reverse plugins, in the sequel we use the abbreviation oepd for the package prefix org.eclipse.papyrus.designer
-
oepd.languages.java.reverse.ui - plugin for the UI part of the Java reverse mechanism
-
Starting points when called from toolbar UI:
-
Class oepd.languages.java.reverse.ui.handlers.JavaCodeReverseInJobHandler - the methods doPrepareExecute(ExecutionEvent) and doExecuteTransactionInJob(IProgressMonitor) are called first
-
Project explorer walker
-
Class oepd.languages.java.reverse.ui.ProjectExplorerNodeWalkerWithIProgress - the methods doSwitch(Object, SubMonitor) and visitICompilationUnit(ICompilationUnit, SubMonitor) traverse the project explorer resources recursively until reaching a compilation unit (called a "node" in this context).
-
Class oepd.languages.java.reverse.ui.ReverseSelectedNodeVisitor - the method visitICompilationUnit(ICompilationUnit) examines JDT elements of a compilation unit.
-
-
org.eclipse.papyrus.designer.languages.java.reverse - plugin for the Java reverse mechanism
-
package oepd.languages.java.reverse.javaparser - Parse Java code
-
Class oepd.languages.java.reverse.umlparser.CompilationUnitAnalyser - analyze a compilation unit and create associated UML elements. The compilation unit analyzer uses other classes of the package oepd.languages.java.reverse.umlparser
-
-





