The reverse perimeter - elements to reverse, external elements

 

Usually, an application (or even a component or a single class) is composed of its own specific elements: its source files, and external elements such as JAR files or external classes.

 

We will call the application's own elements "Elements to reverse".  Most often, these elements will be systematically reversed.

 

Elements which are essential to the application but which do not actually belong to it will be called "External elements".  The reverse of these elements is not complete.  They will be reversed according to the needs at the time of the reverse of the "External elements".

 

Example:

 

// File HelloJava.java

public class HelloJava {

   public static javax.swing.JFrame jFrame;

 

   public static void main(String[] args) {

        jFrame = new javax.swing.JFrame("HelloJava.java");

        jFrame.setSize(170, 50);

        jFrame.getContentPane().add(new javax.swing.JLabel("Hello, Java !"));

        jFrame.setVisible(true);

   }

}

 

In this example, the element to reverse is the "HelloJava" class. The external element is the "JFrame" class.  The Reverse tool will produce the model shown in Figure 89 below.

 

Figure 89. Example of a reverse

 

The "HelloJava" class uses the "JFrame" class.  The contents of the "JFrame" class are reversed into the model with the {JavaExtern} tagged value.  "JFrame" stems from the "rt.jar" external component (binary).  This component contains many classes (more than 3000) that are not reversed because they are not used or referenced by "HelloWorld.java".  This prevents the model from being overloaded with all the external elements.

 

 

"Reverse from source files" mode

This reverse mode is available through the "Java Developer/Reverse Java application from sources" command in the context menu of a package.

In this mode, the elements to reverse are Java source files.  The elements used can be available as source files (source files whose reverse is not required but which are held in the directory of the files to be reversed), or as compiled files ("class" or "jar" files defined in the classpath option of the reverse).

 

The following table shows the reverse level reached when reversing source files.

 

    

    

Simple-Structural

Complete-Structural

Complete-Reverse

Elements to reverse

Java sources

X*

X*

X*

Elements to reverse

Binaries

  

  

  

External elements

Java sources

  

  

  

External elements

Binaries

X

  

  

 

Note 1:   "X" indicates that the element is retrieved during the reverse.

 

Note 2:   "*" indicates that the reverse level reached is the one selected at parameter configuration level or when launching the Reverse tool assistant.

 

 

"Reverse from compiled files" mode

This mode is available through the "Java Developer/Reverse Java binaries" command in the context menu of a package.

 

The elements to reverse are compiled files.  The elements used can be provided as compiled elements only.

 

The following table summarizes the reverse level reached when reversing compiled elements.

 

    

    

Simple-Structural

Complete-Structural

Complete-Reverse

Elements to reverse

Java sources

  

  

  

Elements to reverse

Binaries

X*

X*

  

External elements

Java sources

  

  

  

External elements

Binaries

X

  

  

 

Note 1:   "X" indicates that the element is retrieved during the reverse.

 

Note 2:   "*" indicates that in compiled files reverse mode, comments and operation parameter names are not reversed.  For further details, please see "Three reverse levels".