Skip to content

Added: Custom Constructor#33

Open
JasonHertzog wants to merge 4 commits intostaruml:masterfrom
JasonHertzog:custom-constructor
Open

Added: Custom Constructor#33
JasonHertzog wants to merge 4 commits intostaruml:masterfrom
JasonHertzog:custom-constructor

Conversation

@JasonHertzog
Copy link

When a UML class has the same name as a UML operation it owns.

Example output:
` /**
* Default constructor
*/
public Person() {
}

/**
 * 
 */
private String name;

/**
 * @param name
 */
public Person(String name) {
	// TODO implement here
}`

Areas of future improvement: If it's a constructor, it could be good to also have documentation reflect that since right now it will only show the params in the docs.

Added support for custom constructors by checking if there are any operations with the same name as the class.
Adding support for custom constructors
WIP: modifying how I format the params when there is a custom class.
@wanddynosios
Copy link

Great stuff, @JasonHertzog!

I see one edge case though: When trying to make the default constructor private by adding a -MyObject()-operation, two constructors are created:

    /**
     * 
     */
    private MyObject() {
        // TODO implement here
    }
    /**
     * Default constructor
     */
    public MyObject() {
    }

Maybe this could be addressed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants