JBoss Logging I18n Tools 1.0.0.Beta7

org.jboss.logging.validation.validator
Class BundleReturnTypeValidator

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

public class BundleReturnTypeValidator
extends Object

Validates the return types for message bundle methods.

The return type must be either a String or one of it's super types, or Throwable or one of it's subtypes.

Author:
James R. Perkins

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

BundleReturnTypeValidator

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