1 11 package org.eclipse.jdt.internal.compiler.lookup; 12 13 import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; 14 import org.eclipse.jdt.internal.compiler.impl.Constant; 15 16 public abstract class VariableBinding extends Binding { 17 18 public int modifiers; 19 public TypeBinding type; 20 public char[] name; 21 protected Constant constant; 22 public int id; public long tagBits; 24 25 public VariableBinding(char[] name, TypeBinding type, int modifiers, Constant constant) { 26 this.name = name; 27 this.type = type; 28 this.modifiers = modifiers; 29 this.constant = constant; 30 } 31 32 public Constant constant() { 33 return this.constant; 34 } 35 36 public abstract AnnotationBinding[] getAnnotations(); 37 38 public final boolean isBlankFinal(){ 39 return (modifiers & ExtraCompilerModifiers.AccBlankFinal) != 0; 40 } 41 43 44 public final boolean isFinal() { 45 return (modifiers & ClassFileConstants.AccFinal) != 0; 46 } 47 public char[] readableName() { 48 return name; 49 } 50 public void setConstant(Constant constant) { 51 this.constant = constant; 52 } 53 public String toString() { 54 String s = (type != null) ? type.debugName() : "UNDEFINED TYPE"; s += " "; s += (name != null) ? new String (name) : "UNNAMED FIELD"; return s; 58 } 59 } 60 | Popular Tags |