org.jbind.message
Class SimpleMessage

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

public class SimpleMessage
extends AbstractMessage


Constructor Summary
SimpleMessage(IMessageFormats aMessageFormats, java.lang.String aKey, java.lang.Object aParameters)
           
 
Method Summary
 void addTo(ICompositeMessage aCompositeMessage)
          Adds this message as a sub message to the specified composite message.
protected  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.
 java.lang.String output(java.util.Locale aLocale, boolean anIndent, boolean anOutputContainerLines)
          Outputs this message and all of its sub-messages.
 
Methods inherited from class org.jbind.message.AbstractMessage
getOrigin, output, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleMessage

public SimpleMessage(IMessageFormats aMessageFormats,
                     java.lang.String aKey,
                     java.lang.Object aParameters)
Method Detail

getParameters

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

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.

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.

output

public java.lang.String output(java.util.Locale aLocale,
                               boolean anIndent,
                               boolean anOutputContainerLines)
Description copied from interface: IMessage
Outputs this message and all of its sub-messages.

Best efforts are undertaken that the message is output using the specified locale. However, if the message can not be output using the specified locale then another locale is used.

Specified by:
output in interface IMessage
Overrides:
output in class AbstractMessage