javax.faces.context
Class MessageResources

java.lang.Object
  extended byjavax.faces.context.MessageResources

public abstract class MessageResources
extends java.lang.Object

MessageResources represents a collection of message templates, uniquely identified by message identifiers, that can be used to construct localized Message instances to be added to the message list in a FacesContext.

An instance of MessageResources is created by calling the getMessageResources() method of Application, for a specified message resources identifier. Because this instance is shared across multiple requests, it must be implemented in a thread-safe manner.


Field Summary
static java.lang.String FACES_API_MESSAGES
          Message resources identifier for a MessageResources instance containing messages whose message identifiers are defined in the JavaServer Faces specification.
static java.lang.String FACES_IMPL_MESSAGES
          Message resources identifier for a MessageResources instance containing messages whose message identifiers are defined by the JavaServer Faces implementation being used.
 
Constructor Summary
MessageResources()
           
 
Method Summary
abstract  Message getMessage(FacesContext context, java.lang.String messageId)
          Return a localized Message instance corresponding to the specified parameters, or null if the specified message identifier is not supported by the MessageResources instance.
abstract  Message getMessage(FacesContext context, java.lang.String messageId, java.lang.Object param0)
          Return a localized Message instance corresponding to the specified parameters, or null if the specified message identifier is not supported by the MessageResources instance.
abstract  Message getMessage(FacesContext context, java.lang.String messageId, java.lang.Object[] params)
          Return a localized Message instance corresponding to the specified parameters, or null if the specified message identifier is not supported by the MessageResources instance.
abstract  Message getMessage(FacesContext context, java.lang.String messageId, java.lang.Object param0, java.lang.Object param1)
          Return a localized Message instance corresponding to the specified parameters, or null if the specified message identifier is not supported by the MessageResources instance.
abstract  Message getMessage(FacesContext context, java.lang.String messageId, java.lang.Object param0, java.lang.Object param1, java.lang.Object param2)
          Return a localized Message instance corresponding to the specified parameters, or null if the specified message identifier is not supported by the MessageResources instance.
abstract  Message getMessage(FacesContext context, java.lang.String messageId, java.lang.Object param0, java.lang.Object param1, java.lang.Object param2, java.lang.Object param3)
          Return a localized Message instance corresponding to the specified parameters, or null if the specified message identifier is not supported by the MessageResources instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FACES_API_MESSAGES

public static final java.lang.String FACES_API_MESSAGES

Message resources identifier for a MessageResources instance containing messages whose message identifiers are defined in the JavaServer Faces specification.

See Also:
Constant Field Values

FACES_IMPL_MESSAGES

public static final java.lang.String FACES_IMPL_MESSAGES

Message resources identifier for a MessageResources instance containing messages whose message identifiers are defined by the JavaServer Faces implementation being used.

See Also:
Constant Field Values
Constructor Detail

MessageResources

public MessageResources()
Method Detail

getMessage

public abstract Message getMessage(FacesContext context,
                                   java.lang.String messageId)

Return a localized Message instance corresponding to the specified parameters, or null if the specified message identifier is not supported by the MessageResources instance.

Parameters:
context - The FacesContext associated with the request being processed
messageId - Message identifier of the requested message
Throws:
java.lang.NullPointerException - if context or messageId is null

getMessage

public abstract Message getMessage(FacesContext context,
                                   java.lang.String messageId,
                                   java.lang.Object[] params)

Return a localized Message instance corresponding to the specified parameters, or null if the specified message identifier is not supported by the MessageResources instance.

Parameters:
context - The FacesContext associated with the request being processed
messageId - Message identifier of the requested message
params - Substitution parameters for this message
Throws:
java.lang.NullPointerException - if context or messageId is null

getMessage

public abstract Message getMessage(FacesContext context,
                                   java.lang.String messageId,
                                   java.lang.Object param0)

Return a localized Message instance corresponding to the specified parameters, or null if the specified message identifier is not supported by the MessageResources instance.

Parameters:
context - The FacesContext associated with the request being processed
messageId - Message identifier of the requested message
param0 - First ubstitution parameter for this message
Throws:
java.lang.NullPointerException - if context or messageId is null

getMessage

public abstract Message getMessage(FacesContext context,
                                   java.lang.String messageId,
                                   java.lang.Object param0,
                                   java.lang.Object param1)

Return a localized Message instance corresponding to the specified parameters, or null if the specified message identifier is not supported by the MessageResources instance.

Parameters:
context - The FacesContext associated with the request being processed
messageId - Message identifier of the requested message
param0 - First ubstitution parameter for this message
param1 - Second substitution parameter for this message
Throws:
java.lang.NullPointerException - if context or messageId is null

getMessage

public abstract Message getMessage(FacesContext context,
                                   java.lang.String messageId,
                                   java.lang.Object param0,
                                   java.lang.Object param1,
                                   java.lang.Object param2)

Return a localized Message instance corresponding to the specified parameters, or null if the specified message identifier is not supported by the MessageResources instance.

Parameters:
context - The FacesContext associated with the request being processed
messageId - Message identifier of the requested message
param0 - First ubstitution parameter for this message
param1 - Second substitution parameter for this message
param2 - Third substitution parameter for this message
Throws:
java.lang.NullPointerException - if context or messageId is null

getMessage

public abstract Message getMessage(FacesContext context,
                                   java.lang.String messageId,
                                   java.lang.Object param0,
                                   java.lang.Object param1,
                                   java.lang.Object param2,
                                   java.lang.Object param3)

Return a localized Message instance corresponding to the specified parameters, or null if the specified message identifier is not supported by the MessageResources instance.

Parameters:
context - The FacesContext associated with the request being processed
messageId - Message identifier of the requested message
param0 - First ubstitution parameter for this message
param1 - Second substitution parameter for this message
param2 - Third substitution parameter for this message
param3 - Fourth substitution parameter for this message
Throws:
java.lang.NullPointerException - if context or messageId is null