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