Class MessageMethodBuilder.AptMessageMethod

    • Field Detail

      • elements

        private final javax.lang.model.util.Elements elements
      • parameters

        private final java.util.Map<javax.lang.model.type.TypeMirror,​java.util.Set<Parameter>> parameters
      • thrownTypes

        private final java.util.Set<ThrowableType> thrownTypes
      • method

        private final javax.lang.model.element.ExecutableElement method
      • inheritsMessage

        private boolean inheritsMessage
      • isOverloaded

        private boolean isOverloaded
      • messageMethodName

        private java.lang.String messageMethodName
      • translationKey

        private java.lang.String translationKey
      • formatParameterCount

        private int formatParameterCount
    • Constructor Detail

      • AptMessageMethod

        AptMessageMethod​(javax.lang.model.util.Elements elements,
                         javax.lang.model.element.ExecutableElement method)
        Private constructor for the
        Parameters:
        elements - the elements utility.
        method - the method to describe.
    • Method Detail

      • name

        public java.lang.String name()
        Description copied from interface: MessageMethod
        Returns the method name.
        Specified by:
        name in interface MessageMethod
        Returns:
        the method name.
      • parameters

        public java.util.Set<Parameter> parameters()
        Description copied from interface: MessageMethod
        Returns the parameters for the method.
        Specified by:
        parameters in interface MessageMethod
        Returns:
        the parameters for the method
      • parametersAnnotatedWith

        public java.util.Set<Parameter> parametersAnnotatedWith​(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
        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 interface MessageMethod
        Parameters:
        annotation - the annotation to get the parameters for
        Returns:
        a collection of the parameters or an empty set.
      • returnType

        public ReturnType returnType()
        Description copied from interface: MessageMethod
        Returns the return type for the method.
        Specified by:
        returnType in interface MessageMethod
        Returns:
        the return type for the method.
      • thrownTypes

        public java.util.Set<ThrowableType> 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 interface MessageMethod
        Returns:
        a collection of throwable types or an empty collection.
      • inheritsMessage

        public boolean inheritsMessage()
        Description copied from interface: MessageMethod
        Indicates whether the message was inherited from another message or not. If true is returned the MessageMethod.Message was inherited from a different method, otherwise false.

        Note: false does not indicate the method has a Message annotation.

        Specified by:
        inheritsMessage in interface MessageMethod
        Returns:
        true if the message was inherited from a different method, otherwise false.
      • messageMethodName

        public java.lang.String messageMethodName()
        Description copied from interface: MessageMethod
        Returns the name of the method used to retrieve the message.
        Specified by:
        messageMethodName in interface MessageMethod
        Returns:
        the name of the message method.
      • translationKey

        public java.lang.String 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 interface MessageMethod
        Returns:
        the name of the key in the translation files.
      • hasCause

        public boolean hasCause()
        Description copied from interface: MessageMethod
        Returns true if there is a cause element, otherwise false.
        Specified by:
        hasCause in interface MessageMethod
        Returns:
        true if there is a cause element, otherwise false
      • isOverloaded

        public boolean isOverloaded()
        Description copied from interface: MessageMethod
        Returns true if the method is overloaded, otherwise false .
        Specified by:
        isOverloaded in interface MessageMethod
        Returns:
        true if the method is overloaded, otherwise false
      • 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 interface MessageMethod
        Returns:
        the number of parameters minus the cause parameter count for the method.
      • isLoggerMethod

        public boolean isLoggerMethod()
        Description copied from interface: MessageMethod
        Returns true if this is a logger method, otherwise false.
        Specified by:
        isLoggerMethod in interface MessageMethod
        Returns:
        true if this is a logger method, otherwise false.
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface javax.lang.model.element.Element
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface javax.lang.model.element.Element
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(MessageMethod o)
        Specified by:
        compareTo in interface java.lang.Comparable<MessageMethod>
      • getComment

        public java.lang.String getComment()
        Description copied from interface: JavaDocComment
        The JavaDoc comments if available or null if there are no JavaDoc's present.
        Specified by:
        getComment in interface JavaDocComment
        Returns:
        the JavaDoc comments or null.