hallvard / plantuml

Embed UML diagrams in files and view them in Eclipse
http://plantuml.sourceforge.net/
209 stars 57 forks source link

Better support for inner classes #17

Open arnaudroques opened 7 years ago

arnaudroques commented 7 years ago

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

Huang-Libo commented 1 year ago

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

image
abulka commented 1 year ago

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