org.apache.myfaces.trinidad.util

## Class MessageFactory

- java.lang.Object
- - org.apache.myfaces.trinidad.util.MessageFactory

-     public final class MessageFactory
      extends Object

  Factory class to return `FacesMessage` objects.
  Version:
    $Name: $ ($Revision: adfrt/faces/adf-faces-api/src/main/java/oracle/adf/view/faces/util/MessageFactory.java#0 $) $Date: 30-nov-2005.11:48:33 $

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static javax.faces.application.FacesMessage` | `getMessage(javax.faces.context.FacesContext context, javax.faces.application.FacesMessage.Severity severity, String messageId, Object[] parameters)` Creates a FacesMessage containing formatted text.
    `static javax.faces.application.FacesMessage` | `getMessage(javax.faces.context.FacesContext context, javax.faces.application.FacesMessage.Severity severity, String messageId, Object[] parameters, javax.faces.component.UIComponent component)` Creates a FacesMessage containing formatted text.
    `static javax.faces.application.FacesMessage` | `getMessage(javax.faces.context.FacesContext context, String messageId)` Creates a FacesMessage without any parameters, and a severity of SEVERITY_ERROR.
    `static javax.faces.application.FacesMessage` | `getMessage(javax.faces.context.FacesContext context, String messageId, Object parameter)` Creates a FacesMessage using a single parameter.
    `static javax.faces.application.FacesMessage` | `getMessage(javax.faces.context.FacesContext context, String messageId, Object[] parameters)` Creates a FacesMessage containing formatted text and a severity of SEVERITY_ERROR.
    `static javax.faces.application.FacesMessage` | `getMessage(javax.faces.context.FacesContext context, String messageId, Object[] parameters, Object label)` Creates a FacesMessage containing formatted text and a severity of SEVERITY_ERROR.
    `static javax.faces.application.FacesMessage` | `getMessage(javax.faces.context.FacesContext context, String messageId, Object[] parameters, javax.faces.component.UIComponent component)` Creates a FacesMessage containing formatted text and a severity of SEVERITY_ERROR.
    `static javax.faces.application.FacesMessage` | `getMessage(javax.faces.context.FacesContext context, String messageId, Object parameter, Object label)` Creates a FacesMessage using a single parameter.
    `static javax.faces.application.FacesMessage` | `getMessage(javax.faces.context.FacesContext context, String messageId, Object customMessagePattern, Object[] parameters)` Gets the translation summary and detail text from the message bundle.
    `static javax.faces.application.FacesMessage` | `getMessage(javax.faces.context.FacesContext context, String messageId, Object customMessagePattern, Object[] parameters, Object label)` Gets the translation summary and detail text from the message bundle.
    `static javax.faces.application.FacesMessage` | `getMessage(javax.faces.context.FacesContext context, String messageId, Object customMessagePattern, Object[] parameters, javax.faces.component.UIComponent component)` Gets the translation summary and detail text from the message bundle.
    `static javax.faces.application.FacesMessage` | `getMessage(javax.faces.context.FacesContext context, String messageId, javax.faces.component.UIComponent component)` Creates a FacesMessage without any parameters, and a severity of SEVERITY_ERROR.
    `static javax.faces.application.FacesMessage` | `getMessage(Throwable error)` Creates a FacesMessage for the given Throwable.
    `static String` | `getString(javax.faces.context.FacesContext context, String messageId)` Returns the localized string

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getMessage

          public static javax.faces.application.FacesMessage getMessage(Throwable error)

      Creates a FacesMessage for the given Throwable. The severity is `FacesMessage.SEVERITY_ERROR`
      Parameters:
        `error` - The root cause of this Exception will be used.

    - #### getMessage

          public static javax.faces.application.FacesMessage getMessage(javax.faces.context.FacesContext context,
                                                        String messageId,
                                                        Object[] parameters)

      Creates a FacesMessage containing formatted text and a severity of SEVERITY_ERROR.
      Parameters:
        `context` - faces context
        `messageId` - the bundle key for the translated string
        `parameters` - parameters to be substituted in the placeholders of the translated string.
      Returns:
        a FacesMessage object

    - #### getMessage

          public static javax.faces.application.FacesMessage getMessage(javax.faces.context.FacesContext context,
                                                        String messageId,
                                                        Object[] parameters,
                                                        javax.faces.component.UIComponent component)

      Creates a FacesMessage containing formatted text and a severity of SEVERITY_ERROR.
      Parameters:
        `context` - faces context
        `messageId` - the bundle key for the translated string
        `parameters` - parameters to be substituted in the placeholders of the translated string.
        `component` - The component generating the message (allows label tracking)
      Returns:
        a FacesMessage object

    - #### getMessage

          public static javax.faces.application.FacesMessage getMessage(javax.faces.context.FacesContext context,
                                                        String messageId,
                                                        Object[] parameters,
                                                        Object label)

      Creates a FacesMessage containing formatted text and a severity of SEVERITY_ERROR.
      Parameters:
        `context` - faces context
        `messageId` - the bundle key for the translated string
        `parameters` - parameters to be substituted in the placeholders of the translated string.
        `label` - The label of the component generating the message
      Returns:
        a FacesMessage object

    - #### getMessage

          public static javax.faces.application.FacesMessage getMessage(javax.faces.context.FacesContext context,
                                                        javax.faces.application.FacesMessage.Severity severity,
                                                        String messageId,
                                                        Object[] parameters)

      Creates a FacesMessage containing formatted text.
      Parameters:
        `context` - faces context
        `severity` - the message severity
        `messageId` - the bundle key for the translated string
        `parameters` - parameters to be substituted in the placeholders of the translated string.
      Returns:
        a FacesMessage object

    - #### getMessage

          public static javax.faces.application.FacesMessage getMessage(javax.faces.context.FacesContext context,
                                                        javax.faces.application.FacesMessage.Severity severity,
                                                        String messageId,
                                                        Object[] parameters,
                                                        javax.faces.component.UIComponent component)

      Creates a FacesMessage containing formatted text.
      Parameters:
        `context` - faces context
        `severity` - the message severity
        `messageId` - the bundle key for the translated string
        `parameters` - parameters to be substituted in the placeholders of the translated string.
        `component` - The component generating the message (allows label tracking)
      Returns:
        a FacesMessage object

    - #### getMessage

          public static javax.faces.application.FacesMessage getMessage(javax.faces.context.FacesContext context,
                                                        String messageId)

      Creates a FacesMessage without any parameters, and a severity of SEVERITY_ERROR.
      Parameters:
        `context` - faces context
        `messageId` - the bundle key for the translated string
      Returns:
        a FacesMessage object

    - #### getString

          public static String getString(javax.faces.context.FacesContext context,
                         String messageId)

      Returns the localized string
      Parameters:
        `context` -
        `messageId` -
      Returns:
        String

    - #### getMessage

          public static javax.faces.application.FacesMessage getMessage(javax.faces.context.FacesContext context,
                                                        String messageId,
                                                        javax.faces.component.UIComponent component)

      Creates a FacesMessage without any parameters, and a severity of SEVERITY_ERROR.
      Parameters:
        `context` - faces context
        `messageId` - the bundle key for the translated string
        `component` - The component generating the message (allows label tracking)
      Returns:
        a FacesMessage object

    - #### getMessage

          public static javax.faces.application.FacesMessage getMessage(javax.faces.context.FacesContext context,
                                                        String messageId,
                                                        Object parameter,
                                                        Object label)

      Creates a FacesMessage using a single parameter.
      Parameters:
        `context` - faces context
        `messageId` - the bundle key for the translated string
        `parameter` - parameter to be substituted for "{0}"
        `label` - the label of the creating component
      Returns:
        a FacesMessage object

    - #### getMessage

          public static javax.faces.application.FacesMessage getMessage(javax.faces.context.FacesContext context,
                                                        String messageId,
                                                        Object parameter)

      Creates a FacesMessage using a single parameter.
      Parameters:
        `context` - faces context
        `messageId` - the bundle key for the translated string
        `parameter` - parameter to be substituted for "{0}"
      Returns:
        a FacesMessage object

    - #### getMessage

          public static javax.faces.application.FacesMessage getMessage(javax.faces.context.FacesContext context,
                                                        String messageId,
                                                        Object customMessagePattern,
                                                        Object[] parameters)

      Gets the translation summary and detail text from the message bundle. If `customMessagePattern` is set, then it is used as the detail part of the faces message. The summary and detail string are formatted based on the supplied `parameters`. Returns a FacesMessage using the formatted summary and detail message with severity set to error.

      Parameters:
        `context` - faces context
        `messageId` - the bundle key for the translated string
        `customMessagePattern` - Custom error message. It can also contain placeholders which will be formatted with the supplied parameters. This customizes the detail part of the `FacesMessage`. If value is null. Then picksup translation summary and detail from the bundle, which is then formatted and used in construction of faces message.
        `parameters` - parameters to be substituted in the placeholders of the translated string.
      Returns:
        a FacesMessage object

    - #### getMessage

          public static javax.faces.application.FacesMessage getMessage(javax.faces.context.FacesContext context,
                                                        String messageId,
                                                        Object customMessagePattern,
                                                        Object[] parameters,
                                                        javax.faces.component.UIComponent component)

      Gets the translation summary and detail text from the message bundle. If `customMessagePattern` is set, then it is used as the detail part of the faces message. The summary and detail string are formatted based on the supplied `parameters`. Returns a FacesMessage using the formatted summary and detail message with severity set to error.

      Parameters:
        `context` - faces context
        `messageId` - the bundle key for the translated string
        `customMessagePattern` - Custom error message. It can also contain placeholders which will be formatted with the supplied parameters. This customizes the detail part of the `FacesMessage`. If value is null. Then picksup translation summary and detail from the bundle, which is then formatted and used in construction of faces message.
        `parameters` - parameters to be substituted in the placeholders of the translated string.
        `component` - The component generating the message (allows label tracking)
      Returns:
        a FacesMessage object

    - #### getMessage

          public static javax.faces.application.FacesMessage getMessage(javax.faces.context.FacesContext context,
                                                        String messageId,
                                                        Object customMessagePattern,
                                                        Object[] parameters,
                                                        Object label)

      Gets the translation summary and detail text from the message bundle. If `customMessagePattern` is set, then it is used as the detail part of the faces message. The summary and detail string are formatted based on the supplied `parameters`. Returns a FacesMessage using the formatted summary and detail message with severity set to error.

      Parameters:
        `context` - faces context
        `messageId` - the bundle key for the translated string
        `customMessagePattern` - Custom error message. It can also contain placeholders which will be formatted with the supplied parameters. This customizes the detail part of the `FacesMessage`. If value is null. Then picksup translation summary and detail from the bundle, which is then formatted and used in construction of faces message.
        `parameters` - parameters to be substituted in the placeholders of the translated string.
        `label` - the label of the creating component
      Returns:
        a FacesMessage object

Copyright © 2001-2017 The Apache Software Foundation. All Rights Reserved.