plantuml icon indicating copy to clipboard operation
plantuml copied to clipboard

Better support for inner classes

Open arnaudroques opened this issue 7 years ago • 2 comments

It would be nice if the plugin could display inner classes/interfaces of a class interface.

For example, for the following code:

public interface Car {
    public interface Door {
        // Car.Door methods...
    }
    // Car methods ...
}

The plugin could draw the following diagram:

@startuml
interface Car {
    // Car methods ...
}
interface Car.Door {
    // Car.Door methods...
}
Car +-- Car.Door
@enduml

http://www.plantuml.com/plantuml/png/oymhIIrAIqnELN1EB5Aevb800drzC2StjIGZFwLOGKzFZwkMAnDPePvBVZv8DIT4AOGBLGzH3Z90MrSNBWi0 The same syntax is working for nested class. There is an open question on distinction between static and inner class... This request is related to http://plantuml.sourceforge.net/qa/?qa=5537/how-can-nested-classes-interfaces-be-represented

arnaudroques avatar Mar 02 '17 21:03 arnaudroques

These examples don't work on the newest PlantUML (version 2023) image

Huang-Libo avatar Jun 04 '23 06:06 Huang-Libo

Looks like its the . symbol breaking things. Not sure how to represent inner classes anymore.

Perhaps change the . into a _ if you are desperate?

@startuml
interface Car {
    // Car methods ...
}
interface Car_Door {
    // Car.Door methods...
}
Car +-- Car_Door
@enduml

image

abulka avatar Aug 03 '23 08:08 abulka