Import Binary Options Print this Topic Previous Page Up One Level Next page

Home >  Projects and Code Engineering > Importing Java, C# and VB.NET Binaries >

Import Binary Options

When you run the menu command Project | Import Binary Types, one of the wizard steps prompts you to specify the binary import options. The options you can set are described below. Note that the dialog box options may be slightly different, depending on whether you are importing .NET or Java binaries.


Import Binary Options dialog box


Automatic type inclusion

.NET or Java binaries may reference various external assemblies or packages. Select the option add all referenced types... if you would like to import all types referenced by the types included in the binary file.


To import referenced types only for specific Java packages or .NET namespaces, enter those packages or namespaces in the adjacent text box. To separate multiple packages or namespaces, use the comma, semi-colon, or space characters.


For example, let's assume that the source .NET .dll file references types from System.Reflection and System.Data namespaces. If you would like to import types from the System.Reflection namespace but not from the System.Data namespace, select the option add all referenced types, optionally restricted to the following packages and enter "System.Reflection" in the text box.


Content restriction

Select the option import only types to skip members such as fields, operations, properties, and so on.


Select the option import only elements with visibility greater than or equal to to import types and type members according to their visibility. The table below lists visibility of types, beginning with types with least visibility. For example, selecting "private" will import all types, whereas selecting "public" will import only public types and type members.


Note:If the check box is not selected, all types will be imported, regardless of their visibility.







package (default visibility when no explicit modifier exists)






The option suppress attribute sections is applicable for .NET binaries. By default, UModel imports the C# or VB.NET attributes detected in the binary. Select the suppress attribute sections option if you don't want to import attributes. Otherwise, members that were decorated with attributes in the original source code will have the <<attributes>> stereotype applied to them after you import the binary into the model. If attributes are imported, you can display them on the diagram as tagged values, by right-clicking the class on the diagram and selecting Tagged Values | All from the context menu. For more information, see Stereotypes and Tagged Values.


The option suppress annotation modifiers is applicable for Java binaries. By default, UModel imports Java annotations detected in the binary, provided that their retention policy was defined as RUNTIME (not CLASS or SOURCE). If you don't want to import annotations, select the suppress annotation modifiers option. If annotations are imported, members that had annotations in the original source have the <<annotations>> stereotype, and annotations appear as tagged values, as illustrated below.



Attribute section styles

These options are applicable to .NET binaries only. As previously mentioned, if types or type members in the original source code were decorated with attributes, these are imported as tagged values in UModel.


The option create only one attribute per attribute section is best illustrated by an example. Let's assume that the original C# source code defined a method with two attributes:


using System;

using System.Diagnostics;


namespace MyNamespace


  class Program


       [Conditional("VERBOSE"), Conditional("TERSE")]

      static void reportHeader()


           Console.WriteLine("This is the header");



      static void Main(string[] args)







If the option create only one attribute per attribute section is enabled upon importing from the binary file, then each attribute would appear on a separate line inside the "Tagged Values" element :


Otherwise, attributes would appear as comma-separated:


Finally, the option suppress 'Attribute' suffix on attribute type names removes the 'Attribute' suffix of an attribute type. For example, if this option is selected, an attribute type defined in the original code as System.Xml.Serialization.XmlTypeAttribute would be imported as System.Xml.Serialization.XmlType.

© 2019 Altova GmbH