Class AbstractAnnotationValidator

    • Constructor Detail

      • AbstractAnnotationValidator

        public AbstractAnnotationValidator()
    • Method Detail

      • validateClasses

        protected void validateClasses​(Collection<Class<?>> classSet)
        Validate the correctness of the annotations returned by the getAnnotations() method applied to the classSet.
        Parameters:
        classSet - the classes to validate
      • getAnnotations

        protected abstract List<Class<?>> getAnnotations()
        Gets the annotations that are subject to validate.
        Returns:
        a list of target annotations
      • handleNonRouterLayout

        protected Optional<String> handleNonRouterLayout​(Class<?> clazz)
        Handles the clazz which is not a top level route and not a router layout. Returns an optional message which describes the error having an annotation for the class.
        Parameters:
        clazz - class to validate annotations
        Returns:
        an optional error message or empty if there is no error
      • getErrorHint

        protected String getErrorHint()
        Returns a hint for the discovered validation errors.
        Returns:
        the error hint
      • getClassAnnotations

        protected String getClassAnnotations​(Class<?> clazz)
        Returns the validation annotations declared for the clazz.
        Parameters:
        clazz - the type to get validation annotations
        Returns:
        comma separated list of validation annotation declared for the clazz
      • getClassAnnotations

        public static String getClassAnnotations​(Class<?> clazz,
                                                 List<Class<?>> annotations)
        Returns annotations declared for the clazz.
        Parameters:
        clazz - the type
        annotations - the annotation list
        Returns:
        a comma separated string with the annotation names