Class ValidateCsv

java.lang.Object
com.adaptris.core.ServiceImp
interlok.csv.schema.ValidateCsv
All Implemented Interfaces:
AdaptrisComponent, ComponentLifecycle, ComponentLifecycleExtension, ConfigComment, MessageEventGenerator, Service, StateManagedComponent

@ComponentProfile(summary="Validate a CSV file against a schema", since="4.4.0", tag="csv,schema") public class ValidateCsv extends ServiceImp
Validate a CSV file against a schema as defined by CSV Schema.
  • Constructor Details

    • ValidateCsv

      public ValidateCsv()
  • Method Details

    • initService

      protected void initService() throws CoreException
      Specified by:
      initService in class ServiceImp
      Throws:
      CoreException
    • closeService

      protected void closeService()
      Specified by:
      closeService in class ServiceImp
    • prepare

      public void prepare() throws CoreException
      Throws:
      CoreException
    • doService

      public void doService(AdaptrisMessage msg) throws ServiceException
      Throws:
      ServiceException
    • withSchema

      public ValidateCsv withSchema(String s)
    • withViolationHandler

      public ValidateCsv withViolationHandler(SchemaViolationHandler handler)
    • getSchemaFile

      public String getSchemaFile()
      The schema.
    • setSchemaFile

      public void setSchemaFile(String schemaFile)
      The schema.
    • getViolationHandler

      public SchemaViolationHandler getViolationHandler()
      What to do when the CSV file is considered invalid.
    • setViolationHandler

      public void setViolationHandler(SchemaViolationHandler violationHandler)
      What to do when the CSV file is considered invalid.
    • getFailFast

      public Boolean getFailFast()
      Whether or not we fail immediately on the first error or report on all errors.

      Using failFast implies that you will fail on the first ErrorMessage, warnings will still be emitted but only up until the first error.

    • setFailFast

      public void setFailFast(Boolean failFast)
      Whether or not we fail immediately on the first error or report on all errors.

      Using failFast implies that you will fail on the first ErrorMessage, warnings will still be emitted but only up until the first error.

    • getCaseSensitive

      public Boolean getCaseSensitive()
      Enable case sensitivity when performing external expression resolution.

      Useful if you are accessing external resources as part of your schema.

    • setCaseSensitive

      public void setCaseSensitive(Boolean caseSensitive)
      Enable case sensitivity when performing external expression resolution.

      Useful if you are accessing external resources as part of your schema.

    • getSubstitutions

      public KeyValuePairSet getSubstitutions()
      The Path substitutions to apply.

      Useful if you are accessing external resources as part of your schema. This ultimately resolves to a list of Substitution objects which is passed into the CsvValidator#validate() method. The 'key' is the from, with the 'value' being the to.

    • setSubstitutions

      public void setSubstitutions(KeyValuePairSet substitutions)
      The Path substitutions to apply.

      Useful if you are accessing external resources as part of your schema. This ultimately resolves to a list of Substitution objects which is passed into the CsvValidator#validate() method. The 'key' is the from, with the 'value' being the to.