Class QInstanceValidator
java.lang.Object
com.kingsrook.qqq.backend.core.instances.QInstanceValidator
Class that knows how to take a look at the data in a QInstance, and report
if it is all valid - e.g., non-null things are set; references line-up (e.g.,
a table's backend must be a defined backend).
Prior to doing validation, the the QInstanceEnricher is ran over the QInstance,
e.g., to fill in things that can be defaulted or assumed. TODO let the instance
customize or opt-out of Enrichment.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
boolean
assertCondition
(boolean condition, String message) For the given input condition, if it's true, then we're all good (and return true).boolean
assertNoException
(UnsafeLambda unsafeLambda, String message) For the given lambda, if it doesn't throw an exception, then we're all good (and return true).Getter for errorsstatic void
void
revalidate
(QInstance qInstance) void
void
validateQueryFilter
(QInstance qInstance, String context, QTableMetaData table, QQueryFilter queryFilter, List<QueryJoin> queryJoins) void
-
Constructor Details
-
QInstanceValidator
public QInstanceValidator()
-
-
Method Details
-
validate
- Throws:
QInstanceValidationException
-
revalidate
- Throws:
QInstanceValidationException
-
addValidatorPlugin
-
removeAllValidatorPlugins
public static void removeAllValidatorPlugins() -
validateQueryFilter
public void validateQueryFilter(QInstance qInstance, String context, QTableMetaData table, QQueryFilter queryFilter, List<QueryJoin> queryJoins) -
assertCondition
For the given input condition, if it's true, then we're all good (and return true). But if it's false, add the provided message to the list of errors (and return false, e.g., in case you need to stop evaluating rules to avoid exceptions). -
assertNoException
For the given lambda, if it doesn't throw an exception, then we're all good (and return true). But if it throws, add the provided message to the list of errors (and return false, e.g., in case you need to stop evaluating rules to avoid exceptions). -
warn
-
getErrors
-