org.jboss.logging.processor.model

## Interface MessageMethod

All Superinterfaces:
  Comparable<MessageMethod>, JavaDocComment, MessageObject

    public interface MessageMethod
    extends Comparable<MessageMethod>, MessageObject, JavaDocComment

Date: 29.07.2011

Author:
  James R. Perkins

### Nested Class Summary

Nested Classes
`static interface` `MessageMethod.Message` Represents a `Message` annotation on a method.

### Method Summary

Methods
`Parameter` `cause()` Returns the cause element if `hasCause()` returns `true`, otherwise `null`.
`int` `formatParameterCount()` Returns the number of parameters minus the cause parameter count for the method.
`boolean` `hasCause()` Returns `true` if there is a cause element, otherwise `false`.
`boolean` `inheritsMessage()` Indicates whether the message was inherited from another message or not.
`boolean` `isLoggerMethod()` Returns `true` if this is a logger method, otherwise `false`.
`boolean` `isOverloaded()` Returns `true` if the method is overloaded, otherwise `false` .
`String` `loggerMethod()` Returns the LogMessage annotation associated with this method only if `isLoggerMethod()` returns `true`.
`String` `logLevel()` Returns the log level parameter associated with the method only if `isLoggerMethod()` returns `true`.
`MessageMethod.Message` `message()` The `MessageMethod.Message` to be used for the method.
`String` `messageMethodName()` Returns the name of the method used to retrieve the message.
`String` `name()` Returns the method name.
`Set<Parameter>` `parameters(Parameter.ParameterType parameterType)` Returns an unmodifiable collection of the parameters specified by the parameter type or an empty set.
`Set<Parameter>` `parameters(Parameter.ParameterType parameterType, Parameter.ParameterType... parameterTypes)` Returns an unmodifiable collection of the parameters specified by the parameter type or an empty set.
`ExecutableElement` `reference()` The object used to extract information for the message logger or message bundle, if applicable.
`ReturnType` `returnType()` Returns the return type for the method.
`Set<ThrowableType>` `thrownTypes()` Returns a collection of throwable types the method throws.
`String` `translationKey()` Returns the name of the key used in the translation files for the message translation.

### Methods inherited from interface java.lang.Comparable

`compareTo`

### Methods inherited from interface org.jboss.logging.processor.model.JavaDocComment

`getComment`

### Method Detail

#### name

    String name()

Returns the method name.

Specified by:
  `name` in interface `MessageObject`
Returns:
  the method name.

#### parameters

    Set<Parameter> parameters(Parameter.ParameterType parameterType)

Returns an unmodifiable collection of the parameters specified by the parameter type or an empty set.

Parameters:
  `parameterType` - the parameter type to look-up the parameters for.
Returns:
  a collection of the parameters or an empty set.

#### parameters

    Set<Parameter> parameters(Parameter.ParameterType parameterType,
                            Parameter.ParameterType... parameterTypes)

Returns an unmodifiable collection of the parameters specified by the parameter type or an empty set.

Parameters:
  `parameterType` - the parameter type to look-up the parameters for.
  `parameterTypes` - an array of types to look-up parameters for.
Returns:
  a collection of the parameters or an empty set.

#### returnType

    ReturnType returnType()

Returns the return type for the method.

Returns:
  the return type for the method.

#### thrownTypes

    Set<ThrowableType> thrownTypes()

Returns a collection of throwable types the method throws. If the method throws no exceptions an empty collection is returned.

Returns:
  a collection of throwable types or an empty collection.

#### message

    MessageMethod.Message message()

The `MessageMethod.Message` to be used for the method.

Returns:
  the message.

#### inheritsMessage

    boolean inheritsMessage()

Indicates whether the message was inherited from another message or not. If `true` is returned the `MessageMethod.Message` was inherited from a different method, otherwise `false`.

Note: `false` does not indicate the method has a `Message` annotation.

Returns:
  `true` if the message was inherited from a different method, otherwise `false`.

#### messageMethodName

    String messageMethodName()

Returns the name of the method used to retrieve the message.

Returns:
  the name of the message method.

#### translationKey

    String translationKey()

Returns the name of the key used in the translation files for the message translation.

Returns:
  the name of the key in the translation files.

#### hasCause

    boolean hasCause()

Returns `true` if there is a cause element, otherwise `false`.

Returns:
  `true` if there is a cause element, otherwise `false`

#### isOverloaded

    boolean isOverloaded()

Returns `true` if the method is overloaded, otherwise `false` .

Returns:
  `true` if the method is overloaded, otherwise `false`

#### cause

    Parameter cause()

Returns the cause element if `hasCause()` returns `true`, otherwise `null`.

Returns:
  the cause element, otherwise `null`.

#### loggerMethod

    String loggerMethod()

Returns the LogMessage annotation associated with this method only if `isLoggerMethod()` returns `true`.

Returns:
  the log message annotation

#### logLevel

    String logLevel()

Returns the log level parameter associated with the method only if `isLoggerMethod()` returns `true`.

Returns:
  the log level annotation

#### formatParameterCount

    int formatParameterCount()

Returns the number of parameters minus the cause parameter count for the method.

Returns:
  the number of parameters minus the cause parameter count for the method.

#### isLoggerMethod

    boolean isLoggerMethod()

Returns `true` if this is a logger method, otherwise `false`.

Returns:
  `true` if this is a logger method, otherwise `false`.

#### reference

    ExecutableElement reference()

Description copied from interface: `MessageObject`
The object used to extract information for the message logger or message bundle, if applicable. The reference is not used for the implementation and is provided for convenience.

For example, in an annotation processor implementation a `ExecutableElement` might be returned.

Specified by:
  `reference` in interface `MessageObject`
Returns:
  the reference object used to extract information.