org.springframework.context.support
Class DefaultMessageSourceResolvable

java.lang.Object
  extended byorg.springframework.context.support.DefaultMessageSourceResolvable
All Implemented Interfaces:
MessageSourceResolvable, java.io.Serializable
Direct Known Subclasses:
ObjectError

public class DefaultMessageSourceResolvable
extends java.lang.Object
implements MessageSourceResolvable, java.io.Serializable

Default implementation of the MessageSourceResolvable interface. Easy way to store all the necessary values needed to resolve messages from a MessageSource.

Version:
$Id: DefaultMessageSourceResolvable.java,v 1.1 2004/02/13 17:42:57 jhoeller Exp $
Author:
Tony Falabella, Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
protected DefaultMessageSourceResolvable()
          Used only by subclasses who need to do custom initialization before setting code, arguments, and/or the default message.
  DefaultMessageSourceResolvable(MessageSourceResolvable resolvable)
          Copy constructor: Create a new instance from another resolvable.
  DefaultMessageSourceResolvable(java.lang.String[] codes, java.lang.Object[] arguments)
          Create a new instance, using multiple codes.
  DefaultMessageSourceResolvable(java.lang.String[] codes, java.lang.Object[] arguments, java.lang.String defaultMessage)
          Create a new instance, using multiple codes and a default message.
 
Method Summary
 java.lang.Object[] getArguments()
          Return the array of arguments to be used to resolve this message.
 java.lang.String getCode()
          Return the default code of this resolvable, i.e.
 java.lang.String[] getCodes()
          Return the codes to be used to resolve this message, in the order that they should get tried.
 java.lang.String getDefaultMessage()
          Return the default message to be used to resolve this message.
protected  java.lang.String resolvableToString()
           
protected  void setArguments(java.lang.Object[] arguments)
           
protected  void setCodes(java.lang.String[] codes)
           
protected  void setDefaultMessage(java.lang.String defaultMessage)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultMessageSourceResolvable

public DefaultMessageSourceResolvable(java.lang.String[] codes,
                                      java.lang.Object[] arguments)
Create a new instance, using multiple codes.

See Also:
MessageSourceResolvable.getCodes()

DefaultMessageSourceResolvable

public DefaultMessageSourceResolvable(java.lang.String[] codes,
                                      java.lang.Object[] arguments,
                                      java.lang.String defaultMessage)
Create a new instance, using multiple codes and a default message.

See Also:
MessageSourceResolvable.getCodes()

DefaultMessageSourceResolvable

public DefaultMessageSourceResolvable(MessageSourceResolvable resolvable)
Copy constructor: Create a new instance from another resolvable.


DefaultMessageSourceResolvable

protected DefaultMessageSourceResolvable()
Used only by subclasses who need to do custom initialization before setting code, arguments, and/or the default message.

Method Detail

getCodes

public java.lang.String[] getCodes()
Description copied from interface: MessageSourceResolvable
Return the codes to be used to resolve this message, in the order that they should get tried. The last code will therefore be the default one.

Specified by:
getCodes in interface MessageSourceResolvable
Returns:
a String code associated with this message

getCode

public java.lang.String getCode()
Return the default code of this resolvable, i.e. the last one in the codes array.


getArguments

public java.lang.Object[] getArguments()
Description copied from interface: MessageSourceResolvable
Return the array of arguments to be used to resolve this message.

Specified by:
getArguments in interface MessageSourceResolvable
Returns:
an array of objects to be used as parameters to replace placeholders within the code message text
See Also:
java.text.MessageFormat

getDefaultMessage

public java.lang.String getDefaultMessage()
Description copied from interface: MessageSourceResolvable
Return the default message to be used to resolve this message.

Specified by:
getDefaultMessage in interface MessageSourceResolvable
Returns:
the default message, or null if no default

setCodes

protected void setCodes(java.lang.String[] codes)

setArguments

protected void setArguments(java.lang.Object[] arguments)

setDefaultMessage

protected void setDefaultMessage(java.lang.String defaultMessage)

resolvableToString

protected java.lang.String resolvableToString()

toString

public java.lang.String toString()


Copyright (C) 2003-2004 The Spring Framework Project.