## com.puppycrawl.tools.checkstyle.api
Class LocalizedMessage

    java.lang.Object
      com.puppycrawl.tools.checkstyle.api.LocalizedMessage

All Implemented Interfaces:
  java.lang.Comparable

public final class LocalizedMessage
extends java.lang.Object
implements java.lang.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, java.lang.String aBundle, java.lang.String aKey, java.lang.Object[] aArgs, java.lang.Class aSourceClass)` Creates a new `LocalizedMessage` instance.
`LocalizedMessage(int aLineNo, int aColNo, java.lang.String aBundle, java.lang.String aKey, java.lang.Object[] aArgs, SeverityLevel aSeverityLevel, java.lang.Class aSourceClass)` Creates a new `LocalizedMessage` instance.
`LocalizedMessage(int aLineNo, java.lang.String aBundle, java.lang.String aKey, java.lang.Object[] aArgs, java.lang.Class aSourceClass)` Creates a new `LocalizedMessage` instance.
`LocalizedMessage(int aLineNo, java.lang.String aBundle, java.lang.String aKey, java.lang.Object[] aArgs, SeverityLevel aSeverityLevel, java.lang.Class aSourceClass)` Creates a new `LocalizedMessage` instance.

Method Summary
`int` `compareTo(java.lang.Object aOther)`
`boolean` `equals(java.lang.Object aObject)`
`int` `getColumnNo()`
`java.lang.String` `getKey()` Returns the message key to locate the translation, can also be used in IDE plugins to map error messages to corrective actions.
`int` `getLineNo()`
`java.lang.String` `getMessage()`
`SeverityLevel` `getSeverityLevel()`
`java.lang.String` `getSourceName()`
`int` `hashCode()`
`static void` `setLocale(java.util.Locale aLocale)`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### LocalizedMessage

    public LocalizedMessage(int aLineNo,
                            int aColNo,
                            java.lang.String aBundle,
                            java.lang.String aKey,
                            java.lang.Object[] aArgs,
                            SeverityLevel aSeverityLevel,
                            java.lang.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,
                            java.lang.String aBundle,
                            java.lang.String aKey,
                            java.lang.Object[] aArgs,
                            java.lang.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,
                            java.lang.String aBundle,
                            java.lang.String aKey,
                            java.lang.Object[] aArgs,
                            SeverityLevel aSeverityLevel,
                            java.lang.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,
                            java.lang.String aBundle,
                            java.lang.String aKey,
                            java.lang.Object[] aArgs,
                            java.lang.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

### equals

    public boolean equals(java.lang.Object aObject)

  See Also:
    `Object.equals(java.lang.Object)`

### hashCode

    public int hashCode()

  See Also:
    `Object.hashCode()`

### getMessage

    public java.lang.String getMessage()

  Returns:
    the translated message

### getLineNo

    public int getLineNo()

  Returns:
    the line number

### getColumnNo

    public int getColumnNo()

  Returns:
    the column number

### getSeverityLevel

    public SeverityLevel getSeverityLevel()

  Returns:
    the severity level

### getKey

    public java.lang.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

### getSourceName

    public java.lang.String getSourceName()

  Returns:
    the name of the source for this LocalizedMessage

### setLocale

    public static void setLocale(java.util.Locale aLocale)

  Parameters:
    `aLocale` - the locale to use for localization

### compareTo

    public int compareTo(java.lang.Object aOther)

  Specified by:
    `compareTo` in interface `java.lang.Comparable`
  See Also:
    `Comparable`

Back to the Checkstyle Home Page