Interface NuitonValidatorProvider

    • Method Detail

      • getName

        String getName()
        Obtains the name of the provider.
        Returns:
        the name of the provider.
      • getModel

        <O> NuitonValidatorModel<O> getModel​(Class<O> type,
                                             String context,
                                             NuitonValidatorScope... scopes)
        Obtain a validator model, the model should be cached and not be reinstanciated at each time a validator model is asked.
        Type Parameters:
        O - type of the class to validate
        Parameters:
        type - type of the class to validate
        context - context of validation (null if no context)
        scopes - filtered scope (if nothing given, then use all scopes)
        Returns:
        the cached model of validation
      • newModel

        <O> NuitonValidatorModel<O> newModel​(Class<O> type,
                                             String context,
                                             NuitonValidatorScope... scopes)
        Instanciate a new validator model for the given parameters.
        Type Parameters:
        O - type of the class to validate
        Parameters:
        type - type of the class to validate
        context - context of validation (null if no context)
        scopes - filtered scope (if nothing given, then use all scopes)
        Returns:
        the new instanciated model of validation
      • newValidator

        <O> NuitonValidator<O> newValidator​(NuitonValidatorModel<O> model)
        Obtains a new validator for the given model.
        Type Parameters:
        O - type of class to validate
        Parameters:
        model - the model of validator to use
        Returns:
        the new validator
      • detectValidators

        SortedSet<NuitonValidator<?>> detectValidators​(File sourceRoot,
                                                       Pattern contextFilter,
                                                       NuitonValidatorScope[] scopes,
                                                       Class<?>... types)
        Detects in the given directory validators.
        Parameters:
        sourceRoot - root directory where to seek for validators
        contextFilter - the pattern of context to seek
        scopes - scopes to seek (if none given, will seek for all scopes)
        types - types of class to seek
        Returns:
        the set of validators found