org.apache.myfaces.extensions.cdi.message.api
Class AbstractMessage

java.lang.Object
  extended by org.apache.myfaces.extensions.cdi.message.api.AbstractMessage
All Implemented Interfaces:
Serializable, Localizable, Message, MessageContextConfigAware<Message>
Direct Known Subclasses:
AbstractMessageWithSeverity

public abstract class AbstractMessage
extends Object
implements Message, MessageContextConfigAware<Message>

Author:
Gerhard Petracek
See Also:
Serialized Form

Field Summary
protected  List<Serializable> arguments
           
protected  String messageDescriptor
           
protected  Map<Class,MessagePayload> messagePayload
           
protected  Set<NamedArgument> namedArguments
           
 
Constructor Summary
AbstractMessage(Message message)
           
AbstractMessage(String messageDescriptor, Serializable... arguments)
           
AbstractMessage(String messageDescriptor, Set<NamedArgument> namedArguments)
           
 
Method Summary
 void addArgument(Serializable... arguments)
           
protected  void addNamedArgument(NamedArgument namedArgument)
           
protected  void addNumberedArgument(Serializable argument)
           
 void addPayload(Class key, MessagePayload payload)
           
 void addPayload(MessagePayload payload)
           
 boolean equals(Object o)
           
 Serializable[] getArguments()
           
 String getDescriptor()
           
 MessageContextConfig getMessageContextConfig()
           
 Map<Class,MessagePayload> getPayload()
           
 int hashCode()
           
 Message setMessageContextConfig(MessageContextConfig messageContextConfig)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.myfaces.extensions.cdi.message.api.Localizable
toString
 

Field Detail

messageDescriptor

protected String messageDescriptor

namedArguments

protected Set<NamedArgument> namedArguments

arguments

protected List<Serializable> arguments

messagePayload

protected Map<Class,MessagePayload> messagePayload
Constructor Detail

AbstractMessage

public AbstractMessage(Message message)

AbstractMessage

public AbstractMessage(String messageDescriptor,
                       Serializable... arguments)

AbstractMessage

public AbstractMessage(String messageDescriptor,
                       Set<NamedArgument> namedArguments)
Method Detail

addArgument

public void addArgument(Serializable... arguments)
Specified by:
addArgument in interface Message
Parameters:
arguments - 1-n new arguments for the current message

addNamedArgument

protected void addNamedArgument(NamedArgument namedArgument)

addNumberedArgument

protected void addNumberedArgument(Serializable argument)

getDescriptor

public String getDescriptor()
Specified by:
getDescriptor in interface Message
Returns:
the message key (or inline-text) of the current message

getArguments

public Serializable[] getArguments()
Specified by:
getArguments in interface Message
Returns:
all named and numbered arguments

addPayload

public void addPayload(MessagePayload payload)

getPayload

public Map<Class,MessagePayload> getPayload()
Specified by:
getPayload in interface Message
Returns:
the payload of the message

addPayload

public void addPayload(Class key,
                       MessagePayload payload)
Specified by:
addPayload in interface Message
Parameters:
key - of the payload
payload - value of the payload

setMessageContextConfig

public Message setMessageContextConfig(MessageContextConfig messageContextConfig)
Specified by:
setMessageContextConfig in interface MessageContextConfigAware<Message>
Parameters:
messageContextConfig - config of the current message context
Returns:
the current instance

getMessageContextConfig

public MessageContextConfig getMessageContextConfig()
Specified by:
getMessageContextConfig in interface MessageContextConfigAware<Message>
Returns:
the stored config - null otherwise

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2010 The Apache Software Foundation. All Rights Reserved.