< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/code/Kinds.java

Print this page




 260     public static KindName kindName(MemberReferenceTree.ReferenceMode mode) {
 261         switch (mode) {
 262             case INVOKE: return KindName.METHOD;
 263             case NEW: return KindName.CONSTRUCTOR;
 264             default : throw new AssertionError("Unexpected mode: "+ mode);
 265         }
 266     }
 267 
 268     /** A KindName representing a given symbol
 269      */
 270     public static KindName kindName(Symbol sym) {
 271         switch (sym.getKind()) {
 272         case PACKAGE:
 273             return KindName.PACKAGE;
 274 
 275         case ENUM:
 276             return KindName.ENUM;
 277 
 278         case ANNOTATION_TYPE:
 279         case CLASS:

 280             return KindName.CLASS;
 281 
 282         case INTERFACE:
 283             return KindName.INTERFACE;
 284 
 285         case TYPE_PARAMETER:
 286             return KindName.TYPEVAR;
 287 
 288         case ENUM_CONSTANT:
 289         case FIELD:
 290         case PARAMETER:
 291         case LOCAL_VARIABLE:
 292         case EXCEPTION_PARAMETER:
 293         case RESOURCE_VARIABLE:
 294             return KindName.VAR;
 295 
 296         case CONSTRUCTOR:
 297             return KindName.CONSTRUCTOR;
 298 
 299         case METHOD:




 260     public static KindName kindName(MemberReferenceTree.ReferenceMode mode) {
 261         switch (mode) {
 262             case INVOKE: return KindName.METHOD;
 263             case NEW: return KindName.CONSTRUCTOR;
 264             default : throw new AssertionError("Unexpected mode: "+ mode);
 265         }
 266     }
 267 
 268     /** A KindName representing a given symbol
 269      */
 270     public static KindName kindName(Symbol sym) {
 271         switch (sym.getKind()) {
 272         case PACKAGE:
 273             return KindName.PACKAGE;
 274 
 275         case ENUM:
 276             return KindName.ENUM;
 277 
 278         case ANNOTATION_TYPE:
 279         case CLASS:
 280         case RECORD:
 281             return KindName.CLASS;
 282 
 283         case INTERFACE:
 284             return KindName.INTERFACE;
 285 
 286         case TYPE_PARAMETER:
 287             return KindName.TYPEVAR;
 288 
 289         case ENUM_CONSTANT:
 290         case FIELD:
 291         case PARAMETER:
 292         case LOCAL_VARIABLE:
 293         case EXCEPTION_PARAMETER:
 294         case RESOURCE_VARIABLE:
 295             return KindName.VAR;
 296 
 297         case CONSTRUCTOR:
 298             return KindName.CONSTRUCTOR;
 299 
 300         case METHOD:


< prev index next >