Integrations (PTC products, 3rd party products and code) > Code integration (Ada, ARINC 653, C, C#, C++, IDL, Java, SQL and VB) > Java code > Reverse engineering legacy Java code > Generating Java code > Concepts > Modifying object names when inserted into Java code (Java code)
  
Modifying object names when inserted into Java code (Java code)
Model object names in a model may be invalid if inserted directly into Java code, for example, they may contain spaces. For this reason, ACS modifies model object names when they are inserted into your Java code. This modifying of names is controlled through mangle.ini. ACS uses the mangle.ini file to match model object names with their associated Java code elements. Typically, you do not have to change the mangle.ini file.
You can avoid using the mangled name of an item by specifying the exact name you want to insert into your code through the item's CODE_GENERATION_NAME property, which appears on the Text tab of an item's Property Pages. If you specify a CODE_GENERATION_NAME value for an item, ACS inserts that name into the code as is.
The mangle.ini file resides in the 'PTC Integrity Modeler\Modeler\System\JavaGen' folder.
For each model object type, you can add prefixes and suffixes. Specify the %parent% keyword to include the name of an item's parent item in a prefix or suffix.
Note that through the mangle.ini file, unnamed Roles are generated with an 'r' prefix, and named Roles are generated without an 'r' prefix. Prefixing and suffixing of named and unnamed Roles is controlled through the [role] and [unnamed role] sections of the mangle.ini file. If you want all Roles to be generated with an 'r' prefix, ensure that the Role sections of the mangle.ini file are as follows:
[role]
AddPrefix=r
AddSuffix=

[unnamed role]
AddPrefix=r
AddSuffix=
The Mangle.ini file specifies a maximum name length is 250 characters and the replacement of the invalid characters. For example:
. is replaced with _
- is replaced with _
<space> is replaced with _
& is deleted
* is deleted
* 
The mangle.ini file refers to a Package as a Category.
When reverse engineering Java code, the Reverser uses the mangle.ini file to match the names of Java Code elements with the mangled names of model items.
The SDL scripts use %Custom "Java Name" to return the unscoped mangled name of an item.