JBoss Logging I18n Tools 1.0.0.Beta7

org.jboss.logging.validation.validator
Class MethodParameterValidator

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

public class MethodParameterValidator
extends Object

Validates the parameters of a method.

Multiple methods with the same name are permitted, as long as they meet all of the following criteria:

Author:
James R. Perkins

Constructor Summary
MethodParameterValidator(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

MethodParameterValidator

public MethodParameterValidator(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.