Class Validator

java.lang.Object
org.jboss.logging.processor.validation.Validator

public final class Validator extends Object
Date: 12.08.2011
  • Field Details

  • Constructor Details

  • Method Details

    • validate

      public final Collection<ValidationMessage> validate(MessageInterface messageInterface)
      Validates the message interface and returns a collection of validation messages or an empty collection.
      Parameters:
      messageInterface - the message interface to validate.
      Returns:
      a collection of validation messages or an empty collection.
    • validateCommon

      private Collection<ValidationMessage> validateCommon(MessageInterface messageInterface, Set<MessageMethod> messageMethods)
      Validate common attributes to all interfaces.
      Parameters:
      messageInterface - the interface.
      messageMethods - the messageMethods to validate.
      Returns:
      a collection of validation messages.
    • validateTransform

      private void validateTransform(List<ValidationMessage> messages, Parameter parameter, Transform transform)
    • validateParameters

      private Collection<ValidationMessage> validateParameters(MessageMethod messageMethod)
    • validateBundle

      private Collection<ValidationMessage> validateBundle(Set<MessageMethod> messageMethods)
      Validate message bundle messageMethods.
      Parameters:
      messageMethods - the messageMethods to validate.
      Returns:
      a collection of the validation messages.
    • validateBundleMethod

      private Collection<ValidationMessage> validateBundleMethod(MessageMethod messageMethod)
    • validateLogger

      private Collection<ValidationMessage> validateLogger(Set<MessageMethod> messageMethods)
      Validate message logger messageMethods.
      Parameters:
      messageMethods - the messageMethods to validate.
      Returns:
      a collection of the validation messages.
    • validateLoggerMethod

      private Collection<ValidationMessage> validateLoggerMethod(MessageMethod messageMethod)
    • getAllMethods

      private Set<MessageMethod> getAllMethods(MessageInterface messageInterface)
      Finds all methods for the given interface, but ignores logger interface methods.
      Parameters:
      messageInterface - the interface to find all methods for.
      Returns:
      a set of all the methods (exception logger interface methods) the interface must implement.
    • isTypeAssignableFrom

      private boolean isTypeAssignableFrom(Element element, Class<?> type)
      Checks the element type, if an array the type of the array is checked, against the class. If the element type is assignable to the class type.
      Parameters:
      element - the element to test
      type - the type the element needs to be assignable to
      Returns:
      true if the element type is assignable to the class type, otherwise false
    • isTypeAssignableFrom

      private boolean isTypeAssignableFrom(TypeMirror typeMirror, Class<?> type)
      Checks the type, if an array the type of the array is checked, against the class. If the element type is assignable to the class type.
      Parameters:
      typeMirror - the type to test
      type - the type the element needs to be assignable to
      Returns:
      true if the element type is assignable to the class type, otherwise false
    • isTypeAssignableFrom

      private boolean isTypeAssignableFrom(TypeMirror typeMirror, TypeMirror type)
      Checks the type, if an array the type of the array is checked, against the class. If the element type is assignable to the class type.
      Parameters:
      typeMirror - the type to test
      type - the type the element needs to be assignable to
      Returns:
      true if the element type is assignable to the class type, otherwise false