Messages

public interface Messages

Messages is a common interface of a collection of messages.

Author:Hugo Y. K. Lam

Methods

getDefaultLocale

public String getDefaultLocale()

Gets the default locale of this messenger.

Returns:the default locale.

getDefaultMessage

public String getDefaultMessage()

Gets the default message of this messenger.

Returns:the default message.

getErrorMessage

public String getErrorMessage(String name)

Gets an error message.

Parameters:
  • name – the name of the message.
Returns:

the message with the specified name.

getErrorMessage

public String getErrorMessage(String name, String def)

Gets an error message.

Parameters:
  • name – the name of the message.
  • def – a default message.
Returns:

the message with the specified name.

getMessage

public String getMessage(String name)

Gets a general message.

Parameters:
  • name – the name of the message.
Returns:

the message with the specified name.

getMessage

public String getMessage(String name, String def)

Gets a general message.

Parameters:
  • name – the name of the message.
  • def – a default message.
Returns:

the message with the specified name.

getMessage

public String getMessage(String name, String def, String type)

Gets a message of the specified type.

Parameters:
  • name – the name of the message.
  • def – a default message.
  • type – the type of the message.
Returns:

the message with the specified name.

getMessage

public String getMessage(String name, String def, String type, String locale)

Gets a message of the specified type and locale.

Parameters:
  • name – the name of the message.
  • def – a default message.
  • type – the type of the message.
  • locale – the locale of the message.
Returns:

the message with the specified name.

getWarningMessage

public String getWarningMessage(String name)

Gets a warning message.

Parameters:
  • name – the name of the message.
Returns:

the message with the specified name.

getWarningMessage

public String getWarningMessage(String name, String def)

Gets a warning message.

Parameters:
  • name – the name of the message.
  • def – a default message.
Returns:

the message with the specified name.

setDefaultLocale

public void setDefaultLocale(String locale)

Sets the default locale of this messenger.

Parameters:
  • locale – the default locale

setDefaultMessage

public void setDefaultMessage(String string)

Sets the default message of this messenger.

Parameters:
  • string – the default message.