KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > compiler > typesystem > impl > declaration > ModifierImpl


1 /*
2  * Copyright 2004 The Apache Software Foundation.
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  * $Header:$
17  */

18 package org.apache.beehive.netui.compiler.typesystem.impl.declaration;
19
20 import org.apache.beehive.netui.compiler.typesystem.declaration.Modifier;
21
22 public class ModifierImpl
23         extends Modifier
24 {
25     protected ModifierImpl( com.sun.mirror.declaration.Modifier delegate )
26     {
27         super();
28         
29         switch ( delegate )
30         {
31             case ABSTRACT:
32                 setVal( INT_ABSTRACT );
33                 return;
34             case PRIVATE:
35                 setVal( INT_PRIVATE );
36                 return;
37             case PROTECTED:
38                 setVal( INT_PROTECTED );
39                 return;
40             case PUBLIC:
41                 setVal( INT_PUBLIC );
42                 return;
43             case STATIC:
44                 setVal( INT_STATIC );
45                 return;
46             case TRANSIENT:
47                 setVal( INT_TRANSIENT );
48                 return;
49             case FINAL:
50                 setVal( INT_FINAL );
51                 return;
52             case SYNCHRONIZED:
53                 setVal( INT_SYNCHRONIZED );
54                 return;
55             case NATIVE:
56                 setVal( INT_NATIVE );
57                 return;
58         }
59         
60         assert false : "no Modifier impl for " + delegate.toString();
61     }
62     
63     public static Modifier get( com.sun.mirror.declaration.Modifier delegate )
64     {
65         return delegate != null ? new ModifierImpl( delegate ) : null;
66     }
67 }
68
Popular Tags