Class NameValidator
java.lang.Object
org.alfresco.util.schemacomp.validator.NameValidator
- All Implemented Interfaces:
DbValidator
- Direct Known Subclasses:
IndexColumnsValidator,TypeNameOnlyValidator
Validates the name of a DbObject using a regular expression. A regular expression can be supplied for each supported
database dialect. In addition to dialect specific regular expressions, a default may be supplied - comparisons will fall back to the default if no specific dialect is matched.- Author:
- Matt Ward
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetProperty(String name) Get the current value of a validator property, as set usingDbValidator.setProperty(String, String).Get the complete set of validator properties in use.voidsetPattern(Pattern pattern) voidsetProperty(String name, 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).booleanAsk whether the database object's validator is responsible for validating the specified field name.booleanAsks whether the database object's validator is responsible for validating the entire DbObject.
-
Constructor Details
-
NameValidator
public NameValidator()
-
-
Method Details
-
validate
Description copied from interface:DbValidatorValidate the target database object (against the reference object if necessary). Store the validation results on the DiffContext.- Specified by:
validatein interfaceDbValidator- Parameters:
reference- DbObjecttarget- DbObjectctx- DiffContext
-
setPattern
-
getPattern
-
setProperty
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
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
Description copied from interface:DbValidatorGet the complete set of validator properties in use.- Specified by:
getPropertyNamesin interfaceDbValidator
-
validates
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.
-