Importing Java Classes

Last modified on September 8th, 2021.


Class diagram can import java classes and covert them into class diagrams.

Importing a Java Class

Java code can be added to a ‘Class Diagram’ via the ‘Import Java’ button on the toolbar.

  1. Within a ‘Class Diagram’, click the ‘Import Java’ button on the toolbar.'Import Java' Button
  2. There are 2 import options for your Java class: text and file upload.
    To upload text, simply paste your Java class code into the text box.Class Diagram Import via Text
    To upload a file, drag-and-drop your .java file over the drop area, or click within the drop area to browse your computer’s file system to select the file to upload.Class Diagram Import via File
  3. Verify that your Java file contains a package statement and the code uses valid Java 8 syntax. Once you have uploaded your file, click ‘Apply’ to parse the Java file into the ‘Class Diagram’.Imported Java Class
  4. Assets (Java class), Attributes (Java class variables) and Operations (Java methods) are each parsed into the different Innoslate entities on the ‘Class Diagram’. For Attributes and Operations, the modifiers and annotations are added to the entity’s description. The Java type (i.e. int, String, etc.)  is added to the entity’s ‘Units’ attribute. If the class variable was given an initial value in the declaration, that value is added to the entity’s ‘Value’ attribute.
Imported Class with the Class selected
Imported Class with dob attribute selected

The Java importer supports all of the basic Java 8 class structures, including Concrete, Enum, Static, Final, Abstract, and Interface.
The importer also supports nested classes which will be parsed into separate Assets and will draw the decomposition relationship between the 2 Assets if the outer Java class extends or implements the inner class.

Importing Java Classes

Last modified on September 8th, 2021. 


Class diagram can import java classes and covert them into class diagrams.

Importing a Java Class

Java code can be added to a ‘Class Diagram’ via the ‘Import Java’ button on the toolbar.

  1. Within a ‘Class Diagram’, click the ‘Import Java’ button on the toolbar.'Import Java' Button
  2. There are 2 import options for your Java class: text and file upload.
    To upload text, simply paste your Java class code into the text box.Class Diagram Import via Text
    To upload a file, drag-and-drop your .java file over the drop area, or click within the drop area to browse your computer’s file system to select the file to upload.Class Diagram Import via File
  3. Verify that your Java file contains a package statement and the code uses valid Java 8 syntax. Once you have uploaded your file, click ‘Apply’ to parse the Java file into the ‘Class Diagram’.Imported Java Class
  4. Assets (Java class), Attributes (Java class variables) and Operations (Java methods) are each parsed into the different Innoslate entities on the ‘Class Diagram’. For Attributes and Operations, the modifiers and annotations are added to the entity’s description. The Java type (i.e. int, String, etc.)  is added to the entity’s ‘Units’ attribute. If the class variable was given an initial value in the declaration, that value is added to the entity’s ‘Value’ attribute.
Imported Class with the Class selected
Imported Class with dob attribute selected

The Java importer supports all of the basic Java 8 class structures, including Concrete, Enum, Static, Final, Abstract, and Interface.
The importer also supports nested classes which will be parsed into separate Assets and will draw the decomposition relationship between the 2 Assets if the outer Java class extends or implements the inner class.