Package org.apache.camel.model.validator
Class ValidatorDefinition
- java.lang.Object
-
- org.apache.camel.model.validator.ValidatorDefinition
-
- Direct Known Subclasses:
CustomValidatorDefinition
,EndpointValidatorDefinition
,PredicateValidatorDefinition
@Metadata(label="validation") public abstract class ValidatorDefinition extends Object
Represents a
Validator
which declaratively validates message content according to the input type declared byInputTypeDefinition
and/or output type declared byOutputTypeDefinition
.If you specify type='xml:ABC', the validator will be picked up when current message type is 'xml:ABC'. If you specify type='json', then it will be picked up for all of json validation. {@see Validator} {@see InputTypeDefinition} {@see OutputTypeDefinition}
-
-
Constructor Summary
Constructors Constructor Description ValidatorDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getType()
void
setType(Class<?> clazz)
Set the data type using Java class.void
setType(String type)
Set the data type name.
-
-
-
Method Detail
-
getType
public String getType()
-
setType
public void setType(String type)
Set the data type name. If you specify 'xml:XYZ', the validator will be picked up if message type is 'xml:XYZ'. If you specify just 'xml', the validator matches with all of 'xml' message type like 'xml:ABC' or 'xml:DEF'.
-
setType
public void setType(Class<?> clazz)
Set the data type using Java class.
-
-