Extracting

Extracting the Java source in the form of a file out to a directory is useful for working in an IDE.

While in the IDE a user can edit, compile, and debug code. The extract program MQL command processes any special macros and generates a file containing the Java source of the JPO. If no source directory is given, the system uses ENOVIA_INSTALL/java/custom (which is added to MX_CLASSPATH automatically by the install program).

extract program PATTERN [source DIRECTORY] [demangle]

In order to use the extract feature, the JPO name must follow the Java language naming convention (i.e., no spaces, special characters, etc.). Only alphanumeric printable characters as well as '.' and '_' are allowed in class names in the JPO.

The demangle option causes the file and class names to be normalized during the extract. For example, an extract of the HelloWorld JPO by default would create a file named HelloWorld_mxJPOtAXMTwEAAAFAAAA.java containing a class named HelloWorld_mxJPOtAXMTwEAAAFAAAA. When using the demangle option, the extracted file will be named HelloWorld_mxJPO.java containing a class named HelloWorld_mxJPO. This ability is needed by some IDEs that do not deal well with the hash value added to the file and class names.

Program object names may include a package specification, such as enovia.java.custom.testjpo. In this example, enovia.java.custom is the package, and testjpo is the name of the class. In this case, the code of the JPO does not need to include a package statement; it is added to the code if necessary during compilation or extraction. In addition, when programs are extracted, the source is placed in an appropriate subdirectory based on the name of the JPO; for example, ENOVIA_INSTALL/java/custom/testjpo.java.