Hiding based on visibilty

0 votes
asked Jan 5, 2015 in Wanted features by rmric (2,140 points)

Is there a way to hide the class methods and attributes (in a class diagram) by their visibility?

For example:

  • hide private  would hide all the private members.
  • hide protected  would hide all the protected and private members.
  • hide package private  would hide all the package private, protected and private members, leaving only public members.
  • hide public  would be the same as hide members.

This would come very handy with a single PlantUML file that could show either inner details or only the public interface.

Best Regards

commented Jan 5, 2015 by rmric (2,140 points)
BTW, there's a typo in an error message of CommandHideShowSpecificClass.java:72 "Class does not exit : " should be "exist".

1 Answer

0 votes
answered Jan 5, 2015 by plantuml (295,000 points)
selected Jan 6, 2015 by rmric
 
Best answer

Hi,

Thanks for the typo, and thanks for the suggestion.

There is yet another undocumented feature, but you can have:


hide/show private/protected/package/public member/attribute/field/method (see CommandHideShow3.java)

Example:

@startuml
hide private members
hide protected members
hide package members
class Foo {
  - private
  # protected
  ~ package
}
@enduml


It's not exactly what you were suggesting, but I guess that this is what you are looking for.

Regards,

 

commented Jan 6, 2015 by rmric (2,140 points)
It does foot the bill, thank you very much!

Could it be possible to have this feature documented in the Reference Guide?
At least a line like the following in subsection "Hide attributes, methods" :

    \item \texttt{private members} or \texttt{protected members}
    or \texttt{package members} which will hide fields, even if
    they are described,

BTW, is there any chance to have the source files of the doc available through a VCS (svn,..) ? It would make it easier to contribute :-)

Regards,
...