mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-10771: schema validation and differences rules
Validation serialized and deserialized in XML. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@31942 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -18,12 +18,17 @@
|
||||
*/
|
||||
package org.alfresco.util.schemacomp.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.util.schemacomp.ComparisonUtils;
|
||||
import org.alfresco.util.schemacomp.DbProperty;
|
||||
import org.alfresco.util.schemacomp.DefaultComparisonUtils;
|
||||
import org.alfresco.util.schemacomp.DiffContext;
|
||||
import org.alfresco.util.schemacomp.Result.Strength;
|
||||
import org.alfresco.util.schemacomp.Results;
|
||||
import org.alfresco.util.schemacomp.validator.DbValidator;
|
||||
|
||||
/**
|
||||
* Useful base class for many, if not all the {@link DbObject} implementations.
|
||||
@@ -37,6 +42,7 @@ public abstract class AbstractDbObject implements DbObject
|
||||
/** How differences in the name field should be reported */
|
||||
private Strength nameStrength = Strength.ERROR;
|
||||
protected ComparisonUtils comparisonUtils = new DefaultComparisonUtils();
|
||||
private List<DbValidator<?>> validators = new ArrayList<DbValidator<?>>();
|
||||
|
||||
|
||||
/**
|
||||
@@ -203,4 +209,28 @@ public abstract class AbstractDbObject implements DbObject
|
||||
{
|
||||
this.comparisonUtils = comparisonUtils;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<DbValidator<? extends DbObject>> getValidators()
|
||||
{
|
||||
return validators;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param validators the validators to set
|
||||
*/
|
||||
@Override
|
||||
public void setValidators(List<DbValidator<? extends DbObject>> validators)
|
||||
{
|
||||
if (validators == null)
|
||||
{
|
||||
this.validators = Collections.emptyList();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.validators = validators;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user