Class ValidatorAdapter
java.lang.Object
org.openehealth.ipf.platform.camel.core.adapter.AdapterSupport
org.openehealth.ipf.platform.camel.core.adapter.ProcessorAdapter
org.openehealth.ipf.platform.camel.core.adapter.ValidatorAdapter
Adapts a
Validator
- Author:
- Martin Krasser
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Validators may check whether the Camel message header is set and omit validation when it resolves to false. -
Constructor Summary
ConstructorDescriptionValidatorAdapter
(Validator validator) Creates a newValidatorAdapter
and sets the delegateValidator
. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Delegates validation of input data against a profile to aValidator
object.profile
(Expression profileExpression) Sets the profile expression to validate the input data against.staticProfile
(Object profile) Sets the profile to validate the input data against.static boolean
validationEnabled
(Exchange exchange) Methods inherited from class org.openehealth.ipf.platform.camel.core.adapter.ProcessorAdapter
input, params, process, staticParams
Methods inherited from class org.openehealth.ipf.platform.camel.core.adapter.AdapterSupport
adaptInput, adaptParams, input, params
-
Field Details
-
NEED_VALIDATION_HEADER_NAME
Validators may check whether the Camel message header is set and omit validation when it resolves to false.
-
-
Constructor Details
-
ValidatorAdapter
Creates a newValidatorAdapter
and sets the delegateValidator
.- Parameters:
validator
- a validator.
-
-
Method Details
-
staticProfile
Sets the profile to validate the input data against.- Parameters:
profile
- validation profile.- Returns:
- this object.
-
profile
Sets the profile expression to validate the input data against. Sets anExpression
for obtaining profile data from anExchange
. Profile data are passed to adapted transform-support-library objects.- Parameters:
profileExpression
- validation profile expression.- Returns:
- this object.
-
doProcess
Delegates validation of input data against a profile to aValidator
object.- Specified by:
doProcess
in classProcessorAdapter
- Parameters:
exchange
- message exchange where to write processing results.inputData
- input data.inputParams
- input parameters.
-
validationEnabled
- Parameters:
exchange
- Camel exchange containing the message to be validated.- Returns:
false
if the message headerNEED_VALIDATION_HEADER_NAME
equals toBoolean.FALSE
,true
otherwise.
-