org.jbind.message
Class DecoratedMessage

java.lang.Object
  extended byorg.jbind.message.AbstractMessage
      extended byorg.jbind.message.DecoratedMessage
All Implemented Interfaces:
IMessage

public class DecoratedMessage
extends AbstractMessage


Constructor Summary
DecoratedMessage(IMessageFormats aMessageFormats, java.lang.String aKey, java.lang.Object[] aParams, IMessage aMessage)
           
 
Method Summary
 void addTo(ICompositeMessage aCompositeMessage)
          Adds this message as a sub message to the specified composite message.
 java.lang.Object getParameters(java.util.Locale aLocale)
           
 boolean isComposite()
          Indicates if the message is a composite message.
 boolean isEmpty()
          Checks for emptiness.
 java.util.Iterator iterSimpleMessages()
          Iterates all simple messages contained in the message.
 java.util.Iterator iterSubMessages()
          Iterates the sub-messages of this message.
 
Methods inherited from class org.jbind.message.AbstractMessage
getOrigin, output, output, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DecoratedMessage

public DecoratedMessage(IMessageFormats aMessageFormats,
                        java.lang.String aKey,
                        java.lang.Object[] aParams,
                        IMessage aMessage)
Parameters:
aMessageFormats - (required). Contains the message format that is used for the decoration.
aKey - (required). The key of the message format that is used for decoration.
aParams - (optional). Parameters that may be inserted into the decorating message format.
aMessage - (required). The message that is decorated. The output of the message can be accessed as the 0th parameter in the decorating message format.
Method Detail

isEmpty

public boolean isEmpty()
Description copied from interface: IMessage
Checks for emptiness. Simple messages are always non-empty whereas a composite message is non-empty iff it contains a non-empty sub-message.

Returns:
Returns true iff this message is empty.

isComposite

public boolean isComposite()
Description copied from interface: IMessage
Indicates if the message is a composite message.

Returns:
Returns true iff the message is a composite message.

iterSubMessages

public java.util.Iterator iterSubMessages()
Description copied from interface: IMessage
Iterates the sub-messages of this message. Simple messages always return an empty iterator.

Returns:
(required).

iterSimpleMessages

public java.util.Iterator iterSimpleMessages()
Description copied from interface: IMessage
Iterates all simple messages contained in the message.

Returns:
(required). An iterator of IMessage.

getParameters

public java.lang.Object getParameters(java.util.Locale aLocale)
Specified by:
getParameters in class AbstractMessage

addTo

public void addTo(ICompositeMessage aCompositeMessage)
Description copied from interface: IMessage
Adds this message as a sub message to the specified composite message. If this message is a composite message then it recursively adds its submessages using this method again. No entry is added for a composite message itself.

Parameters:
aCompositeMessage - (required). The composite messages to which sub messages are added.