com.puppycrawl.tools.checkstyle.api

Class LocalizedMessage

public final class LocalizedMessage extends Object implements Comparable

Represents a message that can be localised. The translations come from message.properties files. The underlying implementation uses java.text.MessageFormat.

Version: 1.0

Author: Oliver Burn lkuehne

Constructor Summary
LocalizedMessage(int aLineNo, int aColNo, String aBundle, String aKey, Object[] aArgs, SeverityLevel aSeverityLevel, Class aSourceClass)
Creates a new LocalizedMessage instance.
LocalizedMessage(int aLineNo, int aColNo, String aBundle, String aKey, Object[] aArgs, Class aSourceClass)
Creates a new LocalizedMessage instance.
LocalizedMessage(int aLineNo, String aBundle, String aKey, Object[] aArgs, SeverityLevel aSeverityLevel, Class aSourceClass)
Creates a new LocalizedMessage instance.
LocalizedMessage(int aLineNo, String aBundle, String aKey, Object[] aArgs, Class aSourceClass)
Creates a new LocalizedMessage instance.
Method Summary
intcompareTo(Object aOther)
{@inheritDoc}
booleanequals(Object aObject)
{@inheritDoc}
intgetColumnNo()
StringgetKey()
Returns the message key to locate the translation, can also be used in IDE plugins to map error messages to corrective actions.
intgetLineNo()
StringgetMessage()
SeverityLevelgetSeverityLevel()
StringgetSourceName()
inthashCode()
{@inheritDoc}
static voidsetLocale(Locale aLocale)

Constructor Detail

LocalizedMessage

public LocalizedMessage(int aLineNo, int aColNo, String aBundle, String aKey, Object[] aArgs, SeverityLevel aSeverityLevel, Class aSourceClass)
Creates a new LocalizedMessage instance.

Parameters: aLineNo line number associated with the message aColNo column number associated with the message aBundle resource bundle name aKey the key to locate the translation aArgs arguments for the translation aSeverityLevel severity level for the message aSourceClass the Class that is the source of the message

LocalizedMessage

public LocalizedMessage(int aLineNo, int aColNo, String aBundle, String aKey, Object[] aArgs, Class aSourceClass)
Creates a new LocalizedMessage instance.

Parameters: aLineNo line number associated with the message aColNo column number associated with the message aBundle resource bundle name aKey the key to locate the translation aArgs arguments for the translation aSourceClass the Class that is the source of the message

LocalizedMessage

public LocalizedMessage(int aLineNo, String aBundle, String aKey, Object[] aArgs, SeverityLevel aSeverityLevel, Class aSourceClass)
Creates a new LocalizedMessage instance.

Parameters: aLineNo line number associated with the message aBundle resource bundle name aKey the key to locate the translation aArgs arguments for the translation aSeverityLevel severity level for the message aSourceClass the source class for the message

LocalizedMessage

public LocalizedMessage(int aLineNo, String aBundle, String aKey, Object[] aArgs, Class aSourceClass)
Creates a new LocalizedMessage instance. The column number defaults to 0.

Parameters: aLineNo line number associated with the message aBundle name of a resource bundle that contains error messages aKey the key to locate the translation aArgs arguments for the translation aSourceClass the name of the source for the message

Method Detail

compareTo

public int compareTo(Object aOther)
{@inheritDoc}

equals

public boolean equals(Object aObject)
{@inheritDoc}

getColumnNo

public int getColumnNo()

Returns: the column number *

getKey

public String getKey()
Returns the message key to locate the translation, can also be used in IDE plugins to map error messages to corrective actions.

Returns: the message key

getLineNo

public int getLineNo()

Returns: the line number *

getMessage

public String getMessage()

Returns: the translated message *

getSeverityLevel

public SeverityLevel getSeverityLevel()

Returns: the severity level *

getSourceName

public String getSourceName()

Returns: the name of the source for this LocalizedMessage

hashCode

public int hashCode()
{@inheritDoc}

setLocale

public static void setLocale(Locale aLocale)

Parameters: aLocale the locale to use for localization *