Class ValidateCsv
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- interlok.csv.schema.ValidateCsv
-
- All Implemented Interfaces:
AdaptrisComponent,ComponentLifecycle,ComponentLifecycleExtension,MessageEventGenerator,Service,StateManagedComponent
@ComponentProfile(summary="Validate a CSV file against a schema", since="4.4.0", tag="csv,schema") public class ValidateCsv extends ServiceImpValidate a CSV file against a schema as defined by CSV Schema.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.ServiceImp
log
-
-
Constructor Summary
Constructors Constructor Description ValidateCsv()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcloseService()voiddoService(AdaptrisMessage msg)java.lang.BooleangetCaseSensitive()Enable case sensitivity when performing external expression resolution.java.lang.BooleangetFailFast()Whether or not we fail immediately on the first error or report on all errors.java.lang.StringgetSchemaFile()The schema.KeyValuePairSetgetSubstitutions()The Path substitutions to apply.SchemaViolationHandlergetViolationHandler()What to do when the CSV file is considered invalid.protected voidinitService()voidprepare()voidsetCaseSensitive(java.lang.Boolean caseSensitive)Enable case sensitivity when performing external expression resolution.voidsetFailFast(java.lang.Boolean failFast)Whether or not we fail immediately on the first error or report on all errors.voidsetSchemaFile(java.lang.String schemaFile)The schema.voidsetSubstitutions(KeyValuePairSet substitutions)The Path substitutions to apply.voidsetViolationHandler(SchemaViolationHandler violationHandler)What to do when the CSV file is considered invalid.ValidateCsvwithSchema(java.lang.String s)ValidateCsvwithViolationHandler(SchemaViolationHandler handler)-
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId, start, stop
-
-
-
-
Method Detail
-
initService
protected void initService() throws CoreException- Specified by:
initServicein classServiceImp- Throws:
CoreException
-
closeService
protected void closeService()
- Specified by:
closeServicein classServiceImp
-
prepare
public void prepare() throws CoreException- Throws:
CoreException
-
doService
public void doService(AdaptrisMessage msg) throws ServiceException
- Throws:
ServiceException
-
withSchema
public ValidateCsv withSchema(java.lang.String s)
-
withViolationHandler
public ValidateCsv withViolationHandler(SchemaViolationHandler handler)
-
getSchemaFile
public java.lang.String getSchemaFile()
The schema.
-
setSchemaFile
public void setSchemaFile(java.lang.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 java.lang.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(java.lang.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 java.lang.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(java.lang.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
Substitutionobjects which is passed into theCsvValidator#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
Substitutionobjects which is passed into theCsvValidator#validate()method. The 'key' is the from, with the 'value' being the to.
-
-