Giter Club home page Giter Club logo

javauml_parser's Introduction

Java to UML Diagram Parser

Introduction

This repository is personal project for CMPE202 at San Jose State Univeristy lecturered by Paul Nguyen. Two kinds of parser are built in this project. Both parsers take Java Source Code as input and generate following diagrams:

  • UML Class Diagrams
  • UML Sequence Diagrams

Requirements

This part of document was copied from lecturer's project description.

Things to include:

  • Default Package: All Java source files will be in the "default" package. That is, there will be only one directory (i.e. no subdirectories)
  • Dependencies & Uses Relationships for Interfaces Only: Do not include dependencies in output UML diagram except in the cases of "interfaces/uses"
  • Class Declarations with optional Extends and Implements: Make sure to include proper notation for inheritance and interface implementations.
  • Only Include Public Methods (ignore private, package and protected scope)
  • Only Include Private and Public Attributes (ignore package and protected scope)
  • Java Setters and Getters: Must Support also Java Style Public Attributes as "setters and getters"
  • Must Include Types for Attributes, Parameters and Return types on Methods
  • Classifier vs Attributes Compartment: If there is a Java source file, then there should be a "UML Class" on the Diagram for it. That is, if there is no Java source file for a class and the class is part of an instance variable, put the class/property in the attribute compartment
  • Interfaces - Implements and Uses Notation: Show Interfaces along with Clients of Interfaces (as dependencies).

Things to exclude:

  • Static and Abstract Notation: Static and Abstract notation in UML are usually denoted as "underline" and "italic", but rarely used in practice. Parsing this is not a requirement for this project.
  • Relationships Between Interfaces: Although conceptually possible in UML, relationships between Interfaces (i.e. inheritance, dependencies) are rarely thought of in practice and generally bad practice. As such, this project does not expect parser to detect these situations. Focus your work on the relationships and dependencies from Classes to Interfaces.

Tool Used:

  • JavaParser: Transforming Java Source Code into Abstract Syntax Tree

  • UML Generator: Take string as input and generates UML diagrams in png format

Test Cases and Results

There are five test cases for UML Class Diagrams and one for UML Sequence Diagrams. If you are interested in looking at details of them, you can go to resources folder. You can also briefly look at what diagrams are created:

UML Class Diagram

Test case 1:

alt text

Test case 2:

alt text

Test case 3:

alt text

Test case 4:

alt text

Test case 5:

alt text

UML Sequence Diagram

alt text

javauml_parser's People

Watchers

 avatar

Forkers

sonthai

javauml_parser's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.