Package org.jboss.logging.processor.apt
Class MessageMethodBuilder.AptMessageMethod
java.lang.Object
org.jboss.logging.processor.apt.MessageMethodBuilder.AptMessageMethod
- All Implemented Interfaces:
Comparable<MessageMethod>,AnnotatedConstruct,Element,ExecutableElement,Parameterizable,DelegatingElement,DelegatingExecutableElement,JavaDocComment,MessageMethod
- Enclosing class:
MessageMethodBuilder
An implementation for the MessageMethod interface.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jboss.logging.processor.model.MessageMethod
MessageMethod.Message -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Parameterprivate final Elementsprivate intprivate booleanprivate booleanprivate MessageMethod.Messageprivate Stringprivate final ExecutableElementprivate final Map<TypeMirror, Set<Parameter>> private ReturnTypeprivate final Set<ThrowableType> private String -
Constructor Summary
ConstructorsConstructorDescriptionAptMessageMethod(Elements elements, ExecutableElement method) Private constructor for the -
Method Summary
Modifier and TypeMethodDescription(package private) voidcause()intbooleanintReturns the number of parameters minus the cause parameter count for the method.The JavaDoc comments if available ornullif there are no JavaDoc's present.The element to delegate the default methods to.booleanhasCause()Returnstrueif there is a cause element, otherwisefalse.inthashCode()booleanIndicates whether the message was inherited from another message or not.booleanReturnstrueif this is a logger method, otherwisefalse.booleanReturnstrueif the method is overloaded, otherwisefalse.Returns the LogMessage annotation associated with this method only ifMessageMethod.isLoggerMethod()returnstrue.logLevel()Returns the log level parameter associated with the method only ifMessageMethod.isLoggerMethod()returnstrue.message()TheMessageMethod.Messageto be used for the method.Returns the name of the method used to retrieve the message.name()Returns the method name.Returns the parameters for the method.parametersAnnotatedWith(Class<? extends Annotation> annotation) Returns an unmodifiable collection of the parameters specified by the parameter type or an empty set.Returns the return type for the method.Returns a collection of throwable types the method throws.toString()Returns the name of the key used in the translation files for the message translation.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jboss.logging.processor.model.DelegatingElement
accept, getAnnotation, getAnnotationMirrors, getAnnotationsByType, getEnclosedElements, getEnclosingElement, getKind, getModifiers, isAnnotatedWithMethods inherited from interface org.jboss.logging.processor.model.DelegatingExecutableElement
asType, getDefaultValue, getParameters, getReceiverType, getReturnType, getSimpleName, getThrownTypes, getTypeParameters, isDefault, isVarArgs
-
Field Details
-
elements
-
parameters
-
thrownTypes
-
method
-
returnType
-
cause
-
inheritsMessage
private boolean inheritsMessage -
isOverloaded
private boolean isOverloaded -
message
-
messageMethodName
-
translationKey
-
formatParameterCount
private int formatParameterCount
-
-
Constructor Details
-
AptMessageMethod
AptMessageMethod(Elements elements, ExecutableElement method) Private constructor for the- Parameters:
elements- the elements utility.method- the method to describe.
-
-
Method Details
-
add
-
name
Description copied from interface:MessageMethodReturns the method name.- Specified by:
namein interfaceMessageMethod- Returns:
- the method name.
-
parameters
Description copied from interface:MessageMethodReturns the parameters for the method.- Specified by:
parametersin interfaceMessageMethod- Returns:
- the parameters for the method
-
parametersAnnotatedWith
Description copied from interface:MessageMethodReturns an unmodifiable collection of the parameters specified by the parameter type or an empty set.- Specified by:
parametersAnnotatedWithin interfaceMessageMethod- Parameters:
annotation- the annotation to get the parameters for- Returns:
- a collection of the parameters or an empty set.
-
returnType
Description copied from interface:MessageMethodReturns the return type for the method.- Specified by:
returnTypein interfaceMessageMethod- Returns:
- the return type for the method.
-
thrownTypes
Description copied from interface:MessageMethodReturns a collection of throwable types the method throws. If the method throws no exceptions an empty collection is returned.- Specified by:
thrownTypesin interfaceMessageMethod- Returns:
- a collection of throwable types or an empty collection.
-
message
Description copied from interface:MessageMethodTheMessageMethod.Messageto be used for the method.- Specified by:
messagein interfaceMessageMethod- Returns:
- the message.
-
inheritsMessage
public boolean inheritsMessage()Description copied from interface:MessageMethodIndicates 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.- Specified by:
inheritsMessagein interfaceMessageMethod- Returns:
trueif the message was inherited from a different method, otherwisefalse.
-
messageMethodName
Description copied from interface:MessageMethodReturns the name of the method used to retrieve the message.- Specified by:
messageMethodNamein interfaceMessageMethod- Returns:
- the name of the message method.
-
translationKey
Description copied from interface:MessageMethodReturns the name of the key used in the translation files for the message translation.- Specified by:
translationKeyin interfaceMessageMethod- Returns:
- the name of the key in the translation files.
-
hasCause
public boolean hasCause()Description copied from interface:MessageMethodReturnstrueif there is a cause element, otherwisefalse.- Specified by:
hasCausein interfaceMessageMethod- Returns:
trueif there is a cause element, otherwisefalse
-
isOverloaded
public boolean isOverloaded()Description copied from interface:MessageMethodReturnstrueif the method is overloaded, otherwisefalse.- Specified by:
isOverloadedin interfaceMessageMethod- Returns:
trueif the method is overloaded, otherwisefalse
-
cause
Description copied from interface:MessageMethod- Specified by:
causein interfaceMessageMethod- Returns:
- the cause element, otherwise
null.
-
loggerMethod
Description copied from interface:MessageMethodReturns the LogMessage annotation associated with this method only ifMessageMethod.isLoggerMethod()returnstrue.- Specified by:
loggerMethodin interfaceMessageMethod- Returns:
- the log message annotation
-
logLevel
Description copied from interface:MessageMethodReturns the log level parameter associated with the method only ifMessageMethod.isLoggerMethod()returnstrue.- Specified by:
logLevelin interfaceMessageMethod- Returns:
- the enum name of the log level
-
formatParameterCount
public int formatParameterCount()Description copied from interface:MessageMethodReturns the number of parameters minus the cause parameter count for the method.- Specified by:
formatParameterCountin interfaceMessageMethod- Returns:
- the number of parameters minus the cause parameter count for the method.
-
isLoggerMethod
public boolean isLoggerMethod()Description copied from interface:MessageMethodReturnstrueif this is a logger method, otherwisefalse.- Specified by:
isLoggerMethodin interfaceMessageMethod- Returns:
trueif this is a logger method, otherwisefalse.
-
hashCode
public int hashCode() -
getDelegate
Description copied from interface:DelegatingElementThe element to delegate the default methods to.- Specified by:
getDelegatein interfaceDelegatingElement- Specified by:
getDelegatein interfaceDelegatingExecutableElement- Returns:
- the delegate
-
equals
-
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<MessageMethod>
-
getComment
Description copied from interface:JavaDocCommentThe JavaDoc comments if available ornullif there are no JavaDoc's present.- Specified by:
getCommentin interfaceJavaDocComment- Returns:
- the JavaDoc comments or
null.
-