• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2016 Google Inc. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.google.turbine.tree;
18 
19 import static java.util.Locale.ENGLISH;
20 
21 import com.google.turbine.model.TurbineFlag;
22 
23 /**
24  * Modifiers.
25  *
26  * <p>See JLS 8.1.1, 8.3.1, 8.4.3, 8.8.3, and 9.1.1.
27  */
28 public enum TurbineModifier {
29   PRIVATE(TurbineFlag.ACC_PRIVATE),
30   PROTECTED(TurbineFlag.ACC_PROTECTED),
31   PUBLIC(TurbineFlag.ACC_PUBLIC),
32   ACC_SUPER(TurbineFlag.ACC_SUPER),
33   ABSTRACT(TurbineFlag.ACC_ABSTRACT),
34   STATIC(TurbineFlag.ACC_STATIC),
35   FINAL(TurbineFlag.ACC_FINAL),
36   VOLATILE(TurbineFlag.ACC_VOLATILE),
37   SYNCHRONIZED(TurbineFlag.ACC_SYNCHRONIZED),
38   STRICTFP(TurbineFlag.ACC_STRICT),
39   NATIVE(TurbineFlag.ACC_NATIVE),
40   VARARGS(TurbineFlag.ACC_VARARGS),
41   TRANSIENT(TurbineFlag.ACC_TRANSIENT),
42   INTERFACE(TurbineFlag.ACC_INTERFACE),
43   ACC_ENUM(TurbineFlag.ACC_ENUM),
44   ACC_ANNOTATION(TurbineFlag.ACC_ANNOTATION),
45   ACC_SYNTHETIC(TurbineFlag.ACC_SYNTHETIC),
46   ACC_BRIDGE(TurbineFlag.ACC_BRIDGE),
47   DEFAULT(TurbineFlag.ACC_DEFAULT),
48   TRANSITIVE(TurbineFlag.ACC_TRANSITIVE),
49   SEALED(TurbineFlag.ACC_SEALED),
50   NON_SEALED(TurbineFlag.ACC_NON_SEALED),
51   COMPACT_CTOR(TurbineFlag.ACC_COMPACT_CTOR);
52 
53   private final int flag;
54 
TurbineModifier(int flag)55   TurbineModifier(int flag) {
56     this.flag = flag;
57   }
58 
flag()59   public int flag() {
60     return flag;
61   }
62 
63   @Override
toString()64   public String toString() {
65     return name().replace('_', '-').toLowerCase(ENGLISH);
66   }
67 }
68