Class Validator.Builder

java.lang.Object
org.apache.uima.fit.validation.Validator.Builder
Enclosing class:
Validator

public static class Validator.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • withCheck

      public Validator.Builder withCheck(CasValidationCheck check)
      Add the given check instance to the validator. This allows even adding checks which are not available via the Java Service Locator, which take parameters or which are otherwise stateful (assuming that the resulting validator is not shared between threads).

      Note: Includes/excludes do also apply do checks added via this method.

      Parameters:
      check - a check instance to use.
    • withoutAutoDetectedChecks

      public Validator.Builder withoutAutoDetectedChecks()
      Disable auto-detection of checks.
    • withAutoDetectedChecks

      public Validator.Builder withAutoDetectedChecks()
      Enable auto-detection of checks (the default behavior).
    • excludingByName

      public Validator.Builder excludingByName(String... className)
      Skip any checks with the given names. Subtypes of the given classes are not skipped.

      Note: Excludes are applied after includes.

      Parameters:
      className - names of check classes to be excluded.
    • excludingByPattern

      public Validator.Builder excludingByPattern(String... patterns)
      Skip any checks with names matching the given regular expressions.

      Note: Excludes are applied after includes.

      Parameters:
      patterns - regular expressions matching check class names to be excluded.
    • excludingByType

      public Validator.Builder excludingByType(Class<?>... types)
      Skips any checks of the given types (includes checks that are subclasses or implementations of the given types).

      Note: Excludes are applied after includes.

      Parameters:
      types - check type names to be excluded.
    • includingByName

      public Validator.Builder includingByName(String... className)
      Retain only checks with the given names. Subtypes of the given classes are not retained.

      Note: Excludes are applied after includes.

      Parameters:
      className - names of check classes to be included.
    • includingByPattern

      public Validator.Builder includingByPattern(String... patterns)
      Retain any checks with names matching the given regular expressions.

      Note: Excludes are applied after includes.

      Parameters:
      patterns - regular expressions matching check class names to be included.
    • includingByType

      public Validator.Builder includingByType(Class<?>... types)
      Retain any checks of the given types (includes checks that are subclasses or implementations of the given types).

      Note: Excludes are applied after includes.

      Parameters:
      types - check type names to be included.
    • build

      public Validator build()