private static class MessageMethodBuilder.AptMessageMethod extends java.lang.Object implements MessageMethod
MessageMethod.Message| Modifier and Type | Field and Description |
|---|---|
private Parameter |
cause |
private javax.lang.model.util.Elements |
elements |
private boolean |
inheritsMessage |
private boolean |
isOverloaded |
private MessageMethod.Message |
message |
private java.lang.String |
messageMethodName |
private javax.lang.model.element.ExecutableElement |
method |
private java.util.Map<Parameter.ParameterType,java.util.Set<Parameter>> |
parameters |
private ReturnType |
returnType |
private java.util.Set<ThrowableType> |
thrownTypes |
private java.lang.String |
translationKey |
| Constructor and Description |
|---|
AptMessageMethod(javax.lang.model.util.Elements elements,
javax.lang.model.element.ExecutableElement method)
Private constructor for the
|
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
add(Parameter parameter) |
Parameter |
cause()
|
int |
compareTo(MessageMethod o) |
boolean |
equals(java.lang.Object obj) |
int |
formatParameterCount()
Returns the number of parameters minus the cause parameter count for the method.
|
java.lang.String |
getComment()
The JavaDoc comments if available or
null if there are no JavaDoc's present. |
boolean |
hasCause()
Returns
true if there is a cause element, otherwise false. |
int |
hashCode() |
boolean |
inheritsMessage()
Indicates whether the message was inherited from another message or not.
|
boolean |
isLoggerMethod()
Returns
true if this is a logger method, otherwise false. |
boolean |
isOverloaded()
Returns
true if the method is overloaded, otherwise false
. |
java.lang.String |
loggerMethod()
Returns the LogMessage annotation associated with this method only if
MessageMethod.isLoggerMethod() returns
true. |
java.lang.String |
logLevel()
Returns the log level parameter associated with the method only if
MessageMethod.isLoggerMethod() returns
true. |
MessageMethod.Message |
message()
The
MessageMethod.Message to be used for the method. |
java.lang.String |
messageMethodName()
Returns the name of the method used to retrieve the message.
|
java.lang.String |
name()
Returns the method name.
|
java.util.Set<Parameter> |
parameters(Parameter.ParameterType parameterType)
Returns an unmodifiable collection of the parameters specified by the parameter type or an empty set.
|
java.util.Set<Parameter> |
parameters(Parameter.ParameterType parameterType,
Parameter.ParameterType... parameterTypes)
Returns an unmodifiable collection of the parameters specified by the parameter type or an empty set.
|
javax.lang.model.element.ExecutableElement |
reference()
The object used to extract information for the message logger or message bundle, if applicable.
|
ReturnType |
returnType()
Returns the return type for the method.
|
java.util.Set<ThrowableType> |
thrownTypes()
Returns a collection of throwable types the method throws.
|
java.lang.String |
toString() |
java.lang.String |
translationKey()
Returns the name of the key used in the translation files for the message translation.
|
private final javax.lang.model.util.Elements elements
private final java.util.Map<Parameter.ParameterType,java.util.Set<Parameter>> parameters
private final java.util.Set<ThrowableType> thrownTypes
private final javax.lang.model.element.ExecutableElement method
private ReturnType returnType
private Parameter cause
private boolean inheritsMessage
private boolean isOverloaded
private MessageMethod.Message message
private java.lang.String messageMethodName
private java.lang.String translationKey
AptMessageMethod(javax.lang.model.util.Elements elements,
javax.lang.model.element.ExecutableElement method)
elements - the elements utility.method - the method to describe.void add(Parameter parameter)
public java.lang.String name()
MessageMethodname in interface MessageMethodname in interface MessageObjectpublic java.util.Set<Parameter> parameters(Parameter.ParameterType parameterType)
MessageMethodparameters in interface MessageMethodparameterType - the parameter type to look-up the parameters for.public java.util.Set<Parameter> parameters(Parameter.ParameterType parameterType, Parameter.ParameterType... parameterTypes)
MessageMethodparameters in interface MessageMethodparameterType - the parameter type to look-up the parameters for.parameterTypes - an array of types to look-up parameters for.public ReturnType returnType()
MessageMethodreturnType in interface MessageMethodpublic java.util.Set<ThrowableType> thrownTypes()
MessageMethodthrownTypes in interface MessageMethodpublic MessageMethod.Message message()
MessageMethodMessageMethod.Message to be used for the method.message in interface MessageMethodpublic boolean inheritsMessage()
MessageMethodtrue is returned the
MessageMethod.Message was inherited from a different method, otherwise false.
Note: false does not indicate the method has a Message
annotation.inheritsMessage in interface MessageMethodtrue if the message was inherited from a different method, otherwise false.public java.lang.String messageMethodName()
MessageMethodmessageMethodName in interface MessageMethodpublic java.lang.String translationKey()
MessageMethodtranslationKey in interface MessageMethodpublic boolean hasCause()
MessageMethodtrue if there is a cause element, otherwise false.hasCause in interface MessageMethodtrue if there is a cause element, otherwise falsepublic boolean isOverloaded()
MessageMethodtrue if the method is overloaded, otherwise false
.isOverloaded in interface MessageMethodtrue if the method is overloaded, otherwise falsepublic Parameter cause()
MessageMethodcause in interface MessageMethodnull.public java.lang.String loggerMethod()
MessageMethodMessageMethod.isLoggerMethod() returns
true.loggerMethod in interface MessageMethodpublic java.lang.String logLevel()
MessageMethodMessageMethod.isLoggerMethod() returns
true.logLevel in interface MessageMethodpublic int formatParameterCount()
MessageMethodformatParameterCount in interface MessageMethodpublic boolean isLoggerMethod()
MessageMethodtrue if this is a logger method, otherwise false.isLoggerMethod in interface MessageMethodtrue if this is a logger method, otherwise false.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic javax.lang.model.element.ExecutableElement reference()
MessageObjectExecutableElement
might be returned.reference in interface MessageMethodreference in interface MessageObjectpublic int compareTo(MessageMethod o)
compareTo in interface java.lang.Comparable<MessageMethod>public java.lang.String getComment()
JavaDocCommentnull if there are no JavaDoc's present.getComment in interface JavaDocCommentnull.