Chapter 27. Export and Import

  1. Home
  2. Docs
  3. Chapter 27. Export and Import
  4. 5. Command-line Interface
  5. Using Instant Reverse with command

Using Instant Reverse with command

Reverse to Class Model

To reverse source code to a project through command line:

  1. Browse the scripts folder under the Visual Paradigm installation directory. For Mac users, you can find the scripts folder in the Visual Paradigm package by right clicking on it and then selecting Show Package Contents. Then look in Contents\Resources\app\scripts for the scripts folder.
  2. Start the command prompt.
  3. Execute the script by supplying the required parameters. For example:
    InstantReverse -project C:\Demo\Demo.vpp -path C:\Demo\MyProject\src -lang Java -pathtype folder -sourcetype source

    Parameter Description Example
    -project Project path C:\Demo\Demo.vpp
    -path The file or folder path of the source files to be reversed C:\Demo\Output\src
    -lang Specify the language of the source code to reverse. Here are the possible options:

    • Java
    • “C++ Source”
    • “.NET dll or exe files”
    • “CORBA IDL Source”
    • Ada 9x Source”
    • XML
    • “XML Schema”
    • Hibernate
    • “PHP 5.0 Source”
    • “Python Source”
    • Objective-C
    Java
    pathtype Useful only for Java, pathtype defines the type of the path supplied for -path. Here are the possible options:

    • file
    • folder
    • zip
    file
    sourcetype Useful only for Java, sourcetype defines the type of source to reverse. Here are the possible options:

    • source
    • class
    source
    -overwrite | -update Overwrite or update model from code – overwrite

Reverse Java to Sequence Diagram

To reverse Java source code to a project as sequence diagram through command line:

  1. Browse the scripts folder under the Visual Paradigm installation directory. For Mac users, you can find the scripts folder in the Visual Paradigm package by right clicking on it and then selecting Show Package Contents. Then look in Contents\Resources\app\scripts for the scripts folder.
  2. Start the command prompt.
  3. Execute the script by supplying the required parameters. For example:
    InstantReverseSD -project C:\Demo\Demo.vpp -path C:\Demo\MyProject\src -pathtype folder -class com.vp.sample.OrderController -operation purchase(int,int)

    Parameter Description Example
    -project Project path C:\Demo\Demo.vpp
    -path The path of the source files to be reversed. If the source is a zip, it’s the file path of the zip file. If the source is a Java file, it’s the root folder of the source files (not the path of the .java file). C:\Demo\Output\src
    pathtype Useful only for Java, pathtype defines the type of the path supplied for -path. Here are the possible options:

    • folder
    • zip
    folder
    class The fully qualified name of the class (include package declaration) in which the operation to be reversed reside in. com.vp.sample.OrderController
    operation The fully qualified name of the operation to be reversed. If you want to reverse an operation like this:

    public void oper1(int a, boolean b){

    }

    Then, you should provide oper1(int,boolean) as signature here.

    purchase(int,int)