Class AbstractDbValidator
- java.lang.Object
-
- org.alfresco.util.schemacomp.validator.AbstractDbValidator
-
- All Implemented Interfaces:
DbValidator
- Direct Known Subclasses:
NullValidator,SchemaVersionValidator
public abstract class AbstractDbValidator extends java.lang.Object implements DbValidator
Base class providing DbValidator support.- Author:
- Matt Ward
-
-
Constructor Summary
Constructors Constructor Description AbstractDbValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddFieldToValidate(java.lang.String fieldName)java.lang.StringgetProperty(java.lang.String name)Get the current value of a validator property, as set usingDbValidator.setProperty(String, String).java.util.Set<java.lang.String>getPropertyNames()Get the complete set of validator properties in use.protected voidsetFieldsToValidate(java.util.Set<java.lang.String> fieldsToValidate)voidsetProperty(java.lang.String name, java.lang.String value)Set a property used by this validator.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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.alfresco.util.schemacomp.validator.DbValidator
validate
-
-
-
-
Method Detail
-
setProperty
public void setProperty(java.lang.String name, java.lang.String value)Description copied from interface:DbValidatorSet a property used by this validator. Validator properties provided in the schema reference XML files will be set on the validator using this method.- Specified by:
setPropertyin interfaceDbValidator- Parameters:
name- Stringvalue- String
-
getProperty
public java.lang.String getProperty(java.lang.String name)
Description copied from interface:DbValidatorGet the current value of a validator property, as set usingDbValidator.setProperty(String, String).- Specified by:
getPropertyin interfaceDbValidator- Parameters:
name- String- Returns:
- String
-
getPropertyNames
public java.util.Set<java.lang.String> getPropertyNames()
Description copied from interface:DbValidatorGet the complete set of validator properties in use.- Specified by:
getPropertyNamesin interfaceDbValidator
-
validates
public boolean validates(java.lang.String fieldName)
Description copied from interface:DbValidatorAsk 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.- Specified by:
validatesin interfaceDbValidator- Parameters:
fieldName- String- Returns:
- boolean
-
validatesFullObject
public boolean validatesFullObject()
Description copied from interface:DbValidatorAsks 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.- Specified by:
validatesFullObjectin interfaceDbValidator- Returns:
- true if missing or unexpected database objects should not be reported by differencing logic.
-
setFieldsToValidate
protected void setFieldsToValidate(java.util.Set<java.lang.String> fieldsToValidate)
-
addFieldToValidate
protected void addFieldToValidate(java.lang.String fieldName)
-
-