Package com.consol.citrus.validation
Class DefaultMessageValidator
- java.lang.Object
-
- com.consol.citrus.validation.AbstractMessageValidator<ValidationContext>
-
- com.consol.citrus.validation.DefaultMessageValidator
-
- All Implemented Interfaces:
MessageValidator<ValidationContext>
- Direct Known Subclasses:
DefaultEmptyMessageValidator
public class DefaultMessageValidator extends AbstractMessageValidator<ValidationContext>
Basic control message validator for all message types. Subclasses only have to add specific logic for message payload validation. This validator is based on a control message.- Author:
- Christoph Deppisch
-
-
Field Summary
-
Fields inherited from class com.consol.citrus.validation.AbstractMessageValidator
log
-
Fields inherited from interface com.consol.citrus.validation.MessageValidator
LOG, RESOURCE_PATH, TYPE_RESOLVER
-
-
Constructor Summary
Constructors Constructor Description DefaultMessageValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Class<ValidationContext>getRequiredValidationContextType()Provides class type of most appropriate validation context.booleansupportsMessageType(String messageType, Message message)Checks if this message validator is capable of this message type.-
Methods inherited from class com.consol.citrus.validation.AbstractMessageValidator
findValidationContext, validateMessage, validateMessage
-
-
-
-
Method Detail
-
supportsMessageType
public boolean supportsMessageType(String messageType, Message message)
Description copied from interface:MessageValidatorChecks if this message validator is capable of this message type. XML message validators may only apply to this message type while JSON message validator implementations do not and vice versa. This check is called by theMessageValidatorRegistryin order to find a proper message validator for a message.- Parameters:
messageType- the message type representation as String (e.g. xml, json, csv, plaintext).message- the message object- Returns:
- true if this message validator is capable of validating the message type.
-
getRequiredValidationContextType
protected Class<ValidationContext> getRequiredValidationContextType()
Description copied from class:AbstractMessageValidatorProvides class type of most appropriate validation context.- Specified by:
getRequiredValidationContextTypein classAbstractMessageValidator<ValidationContext>- Returns:
-
-