public interface Message extends Comparable<Message>, MessageTranslation
Modifier and Type | Interface and Description |
---|---|
static class |
Message.AlternateFormMapping
Mapping for a group of particular alternate forms to the message to use.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(MessageVisitor v)
Accept a
MessageVisitor . |
void |
accept(MessageVisitor v,
GwtLocale locale)
Accept a
MessageVisitor , using translations from the requested
locale. |
int |
compareTo(Message o)
Messages are ordered by their keys.
|
Iterable<Message.AlternateFormMapping> |
getAllMessageForms()
Get the list of all possible messages.
|
<A extends Annotation> |
getAnnotation(Class<A> annotClass)
Return the requested annotation present on this message, including parents
if the annotation is inherited.
|
String |
getDefaultMessage()
Return the default form of this message.
|
String |
getDescription()
Return the description of this message.
|
String |
getKey()
Return the key associated with this message.
|
String |
getMeaning()
Return the meaning of this message.
|
MessageInterface |
getMessageInterface()
Return the
MessageInterface this message is associated with. |
MessageFormatUtils.MessageStyle |
getMessageStyle()
Return the message style (ie, quoting and argument rules) of this message.
|
String |
getMethodName()
Return the name of the method for this message - this should generally only
be used in providing error messages.
|
List<Parameter> |
getParameters()
Get the parameters defined for this message.
|
Type |
getReturnType()
Return the declared return type for this message.
|
int[] |
getSelectorParameterIndices()
Get the list of parameters controlling alternate message selection.
|
MessageTranslation |
getTranslation(GwtLocale locale)
Get an appropriate translation for this message for a given locale.
|
boolean |
isAnnotationPresent(Class<? extends Annotation> annotClass)
Check if a specified annotation is present on this message (including
via inheritance if the annotation is inherited).
|
boolean |
isVarArgs()
Return true if this method is a varargs method.
|
$isInstance
getMatchedLocale
void accept(MessageVisitor v) throws MessageProcessingException
MessageVisitor
.v
- MessageVisitor
to callMessageProcessingException
- if thrown by the visitor or its
sub-visitorsvoid accept(MessageVisitor v, GwtLocale locale) throws MessageProcessingException
MessageVisitor
, using translations from the requested
locale.v
- MessageVisitor
to calllocale
- locale to use for translations, or null to use the messages
present in the sourceMessageProcessingException
- if thrown by the visitor or its
sub-visitorsint compareTo(Message o)
compareTo
in interface Comparable<Message>
o
, 0 if they are equal, or
1 if this is message is after {code o}Iterable<Message.AlternateFormMapping> getAllMessageForms()
getAllMessageForms
in interface MessageTranslation
<A extends Annotation> A getAnnotation(Class<A> annotClass)
annotClass
- String getDefaultMessage()
getDefaultMessage
in interface MessageTranslation
String getDescription()
String getKey()
String getMeaning()
MessageInterface getMessageInterface()
MessageInterface
this message is associated with.MessageInterface
instanceMessageFormatUtils.MessageStyle getMessageStyle()
String getMethodName()
List<Parameter> getParameters()
Type getReturnType()
int[] getSelectorParameterIndices()
getParameters()
MessageTranslation getTranslation(GwtLocale locale)
locale
- a locale to get a translation for, or null to retrieve the
message in the sourceMessageTranslation
instance - if locale is null,
or no better match is found, this
must be returnedboolean isAnnotationPresent(Class<? extends Annotation> annotClass)
annotClass
- boolean isVarArgs()
Copyright © 2018. All rights reserved.