Package de.xima.fc.formstore
Class StoreFormMetaValidator
- java.lang.Object
-
- de.xima.fc.formstore.StoreFormMetaValidator
-
public final class StoreFormMetaValidator extends Object
Validates themetadata.json
data contained in a form store file.- Since:
- 7.1.0
- Author:
- XIMA MEDIA GmbH
-
-
Constructor Summary
Constructors Constructor Description StoreFormMetaValidator(Mandant client)
Creates a new validator for the form store meta contained in a form store file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValidatedFormStoreFile
readFormStoreFileAndValidate(byte[] formStoreFile)
ValidatedFormStoreFile
readFormStoreFileAndValidate(InputStream formStoreFile)
StoreFormMetaValidationResult
validate(StoreFormMeta meta)
org.apache.commons.lang3.tuple.Pair<StoreFormMeta,StoreFormMetaValidationResult>
validate(String meta)
-
-
-
Constructor Detail
-
StoreFormMetaValidator
public StoreFormMetaValidator(Mandant client)
Creates a new validator for the form store meta contained in a form store file.- Parameters:
client
- The client scope where the form should be imported.
-
-
Method Detail
-
readFormStoreFileAndValidate
public ValidatedFormStoreFile readFormStoreFileAndValidate(byte[] formStoreFile) throws StoreFormMetaValidationException
- Parameters:
formStoreFile
- Form store file (*.xfs) to validate.- Returns:
- All validation violations that were found.
- Throws:
StoreFormMetaValidationException
- When the validation could not be performed due to an unexpected error.
-
readFormStoreFileAndValidate
public ValidatedFormStoreFile readFormStoreFileAndValidate(InputStream formStoreFile) throws StoreFormMetaValidationException
- Parameters:
formStoreFile
- Form store file (*.xfs) to validate.- Returns:
- All validation violations that were found.
- Throws:
StoreFormMetaValidationException
- When the validation could not be performed due to an unexpected error.
-
validate
public StoreFormMetaValidationResult validate(StoreFormMeta meta) throws StoreFormMetaValidationException
- Parameters:
meta
- Form store meta to validate.- Returns:
- All validation violations that were found.
- Throws:
StoreFormMetaValidationException
- When the validation could not be performed due to an unexpected error.
-
validate
public org.apache.commons.lang3.tuple.Pair<StoreFormMeta,StoreFormMetaValidationResult> validate(String meta) throws StoreFormMetaValidationException
- Parameters:
meta
- Form store meta JSON to validate.- Returns:
- All validation violations that were found.
- Throws:
StoreFormMetaValidationException
- When the validation could not be performed due to an unexpected error.
-
-