com.interface21.context.support
Class MessageSourceResolvableImpl

java.lang.Object
  |
  +--com.interface21.context.support.MessageSourceResolvableImpl
All Implemented Interfaces:
MessageSourceResolvable, java.io.Serializable
Direct Known Subclasses:
ObjectError

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

Easy way to store all the necessary values needed to resolve messages from a MessageSource.

Version:
$Id: MessageSourceResolvableImpl.java,v 1.3 2003/04/29 16:18:24 jhoeller Exp $
Author:
Tony Falabella
See Also:
Serialized Form

Constructor Summary
MessageSourceResolvableImpl(MessageSourceResolvable resolvable)
          Copy constructor: Create a new instance from another resolvable.
MessageSourceResolvableImpl(java.lang.String[] codes, java.lang.Object[] args)
          Create a new instance, using multiple codes.
MessageSourceResolvableImpl(java.lang.String[] codes, java.lang.Object[] args, java.lang.String defaultMessage)
          Create a new instance, using multiple codes and a default message.
 
Method Summary
 java.lang.Object[] getArgs()
          Return the array of args to be used to resolve this message.
 java.lang.String getCode()
          Return the default code of this resolvable, i.e. the last one in the codes array.
 java.lang.String[] getCodes()
          Return the codes to be used to resolve this message, in the order they should get tried.
 java.lang.String getDefaultMessage()
          Return the defaultMessage to be used to resolve this message.
protected  java.lang.String resolvableToString()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MessageSourceResolvableImpl

public MessageSourceResolvableImpl(java.lang.String[] codes,
                                   java.lang.Object[] args,
                                   java.lang.String defaultMessage)
Create a new instance, using multiple codes and a default message.
See Also:
MessageSourceResolvable.getCodes()

MessageSourceResolvableImpl

public MessageSourceResolvableImpl(java.lang.String[] codes,
                                   java.lang.Object[] args)
Create a new instance, using multiple codes.
See Also:
MessageSourceResolvable.getCodes()

MessageSourceResolvableImpl

public MessageSourceResolvableImpl(MessageSourceResolvable resolvable)
Copy constructor: Create a new instance from another resolvable.
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 they should get tried. The last code will therefore be the default one.
Specified by:
getCodes in interface MessageSourceResolvable
Following copied from interface: com.interface21.context.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.

getArgs

public java.lang.Object[] getArgs()
Description copied from interface: MessageSourceResolvable
Return the array of args to be used to resolve this message.
Specified by:
getArgs in interface MessageSourceResolvable
Following copied from interface: com.interface21.context.MessageSourceResolvable
Returns:
An array of objects to be used as params to replace placeholders within the code message text.

getDefaultMessage

public java.lang.String getDefaultMessage()
Description copied from interface: MessageSourceResolvable
Return the defaultMessage to be used to resolve this message.
Specified by:
getDefaultMessage in interface MessageSourceResolvable
Following copied from interface: com.interface21.context.MessageSourceResolvable
Returns:
The defaultMessage, or null if no default.

resolvableToString

protected java.lang.String resolvableToString()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Rod Johnson and Spring contributors 2001-2003.