KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > google > gwt > dev > jjs > ast > JField


1 /*
2  * Copyright 2007 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  * use this file except in compliance with the License. You may obtain a copy of
6  * 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, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13  * License for the specific language governing permissions and limitations under
14  * the License.
15  */

16 package com.google.gwt.dev.jjs.ast;
17
18 import com.google.gwt.dev.jjs.SourceInfo;
19
20 /**
21  * Java field definition.
22  */

23 public class JField extends JVariable implements CanBeStatic, HasEnclosingType {
24
25   private JReferenceType enclosingType;
26   public JLiteral constInitializer;
27   private final boolean isStatic;
28   private final boolean hasInitializer;
29
30   JField(JProgram program, SourceInfo info, String JavaDoc name,
31       JReferenceType enclosingType, JType type, boolean isStatic, boolean isFinal, boolean hasInitializer) {
32     super(program, info, name, type, isFinal);
33     this.enclosingType = enclosingType;
34     this.isStatic = isStatic;
35     this.hasInitializer = hasInitializer;
36   }
37
38   public JReferenceType getEnclosingType() {
39     return enclosingType;
40   }
41
42   public boolean hasInitializer() {
43     return hasInitializer;
44   }
45
46   public boolean isStatic() {
47     return isStatic;
48   }
49
50   public void traverse(JVisitor visitor, Context ctx) {
51     if (visitor.visit(this, ctx)) {
52     }
53     visitor.endVisit(this, ctx);
54   }
55
56 }
57
Popular Tags