1 19 24 25 package org.netbeans.lib.java.parser; 26 27 31 public abstract class SymbolInfo { 32 33 public static final int PACKAGE=0; 34 public static final int JAVACLASS=1; 35 public static final int FIELD=2; 36 public static final int METHOD=3; 37 public static final int CONSTRUCTOR=4; 38 public static final int PARAMETER=5; 39 public static final int LOCVAR=6; 40 public static final int TYPEPARAMETER=7; 41 42 45 public final int type; 46 47 public SymbolInfo(int t) { 48 type=t; 49 } 50 51 public String toString() { 52 String cls = this.getClass().getName(); 53 int i = cls.lastIndexOf('.'); 54 if (i > -1) 55 cls = cls.substring(i+1); 56 switch (type) { 57 case PACKAGE: return cls + ":PACKAGE"; 58 case JAVACLASS: return cls + ":JAVACLASS"; 59 case FIELD: return cls + ":FIELD"; 60 case METHOD: return cls + ":METHOD"; 61 case CONSTRUCTOR: return cls + ":CONSTRUCTOR"; 62 case PARAMETER: return cls + ":PARAMETER"; 63 case LOCVAR: return cls + ":LOCVAR"; 64 case TYPEPARAMETER: return cls + ":TYPEPARAMETER"; 65 default: 66 return cls + ":<unknown type>"; 67 } 68 } 69 } 70 | Popular Tags |