# Java reverse

The Java code reverse is a plug-out directly written in C++.

Note that the Java code reverse cannot be used as a Java code round trip and doesn't allows to update already defined classes having at least one member.

The Java code reverse plug-out may be applied only on a package.

When you start the Java code reverse, it asks you for java catalog files, use cancel to finish to give the catalogs (may be immediately), then it ask for a directory, then it reads all the sources placed under the selected directory and sub-directories. The sources read by the Java code reverse are the ones having the extension specified in the generation settings. The tree formed by the sub-directories produce an equivalent tree of sub-packages, on whose the needed class view and deployment view are made to support the classes and artifacts. When a type is referenced but not defined in the reverse files, a class having the same name is defined under an additional package named unknown.

Obviously the Java code reverse tries to produce the definitions made in BOUML at the artifact / class / operation / relation / attribute levels. When it is possible it creates a relation rather than an attribute.

A artifact is created for each type definition, then a future Java code generation may not produce a list of files similar to the reversed ones.

The Java code reverse works in two steps, during the first step it scans all the files to establish the list of defined types, then the second step may reverse the files.

When the Java code reverse has a problem, for instance on a syntax error, it produces a warning in the trace window. The trace window is automatically opened by BOUML, it may also be manually opened through the Tools menu.

When the reverse is done, the number of reversed classes, operations, attributes and relations is written, for instance in case I reverse a full JDK Java distribution :

See also Java catalog.

Previous : Java generator

Next : Java catalog