Class DataMappingValidator
java.lang.Object
com.northconcepts.datapipeline.foundations.datamapping.DataMappingValidator
Static checks that data mapping parts use to add
DataMappingProblems to a list.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckNameExists(List<DataMappingProblem> problems, DataMappingPart dataMappingPart, String identifierName, String identifier) Adds a problem, naming the valueidentifierName, ifidentifieris null or empty.static <T> voidcheckUniqueChildNames(List<DataMappingProblem> problems, DataMappingPart dataMappingPart, String childIdentifierName, List<T> children, Function<T, String> nameExtractor) Adds a problem for each non-empty name thatnameExtractorreturns for more than one child.static voidcheckValidCondition(List<DataMappingProblem> problems, DataMappingPart dataMappingPart, String identifierName, LogicalExpression identifier) static voidcheckValidExpression(List<DataMappingProblem> problems, DataMappingPart dataMappingPart, String identifierName, Expression expression) Adds a problem ifexpressionis an unparsable expression kept by lenient parsing, such as when a field mapping is loaded from JSON or XML.
-
Constructor Details
-
DataMappingValidator
public DataMappingValidator()
-
-
Method Details
-
checkNameExists
public static void checkNameExists(List<DataMappingProblem> problems, DataMappingPart dataMappingPart, String identifierName, String identifier) Adds a problem, naming the valueidentifierName, ifidentifieris null or empty. -
checkUniqueChildNames
public static <T> void checkUniqueChildNames(List<DataMappingProblem> problems, DataMappingPart dataMappingPart, String childIdentifierName, List<T> children, Function<T, String> nameExtractor) Adds a problem for each non-empty name thatnameExtractorreturns for more than one child. -
checkValidCondition
public static void checkValidCondition(List<DataMappingProblem> problems, DataMappingPart dataMappingPart, String identifierName, LogicalExpression identifier) -
checkValidExpression
public static void checkValidExpression(List<DataMappingProblem> problems, DataMappingPart dataMappingPart, String identifierName, Expression expression) Adds a problem ifexpressionis an unparsable expression kept by lenient parsing, such as when a field mapping is loaded from JSON or XML.
-