Interface DbValidator
-
- All Known Implementing Classes:
AbstractDbValidator,IgnoreObjectValidator,IndexColumnsValidator,NameValidator,NullValidator,SchemaVersionValidator,TypeNameOnlyValidator
public interface DbValidatorDbObject validators must implement this interface. DbValidator instances are used by the ValidatingVisitor class.- Author:
- Matt Ward
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetProperty(java.lang.String name)Get the current value of a validator property, as set usingsetProperty(String, String).java.util.Set<java.lang.String>getPropertyNames()Get the complete set of validator properties in use.voidsetProperty(java.lang.String name, java.lang.String value)Set a property used by this validator.voidvalidate(DbObject reference, DbObject target, DiffContext ctx)Validate the target database object (against the reference object if necessary).booleanvalidates(java.lang.String fieldName)Ask whether the database object's validator is responsible for validating the specified field name.booleanvalidatesFullObject()Asks whether the database object's validator is responsible for validating the entire DbObject.
-
-
-
Method Detail
-
validate
void validate(DbObject reference, DbObject target, DiffContext ctx)
Validate the target database object (against the reference object if necessary). Store the validation results on the DiffContext.- Parameters:
reference- DbObjecttarget- DbObjectctx- DiffContext
-
setProperty
void setProperty(java.lang.String name, java.lang.String value)Set a property used by this validator. Validator properties provided in the schema reference XML files will be set on the validator using this method.- Parameters:
name- Stringvalue- String
-
getProperty
java.lang.String getProperty(java.lang.String name)
Get the current value of a validator property, as set usingsetProperty(String, String).- Parameters:
name- String- Returns:
- String
-
getPropertyNames
java.util.Set<java.lang.String> getPropertyNames()
Get the complete set of validator properties in use.
-
validates
boolean validates(java.lang.String fieldName)
Ask whether the database object's validator is responsible for validating the specified field name. This only applies to simple properties - not DbObject instances which should provide their own validators.- Parameters:
fieldName- String- Returns:
- boolean
-
validatesFullObject
boolean validatesFullObject()
Asks whether the database object's validator is responsible for validating the entire DbObject. If true, then differences are not reported (e.g. table missing from database) as it is the validator's role to worry about presence. If validation and differences are required then report false - even if the validator works at the full object (rather than property) level.- Returns:
- true if missing or unexpected database objects should not be reported by differencing logic.
-
-