See also


Languages such as Java support package structures or namespaces.

Enterprise Architect lets you specify a package as a namespace root, which denotes where the namespace structure starts; all subordinate packages below this point are generated as namespaces to code.

To define a package as a namespace root, right-click on the package in the Project Browser and select the Code Engineering | Set as Namespace Root context menu option; the package icon in the Project Browser changes to include a colored corner (NamespaceRootIcon).

When you have set the namespace root, the menu option changes to Clear Namespace Root; click on this option to take the namespace root status off the package (also, see the context menu described below).

Once you have set a namespace root, Java code generated beneath this root automatically adds a package declaration at the head of the generated file indicating the current package location.

To view a list of namespaces, select the Settings | Namespace Roots menu option; the Namespaces dialog displays.

If you double-click on a namespace in the list, the package is highlighted in the Project Browser; alternatively, right-click on the namespace to display a context menu, and select the Locate Package in Browser menu option.

You can also clear the selected namespace, by selecting the Clear Namespace Attribute option.




When performing code generation, any package name that contains whitespace characters is automatically treated as a namespace root

Learning Center topics

(Alt + F1) | Software Engineering | Generate Code | Namespaces