01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: * $Header:$
18: */
19: package org.apache.beehive.netui.compiler.typesystem.impl.declaration;
20:
21: import org.apache.beehive.netui.compiler.typesystem.declaration.Modifier;
22:
23: public class ModifierImpl extends Modifier {
24: protected ModifierImpl(com.sun.mirror.declaration.Modifier delegate) {
25: super ();
26:
27: switch (delegate) {
28: case ABSTRACT:
29: setVal(INT_ABSTRACT);
30: return;
31: case PRIVATE:
32: setVal(INT_PRIVATE);
33: return;
34: case PROTECTED:
35: setVal(INT_PROTECTED);
36: return;
37: case PUBLIC:
38: setVal(INT_PUBLIC);
39: return;
40: case STATIC:
41: setVal(INT_STATIC);
42: return;
43: case TRANSIENT:
44: setVal(INT_TRANSIENT);
45: return;
46: case FINAL:
47: setVal(INT_FINAL);
48: return;
49: case SYNCHRONIZED:
50: setVal(INT_SYNCHRONIZED);
51: return;
52: case NATIVE:
53: setVal(INT_NATIVE);
54: return;
55: }
56:
57: assert false : "no Modifier impl for " + delegate.toString();
58: }
59:
60: public static Modifier get(
61: com.sun.mirror.declaration.Modifier delegate) {
62: return delegate != null ? new ModifierImpl(delegate) : null;
63: }
64: }
|