APIdia Launch Partner
Top Description Inners Methods
com.sun.tools.javac.api

public Interface Formattable

Known Direct Implementers
com.sun.tools.javac.api.Formattable.LocalizedString, com.sun.tools.javac.code.Kinds.KindName, com.sun.tools.javac.parser.Tokens.TokenKind
Imports
java.util.Locale

This interface must be implemented by any javac class that has non-trivial formatting needs (e.g. where toString() does not apply because of localization).

This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.

Author
Maurizio Cimadamore

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

a string representing the object's kind
getKind
()

Retrieve a pretty name of this object's kind

public String

Returns:

a locale-dependent string representing the object
toString
(Locale
locale in which the object's representation is to be rendered
locale
,
Messages
messages object used for localization
messages
)

Used to obtain a localized String representing the object accordingly to a given locale

Method Detail

getKindback to summary
public String getKind()

Retrieve a pretty name of this object's kind

Returns:String

a string representing the object's kind

toStringback to summary
public String toString(Locale locale, Messages messages)

Used to obtain a localized String representing the object accordingly to a given locale

Parameters
locale:Locale

locale in which the object's representation is to be rendered

messages:Messages

messages object used for localization

Returns:String

a locale-dependent string representing the object

com.sun.tools.javac.api back to summary

public Class Formattable.LocalizedString

extends Object
implements Formattable
Class Inheritance
All Implemented Interfaces
com.sun.tools.javac.api.Formattable

Field Summary

Modifier and TypeField and Description
pack-priv String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
getKind()

Implements com.sun.tools.javac.api.Formattable.getKind.

Retrieve a pretty name of this object's kind

public String
toString(Locale l, Messages messages)

Implements com.sun.tools.javac.api.Formattable.toString.

Used to obtain a localized String representing the object accordingly to a given locale

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

keyback to summary
pack-priv String key

Constructor Detail

LocalizedStringback to summary
public LocalizedString(String key)

Method Detail

getKindback to summary
public String getKind()

Implements com.sun.tools.javac.api.Formattable.getKind.

Doc from com.sun.tools.javac.api.Formattable.getKind.

Retrieve a pretty name of this object's kind

toStringback to summary
public String toString(Locale l, Messages messages)

Implements com.sun.tools.javac.api.Formattable.toString.

Doc from com.sun.tools.javac.api.Formattable.toString.

Used to obtain a localized String representing the object accordingly to a given locale

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.