Interface MessageMethod
-
- All Superinterfaces:
javax.lang.model.AnnotatedConstruct,java.lang.Comparable<MessageMethod>,DelegatingElement,DelegatingExecutableElement,javax.lang.model.element.Element,javax.lang.model.element.ExecutableElement,JavaDocComment,javax.lang.model.element.Parameterizable
public interface MessageMethod extends java.lang.Comparable<MessageMethod>, JavaDocComment, DelegatingExecutableElement
Date: 29.07.2011- Author:
- James R. Perkins
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceMessageMethod.MessageRepresents aMessageannotation on a method.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Parametercause()intformatParameterCount()Returns the number of parameters minus the cause parameter count for the method.booleanhasCause()Returnstrueif there is a cause element, otherwisefalse.booleaninheritsMessage()Indicates whether the message was inherited from another message or not.booleanisLoggerMethod()Returnstrueif this is a logger method, otherwisefalse.booleanisOverloaded()Returnstrueif the method is overloaded, otherwisefalse.java.lang.StringloggerMethod()Returns the LogMessage annotation associated with this method only ifisLoggerMethod()returnstrue.java.lang.StringlogLevel()Returns the log level parameter associated with the method only ifisLoggerMethod()returnstrue.MessageMethod.Messagemessage()TheMessageMethod.Messageto be used for the method.java.lang.StringmessageMethodName()Returns the name of the method used to retrieve the message.java.lang.Stringname()Returns the method name.java.util.Set<Parameter>parameters()Returns the parameters for the method.java.util.Set<Parameter>parametersAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)Returns an unmodifiable collection of the parameters specified by the parameter type or an empty set.ReturnTypereturnType()Returns the return type for the method.java.util.Set<ThrowableType>thrownTypes()Returns a collection of throwable types the method throws.java.lang.StringtranslationKey()Returns the name of the key used in the translation files for the message translation.-
Methods inherited from interface org.jboss.logging.processor.model.DelegatingElement
accept, asType, getAnnotation, getAnnotationMirrors, getAnnotationsByType, getEnclosedElements, getEnclosingElement, getKind, getModifiers, isAnnotatedWith
-
Methods inherited from interface org.jboss.logging.processor.model.DelegatingExecutableElement
getDefaultValue, getDelegate, getParameters, getReceiverType, getReturnType, getSimpleName, getThrownTypes, getTypeParameters, isDefault, isVarArgs
-
Methods inherited from interface org.jboss.logging.processor.model.JavaDocComment
getComment
-
-
-
-
Method Detail
-
name
java.lang.String name()
Returns the method name.- Returns:
- the method name.
-
parameters
java.util.Set<Parameter> parameters()
Returns the parameters for the method.- Returns:
- the parameters for the method
-
parametersAnnotatedWith
java.util.Set<Parameter> parametersAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
Returns an unmodifiable collection of the parameters specified by the parameter type or an empty set.- Parameters:
annotation- the annotation to get the parameters for- Returns:
- a collection of the parameters or an empty set.
-
returnType
ReturnType returnType()
Returns the return type for the method.- Returns:
- the return type for the method.
-
thrownTypes
java.util.Set<ThrowableType> thrownTypes()
Returns a collection of throwable types the method throws. If the method throws no exceptions an empty collection is returned.- Returns:
- a collection of throwable types or an empty collection.
-
message
MessageMethod.Message message()
TheMessageMethod.Messageto be used for the method.- Returns:
- the message.
-
inheritsMessage
boolean inheritsMessage()
Indicates whether the message was inherited from another message or not. Iftrueis returned theMessageMethod.Messagewas inherited from a different method, otherwisefalse. Note:falsedoes not indicate the method has aMessageannotation.- Returns:
trueif the message was inherited from a different method, otherwisefalse.
-
messageMethodName
java.lang.String messageMethodName()
Returns the name of the method used to retrieve the message.- Returns:
- the name of the message method.
-
translationKey
java.lang.String translationKey()
Returns the name of the key used in the translation files for the message translation.- Returns:
- the name of the key in the translation files.
-
hasCause
boolean hasCause()
Returnstrueif there is a cause element, otherwisefalse.- Returns:
trueif there is a cause element, otherwisefalse
-
isOverloaded
boolean isOverloaded()
Returnstrueif the method is overloaded, otherwisefalse.- Returns:
trueif the method is overloaded, otherwisefalse
-
cause
Parameter cause()
- Returns:
- the cause element, otherwise
null.
-
loggerMethod
java.lang.String loggerMethod()
Returns the LogMessage annotation associated with this method only ifisLoggerMethod()returnstrue.- Returns:
- the log message annotation
-
logLevel
java.lang.String logLevel()
Returns the log level parameter associated with the method only ifisLoggerMethod()returnstrue.- Returns:
- the enum name of the log level
-
formatParameterCount
int formatParameterCount()
Returns the number of parameters minus the cause parameter count for the method.- Returns:
- the number of parameters minus the cause parameter count for the method.
-
isLoggerMethod
boolean isLoggerMethod()
Returnstrueif this is a logger method, otherwisefalse.- Returns:
trueif this is a logger method, otherwisefalse.
-
-