Class ChoiceValidation
java.lang.Object
org.openehealth.ipf.commons.ihe.xds.core.validate.query.ChoiceValidation
- All Implemented Interfaces:
QueryParameterValidation
Query parameter validation to ensure that only one of the given parameters is specified.
Also has the "either ... or ... " check to avoid the case that all parameters haven't a
value set if it's not marked as optional.
- Author:
- Jens Riemschneider
-
Constructor Summary
ConstructorDescriptionChoiceValidation
(boolean optional, QueryParameter... params) Constructs a validation object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
validate
(EbXMLAdhocQueryRequest<AdhocQueryRequest> request) Validates a query parameter.
-
Constructor Details
-
ChoiceValidation
Constructs a validation object.- Parameters:
params
- parameters to validate.optional
- whether all parameters are optional (true
) or one parameter must be specified (false
).
-
-
Method Details
-
validate
Description copied from interface:QueryParameterValidation
Validates a query parameter.- Specified by:
validate
in interfaceQueryParameterValidation
- Parameters:
request
- the query request.- Throws:
XDSMetaDataException
- if the validation failed.
-