public final class ValidationContextUtils extends Object
ValidationContextUtils handles some tools related to the validation context.| Modifier and Type | Field | Description |
|---|---|---|
static org.slf4j.Logger |
LOGGER |
The Logger of the class
ValidationContextUtils. |
| Modifier and Type | Method | Description |
|---|---|---|
static void |
addError(eu.europa.ec.taxud.validation.ValidationContext context,
ErrorCode errorCode,
String docRefId,
Element element) |
Adds an error to the validation context.
|
static boolean |
addErrorBasedOnExclRules(eu.europa.ec.taxud.validation.ValidationContext context,
ErrorCode errorCode) |
Add error based on excl rules boolean.
|
static void |
addErrorWithoutRefId(eu.europa.ec.taxud.validation.ValidationContext context,
ErrorCode errorCode) |
Add error without ref id.
|
static void |
addErrorWithoutRefId(eu.europa.ec.taxud.validation.ValidationContext context,
ErrorCode errorCode,
Element element) |
* Adds an error to the validation context without specifying a docRefId.
|
static boolean |
containsErrorCode(eu.europa.ec.taxud.validation.ValidationContext validationContext,
ErrorCode errorCode) |
Checks if the context already contains an error with is related to the error code.
|
static Boolean |
getDoubleParsingProperty(eu.europa.ec.taxud.validation.ValidationContext context) |
Provides the value of the double parsing property from the context.
|
static String |
getValueBasedOnValidationMode(String testValue,
String prodValue,
eu.europa.ec.taxud.validation.ValidationContext context) |
Gets the related value based on the validation mode.
|
static void |
handleValidationDomain(eu.europa.ec.taxud.validation.ValidationContext context,
String domainParameter) |
Handle validation domain.
|
static void |
handleValidationMode(eu.europa.ec.taxud.validation.ValidationContext context,
String modeParameter) |
Handles the given validation mode parameter.
|
static boolean |
isRelatedError(eu.europa.ec.taxud.validation.ValidationError validationError,
ErrorCode errorCode) |
Checks if a validation error is related to the error code.
|
static void |
logMessageSpecs(String messageTypeIndic,
String messageRefId,
String transmittingCountry,
String receivingCountry) |
Helper method called by the drool rules to log information found while validating. it is used to log the
messageSpec specific information.
|
static void |
main(String[] args) |
The entry point of application.
|
public static final org.slf4j.Logger LOGGER
ValidationContextUtils.public static void main(String[] args) throws IOException, InterruptedException
args - the input argumentsIOException - the io exceptionInterruptedException - the interrupted exceptionpublic static void addError(eu.europa.ec.taxud.validation.ValidationContext context,
ErrorCode errorCode,
String docRefId,
Element element)
context - the validation context holding the errors.errorCode - the code of the error.docRefId - the docRefId of the group of elements that has the error.element - the specific element that has the error.public static void addErrorWithoutRefId(eu.europa.ec.taxud.validation.ValidationContext context,
ErrorCode errorCode,
Element element)
context - the validation context holding the errors.errorCode - the code of the error.element - the specific element that has the error.public static void addErrorWithoutRefId(eu.europa.ec.taxud.validation.ValidationContext context,
ErrorCode errorCode)
context - the contexterrorCode - the error codepublic static void logMessageSpecs(String messageTypeIndic, String messageRefId, String transmittingCountry, String receivingCountry)
messageTypeIndic - the messageTypeIndic.messageRefId - the messageRefId.transmittingCountry - the transmittingCountry.receivingCountry - the receivingCountry.public static boolean containsErrorCode(eu.europa.ec.taxud.validation.ValidationContext validationContext,
ErrorCode errorCode)
validationContext - The validation context.errorCode - The error code.true if at least one validation error matches to the error code. Otherwise, returns false.public static boolean isRelatedError(eu.europa.ec.taxud.validation.ValidationError validationError,
ErrorCode errorCode)
validationError - The validation error.errorCode - The error code.true if the error code matches to the validation error. Otherwise, returns false.public static Boolean getDoubleParsingProperty(eu.europa.ec.taxud.validation.ValidationContext context) throws ClassCastException
context - The validation context.null.ClassCastException - the class cast exceptionpublic static void handleValidationMode(eu.europa.ec.taxud.validation.ValidationContext context,
String modeParameter)
context - The validation context.modeParameter - The mode parameter value.public static void handleValidationDomain(eu.europa.ec.taxud.validation.ValidationContext context,
String domainParameter)
context - the contextdomainParameter - the domain parameterpublic static String getValueBasedOnValidationMode(String testValue, String prodValue, eu.europa.ec.taxud.validation.ValidationContext context)
testValue - The value in case of test validation mode.prodValue - The value in case of production validation mode.context - The validation context.public static boolean addErrorBasedOnExclRules(eu.europa.ec.taxud.validation.ValidationContext context,
ErrorCode errorCode)
context - the contexterrorCode - the error codeCopyright © 2025. All rights reserved.