public class ReflectionMessage extends AbstractMessage
Message
using reflection.
NOTE: THIS CLASS IS CURRENTLY ONLY SUITABLE FOR TESTING OR IF YOU DON'T CARE ABOUT ACCURATE ARGUMENT NAMES
Message.AlternateFormMapping
Constructor and Description |
---|
ReflectionMessage(GwtLocaleFactory localeFactory,
ReflectionMessageInterface msgIntf,
Method method) |
Modifier and Type | Method and Description |
---|---|
List<AlternateMessageSelector> |
getAlternateSelectors() |
<A extends Annotation> |
getAnnotation(Class<A> annotClass)
Return the requested annotation present on this message, including parents
if the annotation is inherited.
|
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.
|
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.
|
String |
toString() |
accept, accept, addMapping, compareTo, defaultForms, getAllMessageForms, getAlternateMessages, getDefaultLocale, getDefaultMessage, getDescription, getKey, getLocaleFactory, getMatchedLocale, getMeaning, getMessageInterface, getMessageStyle, getSelectorParameterIndices, init, isStringMap
$isInstance
public ReflectionMessage(GwtLocaleFactory localeFactory, ReflectionMessageInterface msgIntf, Method method)
public List<AlternateMessageSelector> getAlternateSelectors()
public <A extends Annotation> A getAnnotation(Class<A> annotClass)
Message
getAnnotation
in interface Message
getAnnotation
in class AbstractMessage
public String getMethodName()
Message
getMethodName
in interface Message
getMethodName
in class AbstractMessage
public List<Parameter> getParameters()
Message
getParameters
in interface Message
getParameters
in class AbstractMessage
public Type getReturnType()
Message
getReturnType
in interface Message
getReturnType
in class AbstractMessage
public MessageTranslation getTranslation(GwtLocale locale)
Message
getTranslation
in interface Message
getTranslation
in class AbstractMessage
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 returnedpublic boolean isAnnotationPresent(Class<? extends Annotation> annotClass)
Message
isAnnotationPresent
in interface Message
isAnnotationPresent
in class AbstractMessage
public boolean isVarArgs()
Message
Copyright © 2018. All rights reserved.