Package org.jboss.logging.processor.apt
Class MessageMethodBuilder
java.lang.Object
org.jboss.logging.processor.apt.MessageMethodBuilder
Date: 29.07.2011
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
An implementation for the MessageMethod interface. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Properties
private static final String
private final List<ExecutableElement>
private final ProcessingEnvironment
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
MessageMethodBuilder
(ProcessingEnvironment processingEnv, Properties expressionProperties) -
Method Summary
Modifier and TypeMethodDescription(package private) MessageMethodBuilder
add
(Collection<ExecutableElement> methods) (package private) Set<MessageMethod>
build()
(package private) static MessageMethodBuilder
create
(ProcessingEnvironment processingEnv) (package private) static MessageMethodBuilder
create
(ProcessingEnvironment processingEnv, Properties expressionProperties) private Collection<ExecutableElement>
findByName
(Collection<ExecutableElement> methods, ExecutableElement method) private Collection<ExecutableElement>
findByName
(Collection<ExecutableElement> methods, Name methodName) Returns a collection of methods with the same name.private MessageMethod.Message
findMessage
(Collection<ExecutableElement> methods, ExecutableElement method) private int
findMessageId
(Collection<ExecutableElement> methods, ExecutableElement method) private boolean
hasMessageId
(Message message) private boolean
inheritsMessage
(Collection<ExecutableElement> methods, ExecutableElement method) Checks to see if the method has or inherits aMessage
annotation.private boolean
isOverloaded
(Collection<ExecutableElement> methods, ExecutableElement method) Checks to see if the method is overloaded.private int
parameterCount
(Collection<? extends VariableElement> params)
-
Field Details
-
MESSAGE_METHOD_SUFFIX
- See Also:
-
methods
-
processingEnv
-
expressionProperties
-
-
Constructor Details
-
MessageMethodBuilder
-
-
Method Details
-
add
-
build
Set<MessageMethod> build() -
findMessage
private MessageMethod.Message findMessage(Collection<ExecutableElement> methods, ExecutableElement method) -
findMessageId
-
hasMessageId
-
findByName
private Collection<ExecutableElement> findByName(Collection<ExecutableElement> methods, ExecutableElement method) -
findByName
private Collection<ExecutableElement> findByName(Collection<ExecutableElement> methods, Name methodName) Returns a collection of methods with the same name.- Parameters:
methods
- the methods to process.methodName
- the method name to findByName.- Returns:
- a collection of methods with the same name.
-
inheritsMessage
Checks to see if the method has or inherits aMessage
annotation.- Parameters:
methods
- the method to search.method
- the method to check.- Returns:
true
if the method has or inherits a message annotation, otherwisefalse
.
-
isOverloaded
Checks to see if the method is overloaded. An overloaded method has a different parameter count based on the format parameters only. Parameters annotated withCause
orParam
are not counted.- Parameters:
methods
- the method to search.method
- the method to check.- Returns:
true
if the method is overloaded, otherwisefalse
.
-
parameterCount
- Parameters:
params
- the parameters to get the count for.- Returns:
- the number of parameters.
-
create
-
create
static MessageMethodBuilder create(ProcessingEnvironment processingEnv, Properties expressionProperties)
-