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 classprivate static classAn implementation for the MessageMethod interface. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Propertiesprivate static final Stringprivate final List<ExecutableElement> private final ProcessingEnvironment -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateMessageMethodBuilder(ProcessingEnvironment processingEnv, Properties expressionProperties) -
Method Summary
Modifier and TypeMethodDescription(package private) MessageMethodBuilderadd(Collection<ExecutableElement> methods) (package private) Set<MessageMethod> build()(package private) static MessageMethodBuildercreate(ProcessingEnvironment processingEnv) (package private) static MessageMethodBuildercreate(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.MessagefindMessage(Collection<ExecutableElement> methods, ExecutableElement method) private intfindMessageId(Collection<ExecutableElement> methods, ExecutableElement method) private booleanhasMessageId(Message message) private booleaninheritsMessage(Collection<ExecutableElement> methods, ExecutableElement method) Checks to see if the method has or inherits aMessageannotation.private booleanisOverloaded(Collection<ExecutableElement> methods, ExecutableElement method) Checks to see if the method is overloaded.private intparameterCount(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 aMessageannotation.- Parameters:
methods- the method to search.method- the method to check.- Returns:
trueif 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 withCauseorParamare not counted.- Parameters:
methods- the method to search.method- the method to check.- Returns:
trueif 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)
-