langtools/src/share/classes/com/sun/tools/javac/parser/Token.java
changeset 1471 57506cdfb7b4
parent 1264 076a3cde30d5
child 5520 86e4b9a9da40
equal deleted inserted replaced
1470:6ff8524783fa 1471:57506cdfb7b4
    23  * have any questions.
    23  * have any questions.
    24  */
    24  */
    25 
    25 
    26 package com.sun.tools.javac.parser;
    26 package com.sun.tools.javac.parser;
    27 
    27 
    28 import java.util.ResourceBundle;
    28 import java.util.Locale;
    29 
    29 
    30 import com.sun.tools.javac.api.Formattable;
    30 import com.sun.tools.javac.api.Formattable;
       
    31 import com.sun.tools.javac.api.Messages;
    31 
    32 
    32 /** An interface that defines codes for Java source tokens
    33 /** An interface that defines codes for Java source tokens
    33  *  returned from lexical analysis.
    34  *  returned from lexical analysis.
    34  *
    35  *
    35  *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
    36  *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
   189 
   190 
   190     public String getKind() {
   191     public String getKind() {
   191         return "Token";
   192         return "Token";
   192     }
   193     }
   193 
   194 
   194     public String toString(ResourceBundle bundle) {
   195     public String toString(Locale locale, Messages messages) {
   195         String s = toString();
   196         return name != null ? toString() : messages.getLocalizedString(locale, "compiler.misc." + toString());
   196         return s.startsWith("token.") ? bundle.getString("compiler.misc." + s) : s;
       
   197     }
   197     }
   198 }
   198 }