Package com.exasol.adapter.properties
Interface PropertyValidator
-
- All Known Implementing Classes:
ConnectionNameProperty,ImportProperty,SupportedPropertiesValidator,ValidatorChain
public interface PropertyValidatorAbstract class for validators for adapter properties
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfacePropertyValidator.PropertyValueValidatorValidator for the value of the current property if the property is set.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static ValidatorChainchain()static PropertyValidatorforStructureElement(SqlDialect.StructureElementSupport availableSupport, String elementName, String propertyName)Create property validator for an optional property specifying a structure element.static PropertyValidatorignoreEmpty(String propertyName, PropertyValidator.PropertyValueValidator valueValidator)Create property validator for an optional property allowing an empty value.static PropertyValidatoroptional(String propertyName, PropertyValidator.PropertyValueValidator valueValidator)Create property validator for an optional property.voidvalidate(com.exasol.adapter.AdapterProperties properties)Validate the property
-
-
-
Method Detail
-
chain
static ValidatorChain chain()
- Returns:
- empty chain of property validators, enabling to add arbitrary property validators and validate a given map of properties by applying all validators subsequently.
-
forStructureElement
static PropertyValidator forStructureElement(SqlDialect.StructureElementSupport availableSupport, String elementName, String propertyName)
Create property validator for an optional property specifying a structure element.- Parameters:
availableSupport- type of support provided by the dialectelementName- name of the structure element to be included in the message of the validation exceptionpropertyName- name of the property- Returns:
- property validator for a property specifying a structure element
-
ignoreEmpty
static PropertyValidator ignoreEmpty(String propertyName, PropertyValidator.PropertyValueValidator valueValidator)
Create property validator for an optional property allowing an empty value.- Parameters:
propertyName- name of the propertyvalueValidator- Validator for the value of the current property if the property is set- Returns:
- property validator for a property ignoring an empty value for this property
-
optional
static PropertyValidator optional(String propertyName, PropertyValidator.PropertyValueValidator valueValidator)
Create property validator for an optional property.- Parameters:
propertyName- name of the propertyvalueValidator- Validator for the value of the current property if the property is set- Returns:
- property validator for an optional property
-
validate
void validate(com.exasol.adapter.AdapterProperties properties) throws PropertyValidationExceptionValidate the property- Parameters:
properties- adapter properties to validate- Throws:
PropertyValidationException- in case validation fails
-
-