public class ValidatorAdapter extends ProcessorAdapter
Validator
Modifier and Type | Field and Description |
---|---|
static String |
NEED_VALIDATION_HEADER_NAME
Validators may check whether the Camel message header is set
and omit validation when it resolves to false.
|
Constructor and Description |
---|
ValidatorAdapter(Validator validator)
Creates a new
ValidatorAdapter and sets the delegate
Validator . |
Modifier and Type | Method and Description |
---|---|
protected void |
doProcess(org.apache.camel.Exchange exchange,
Object inputData,
Object... inputParams)
Delegates validation of input data against a profile to a
Validator object. |
ValidatorAdapter |
profile(org.apache.camel.Expression profileExpression)
Sets the profile expression to validate the input data against.
|
ValidatorAdapter |
profile(Object profile)
Deprecated.
|
ValidatorAdapter |
staticProfile(Object profile)
Sets the profile to validate the input data against.
|
static boolean |
validationEnabled(org.apache.camel.Exchange exchange) |
input, params, process, staticParams
adaptInput, adaptParams, input, params
public static final String NEED_VALIDATION_HEADER_NAME
public ValidatorAdapter(Validator validator)
ValidatorAdapter
and sets the delegate
Validator
.validator
- a validator.public ValidatorAdapter staticProfile(Object profile)
profile
- validation profile.@Deprecated public ValidatorAdapter profile(Object profile)
profile
- validation profile.public ValidatorAdapter profile(org.apache.camel.Expression profileExpression)
Expression
for obtaining profile data from an
Exchange
. Profile data are passed to adapted
transform-support-library objects.profileExpression
- validation profile expression.protected void doProcess(org.apache.camel.Exchange exchange, Object inputData, Object... inputParams) throws IOException
Validator
object.doProcess
in class ProcessorAdapter
exchange
- message exchange where to write processing results.inputData
- input data.inputParams
- input parameters.IOException
- if a general processing error occurs.public static boolean validationEnabled(org.apache.camel.Exchange exchange)
exchange
- Camel exchange containing the message to be validated.false
if the message header NEED_VALIDATION_HEADER_NAME
equals to Boolean.FALSE
, true
otherwise.Copyright © 2018 Open eHealth Foundation. All rights reserved.