KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > mirror > declaration > Modifier


1 /*
2  * @(#)Modifier.java 1.1 04/01/26
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.mirror.declaration;
9
10
11 /**
12  * Represents a modifier on the declaration of a program element such
13  * as a class, method, or field.
14  *
15  * <p> Not all modifiers are applicable to all kinds of declarations.
16  * When two or more modifiers appear in the source code of a declaration,
17  * then it is customary, though not required, that they appear in the same
18  * order as the constants listed in the detail section below.
19  *
20  * @author Joseph D. Darcy
21  * @author Scott Seligman
22  * @version 1.1 04/01/25
23  * @since 1.5
24  */

25
26 public enum Modifier {
27
28     // See JLS2 sections 8.1.1, 8.3.1, 8.4.3, 8.8.3, and 9.1.1.
29
// java.lang.reflect.Modifier includes INTERFACE, but that's a VMism.
30

31     /** The modifier <tt>public</tt> */ PUBLIC,
32     /** The modifier <tt>protected</tt> */ PROTECTED,
33     /** The modifier <tt>private</tt> */ PRIVATE,
34     /** The modifier <tt>abstract</tt> */ ABSTRACT,
35     /** The modifier <tt>static</tt> */ STATIC,
36     /** The modifier <tt>final</tt> */ FINAL,
37     /** The modifier <tt>transient</tt> */ TRANSIENT,
38     /** The modifier <tt>volatile</tt> */ VOLATILE,
39     /** The modifier <tt>synchronized</tt> */ SYNCHRONIZED,
40     /** The modifier <tt>native</tt> */ NATIVE,
41     /** The modifier <tt>strictfp</tt> */ STRICTFP;
42
43
44     private String JavaDoc lowercase = null; // modifier name in lowercase
45

46     /**
47      * Returns this modifier's name in lowercase.
48      */

49     public String JavaDoc toString() {
50     if (lowercase == null) {
51        lowercase = name().toLowerCase(java.util.Locale.US);
52     }
53     return lowercase;
54     }
55 }
56
Popular Tags