-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy pathVisibility.java
More file actions
48 lines (42 loc) · 1.29 KB
/
Visibility.java
File metadata and controls
48 lines (42 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* Create a graphviz graph based on the classes in the specified java
* source files.
*
* (C) Copyright 2002-2005 Diomidis Spinellis
*
* Permission to use, copy, and distribute this software and its
* documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notice appear in all copies and that
* both that copyright notice and this permission notice appear in
* supporting documentation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
*
*/
package org.umlgraph.doclet;
import com.sun.javadoc.ProgramElementDoc;
/**
* Enumerates the possible visibilities in a Java program. For brevity, package
* private visibility is referred as PACKAGE.
* @author wolf
*/
public enum Visibility {
PRIVATE("- "), PACKAGE("~ "), PROTECTED("# "), PUBLIC("+ ");
final public String symbol;
private Visibility(String symbol) {
this.symbol = symbol;
}
public static Visibility get(ProgramElementDoc doc) {
if (doc.isPrivate())
return PRIVATE;
else if (doc.isPackagePrivate())
return PACKAGE;
else if (doc.isProtected())
return PROTECTED;
else
return PUBLIC;
}
}