JBoss Logging I18n Tools 1.0.0.Beta7

org.jboss.logging.validation.validator
Class MessageAnnotationValidator

java.lang.Object
  extended by org.jboss.logging.validation.validator.MessageAnnotationValidator
All Implemented Interfaces:
ElementValidator

public class MessageAnnotationValidator
extends Object

Checks to make sure that only one Annotations.message() annotation is present on like named methods.

Author:
James R. Perkins

Constructor Summary
MessageAnnotationValidator(Types typeUtil)
           
 
Method Summary
 Collection<ValidationMessage> checkExceptionConstructor(ExecutableElement method)
          Validates the exception constructor.
 Collection<ValidationMessage> checkMessageBundleMethod(TypeElement root, ExecutableElement method)
          Validates a message bundle method.
 Collection<ValidationMessage> validate(TypeElement element, Collection<ExecutableElement> elementMethods)
          Validates the collection of methods that were passed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageAnnotationValidator

public MessageAnnotationValidator(Types typeUtil)
Method Detail

validate

public Collection<ValidationMessage> validate(TypeElement element,
                                              Collection<ExecutableElement> elementMethods)
Validates the collection of methods that were passed.

Parameters:
element - the root element, generally the interface.
elementMethods - the methods of the interface.
Returns:
a collection of messages or a an empty collection if no errors or warnings were found.

checkMessageBundleMethod

public final Collection<ValidationMessage> checkMessageBundleMethod(TypeElement root,
                                                                    ExecutableElement method)
Validates a message bundle method.

Parameters:
root - the interface.
method - the method to validate.
Returns:
a collection of validation messages or an empty collection.

checkExceptionConstructor

public final Collection<ValidationMessage> checkExceptionConstructor(ExecutableElement method)
Validates the exception constructor.

Parameters:
method - the method to validate.
Returns:
a collection of validation messages or an empty collection.

JBoss Logging I18n Tools 1.0.0.Beta7

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.