
public abstract class AbstractMessage extends Object implements Message
Message.Message.AlternateFormMapping| Constructor and Description |
|---|
AbstractMessage(GwtLocaleFactory localeFactory,
MessageInterface msgIntf) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(MessageVisitor mv)
Accept a
MessageVisitor. |
void |
accept(MessageVisitor mv,
GwtLocale locale)
Accept a
MessageVisitor, using translations from the requested
locale. |
protected void |
addMapping(List<Message.AlternateFormMapping> mapping,
int numSelectors,
String joinedForms,
String msg) |
int |
compareTo(Message o)
Messages are ordered by their keys.
|
protected List<AlternateMessageSelector.AlternateForm> |
defaultForms() |
Iterable<Message.AlternateFormMapping> |
getAllMessageForms()
Get the list of all possible messages.
|
protected String[] |
getAlternateMessages()
Get the alternate message forms from either an AlternateMessages annotation
or a PluralText annotation.
|
abstract <A extends Annotation> |
getAnnotation(Class<A> annotClass)
Return the requested annotation present on this message, including parents
if the annotation is inherited.
|
protected GwtLocale |
getDefaultLocale() |
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.
|
protected GwtLocaleFactory |
getLocaleFactory() |
GwtLocale |
getMatchedLocale()
Get the locale for this translation.
|
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.
|
abstract String |
getMethodName()
Return the name of the method for this message - this should generally only
be used in providing error messages.
|
abstract List<Parameter> |
getParameters()
Get the parameters defined for this message.
|
abstract Type |
getReturnType()
Return the declared return type for this message.
|
int[] |
getSelectorParameterIndices()
Get the list of parameters controlling alternate message selection.
|
abstract MessageTranslation |
getTranslation(GwtLocale locale)
Get an appropriate translation for this message for a given locale.
|
protected void |
init()
Called by subclasses to complete initialization, after ensuring that calls
to
getAnnotation(Class) will function properly. |
abstract boolean |
isAnnotationPresent(Class<? extends Annotation> annotClass)
Check if a specified annotation is present on this message (including
via inheritance if the annotation is inherited).
|
protected boolean |
isStringMap() |
public AbstractMessage(GwtLocaleFactory localeFactory, MessageInterface msgIntf)
public void accept(MessageVisitor mv) throws MessageProcessingException
MessageMessageVisitor.accept in interface Messagemv - MessageVisitor to callMessageProcessingException - if thrown by the visitor or its
sub-visitorspublic void accept(MessageVisitor mv, GwtLocale locale) throws MessageProcessingException
MessageMessageVisitor, using translations from the requested
locale.accept in interface Messagemv - 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-visitorspublic int compareTo(Message o)
MessagecompareTo in interface MessagecompareTo in interface Comparable<Message>o, 0 if they are equal, or
1 if this is message is after {code o}public Iterable<Message.AlternateFormMapping> getAllMessageForms()
MessagegetAllMessageForms in interface MessagegetAllMessageForms in interface MessageTranslationpublic abstract <A extends Annotation> A getAnnotation(Class<A> annotClass)
MessagegetAnnotation in interface Messagepublic String getDefaultMessage()
MessagegetDefaultMessage in interface MessagegetDefaultMessage in interface MessageTranslationpublic String getDescription()
MessagegetDescription in interface Messagepublic String getKey()
Messagepublic GwtLocale getMatchedLocale()
MessageTranslationgetMatchedLocale in interface MessageTranslationpublic String getMeaning()
MessagegetMeaning in interface Messagepublic MessageInterface getMessageInterface()
MessageMessageInterface this message is associated with.getMessageInterface in interface MessageMessageInterface instancepublic MessageFormatUtils.MessageStyle getMessageStyle()
MessagegetMessageStyle in interface Messagepublic abstract String getMethodName()
MessagegetMethodName in interface Messagepublic abstract List<Parameter> getParameters()
MessagegetParameters in interface Messagepublic abstract Type getReturnType()
MessagegetReturnType in interface Messagepublic int[] getSelectorParameterIndices()
MessagegetSelectorParameterIndices in interface MessageMessage.getParameters()public abstract MessageTranslation getTranslation(GwtLocale locale)
MessagegetTranslation in interface Messagelocale - 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 returnedpublic abstract boolean isAnnotationPresent(Class<? extends Annotation> annotClass)
MessageisAnnotationPresent in interface Messageprotected void addMapping(List<Message.AlternateFormMapping> mapping, int numSelectors, String joinedForms, String msg)
protected List<AlternateMessageSelector.AlternateForm> defaultForms()
protected String[] getAlternateMessages()
protected GwtLocale getDefaultLocale()
protected GwtLocaleFactory getLocaleFactory()
protected void init()
getAnnotation(Class) will function properly.protected boolean isStringMap()
Copyright © 2018. All rights reserved.