01: /*
02: * Create a graphviz graph based on the classes in the specified java
03: * source files.
04: *
05: * (C) Copyright 2002-2005 Diomidis Spinellis
06: *
07: * Permission to use, copy, and distribute this software and its
08: * documentation for any purpose and without fee is hereby granted,
09: * 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: * $Id$
18: *
19: */
20: package org.umlgraph.doclet;
21:
22: import com.sun.javadoc.ProgramElementDoc;
23:
24: /**
25: * Enumerates the possible visibilities in a Java program. For brevity, package
26: * private visibility is referred as PACKAGE.
27: * @author wolf
28: *
29: */
30: public enum Visibility {
31: PRIVATE, PACKAGE, PROTECTED, PUBLIC;
32:
33: public static Visibility get(ProgramElementDoc doc) {
34: if (doc.isPrivate())
35: return PRIVATE;
36: else if (doc.isPackagePrivate())
37: return PACKAGE;
38: else if (doc.isProtected())
39: return PROTECTED;
40: else
41: return PUBLIC;
42:
43: }
44: }
|