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 Parameter
private final Elements
private int
private boolean
private boolean
private MessageMethod.Message
private String
private final ExecutableElement
private final Map
<TypeMirror, Set<Parameter>> private ReturnType
private final Set
<ThrowableType> private String
-
Constructor Summary
ConstructorsConstructorDescriptionAptMessageMethod
(Elements elements, ExecutableElement method) Private constructor for the -
Method Summary
Modifier and TypeMethodDescription(package private) void
cause()
int
boolean
int
Returns the number of parameters minus the cause parameter count for the method.The JavaDoc comments if available ornull
if there are no JavaDoc's present.The element to delegate the default methods to.boolean
hasCause()
Returnstrue
if there is a cause element, otherwisefalse
.int
hashCode()
boolean
Indicates whether the message was inherited from another message or not.boolean
Returnstrue
if this is a logger method, otherwisefalse
.boolean
Returnstrue
if 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.Message
to 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, wait
Methods inherited from interface org.jboss.logging.processor.model.DelegatingElement
accept, getAnnotation, getAnnotationMirrors, getAnnotationsByType, getEnclosedElements, getEnclosingElement, getKind, getModifiers, isAnnotatedWith
Methods 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:MessageMethod
Returns the method name.- Specified by:
name
in interfaceMessageMethod
- Returns:
- the method name.
-
parameters
Description copied from interface:MessageMethod
Returns the parameters for the method.- Specified by:
parameters
in interfaceMessageMethod
- Returns:
- the parameters for the method
-
parametersAnnotatedWith
Description copied from interface:MessageMethod
Returns an unmodifiable collection of the parameters specified by the parameter type or an empty set.- Specified by:
parametersAnnotatedWith
in 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:MessageMethod
Returns the return type for the method.- Specified by:
returnType
in interfaceMessageMethod
- Returns:
- the return type for the method.
-
thrownTypes
Description copied from interface:MessageMethod
Returns a collection of throwable types the method throws. If the method throws no exceptions an empty collection is returned.- Specified by:
thrownTypes
in interfaceMessageMethod
- Returns:
- a collection of throwable types or an empty collection.
-
message
Description copied from interface:MessageMethod
TheMessageMethod.Message
to be used for the method.- Specified by:
message
in interfaceMessageMethod
- Returns:
- the message.
-
inheritsMessage
public boolean inheritsMessage()Description copied from interface:MessageMethod
Indicates whether the message was inherited from another message or not. Iftrue
is returned theMessageMethod.Message
was inherited from a different method, otherwisefalse
. Note:false
does not indicate the method has aMessage
annotation.- Specified by:
inheritsMessage
in interfaceMessageMethod
- Returns:
true
if the message was inherited from a different method, otherwisefalse
.
-
messageMethodName
Description copied from interface:MessageMethod
Returns the name of the method used to retrieve the message.- Specified by:
messageMethodName
in interfaceMessageMethod
- Returns:
- the name of the message method.
-
translationKey
Description copied from interface:MessageMethod
Returns the name of the key used in the translation files for the message translation.- Specified by:
translationKey
in interfaceMessageMethod
- Returns:
- the name of the key in the translation files.
-
hasCause
public boolean hasCause()Description copied from interface:MessageMethod
Returnstrue
if there is a cause element, otherwisefalse
.- Specified by:
hasCause
in interfaceMessageMethod
- Returns:
true
if there is a cause element, otherwisefalse
-
isOverloaded
public boolean isOverloaded()Description copied from interface:MessageMethod
Returnstrue
if the method is overloaded, otherwisefalse
.- Specified by:
isOverloaded
in interfaceMessageMethod
- Returns:
true
if the method is overloaded, otherwisefalse
-
cause
Description copied from interface:MessageMethod
- Specified by:
cause
in interfaceMessageMethod
- Returns:
- the cause element, otherwise
null
.
-
loggerMethod
Description copied from interface:MessageMethod
Returns the LogMessage annotation associated with this method only ifMessageMethod.isLoggerMethod()
returnstrue
.- Specified by:
loggerMethod
in interfaceMessageMethod
- Returns:
- the log message annotation
-
logLevel
Description copied from interface:MessageMethod
Returns the log level parameter associated with the method only ifMessageMethod.isLoggerMethod()
returnstrue
.- Specified by:
logLevel
in interfaceMessageMethod
- Returns:
- the enum name of the log level
-
formatParameterCount
public int formatParameterCount()Description copied from interface:MessageMethod
Returns the number of parameters minus the cause parameter count for the method.- Specified by:
formatParameterCount
in interfaceMessageMethod
- Returns:
- the number of parameters minus the cause parameter count for the method.
-
isLoggerMethod
public boolean isLoggerMethod()Description copied from interface:MessageMethod
Returnstrue
if this is a logger method, otherwisefalse
.- Specified by:
isLoggerMethod
in interfaceMessageMethod
- Returns:
true
if this is a logger method, otherwisefalse
.
-
hashCode
public int hashCode() -
getDelegate
Description copied from interface:DelegatingElement
The element to delegate the default methods to.- Specified by:
getDelegate
in interfaceDelegatingElement
- Specified by:
getDelegate
in interfaceDelegatingExecutableElement
- Returns:
- the delegate
-
equals
-
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<MessageMethod>
-
getComment
Description copied from interface:JavaDocComment
The JavaDoc comments if available ornull
if there are no JavaDoc's present.- Specified by:
getComment
in interfaceJavaDocComment
- Returns:
- the JavaDoc comments or
null
.
-