cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r911831 - in /cayenne/main/trunk/framework: cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/ cayen...
Date Fri, 19 Feb 2010 15:00:51 GMT
Author: oltka
Date: Fri Feb 19 15:00:50 2010
New Revision: 911831

URL: http://svn.apache.org/viewvc?rev=911831&view=rev
Log:
CAY-1339 Remove org.apache.cayenne.project package from runtime

Added:
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ConfigurationValidator.java
      - copied, changed from r911815, cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ConfigurationValidationVisitor.java
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DefaultValidator.java
      - copied, changed from r911815, cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataChannelValidator.java
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/Validator.java
      - copied, changed from r911815, cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataChannelValidator.java
Removed:
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ConfigurationValidationVisitor.java
Modified:
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerController.java
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/SaveAsAction.java
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ValidateAction.java
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/TableSelectorController.java
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/ValidatorDialog.java
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/CayenneProjectModule.java
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataChannelValidator.java
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataMapValidator.java
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataNodeValidator.java
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DbAttributeValidator.java
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DbEntityValidator.java
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DbRelationshipValidator.java
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/EJBQLQueryValidator.java
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/EmbeddableAttributeValidator.java
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/EmbeddableValidator.java
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ObjAttributeValidator.java
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ObjEntityValidator.java
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ObjRelationshipValidator.java
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ProcedureParameterValidator.java
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ProcedureQueryValidator.java
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ProcedureValidator.java
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/SQLTemplateValidator.java
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/SelectQueryValidator.java

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerController.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerController.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerController.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/CayenneModelerController.java Fri Feb 19 15:00:50 2010
@@ -45,7 +45,7 @@
 import org.apache.cayenne.modeler.pref.FSPath;
 import org.apache.cayenne.modeler.util.CayenneController;
 import org.apache.cayenne.project2.Project;
-import org.apache.cayenne.project2.validate.ConfigurationValidationVisitor;
+import org.apache.cayenne.project2.validate.DefaultValidator;
 import org.apache.cayenne.project2.validate.ValidationInfo;
 
 /**
@@ -234,9 +234,10 @@
             // mark project as unsaved
             project.setModified(true);
             projectController.setDirty(true);
-
-            ConfigurationValidationVisitor validatVisitor = new ConfigurationValidationVisitor(project);
-            List<ValidationInfo> object = (List<ValidationInfo>) project.getRootNode().acceptVisitor(validatVisitor);
+            
+            DefaultValidator validator = getApplication().getInjector().getInstance(
+                    DefaultValidator.class);
+            List<ValidationInfo> object = validator.validate(project.getRootNode(), project);
             
             // show warning dialog
             ValidatorDialog.showDialog(frame, object);

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/SaveAsAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/SaveAsAction.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/SaveAsAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/SaveAsAction.java Fri Feb 19 15:00:50 2010
@@ -40,8 +40,9 @@
 import org.apache.cayenne.project.ProjectPath;
 import org.apache.cayenne.project2.Project;
 import org.apache.cayenne.project2.ProjectSaver;
-import org.apache.cayenne.project2.validate.ConfigurationValidationVisitor;
+import org.apache.cayenne.project2.validate.DefaultValidator;
 import org.apache.cayenne.project2.validate.ValidationInfo;
+import org.apache.cayenne.project2.validate.Validator;
 import org.apache.cayenne.resource.URLResource;
 
 /**
@@ -156,13 +157,12 @@
     }
 
     public synchronized void performAction(int warningLevel) {
-
-        ConfigurationValidationVisitor validatVisitor = new ConfigurationValidationVisitor(
-                getCurrentProject());
-        List<ValidationInfo> object = (List<ValidationInfo>) getCurrentProject()
-                .getRootNode()
-                .acceptVisitor(validatVisitor);
-        int validationCode = validatVisitor.getMaxSeverity();
+        
+        DefaultValidator validator = getApplication().getInjector().getInstance(
+                DefaultValidator.class);
+        List<ValidationInfo> object = validator.validate(getCurrentProject().getRootNode(), getCurrentProject());
+        
+        int validationCode = ((Validator)validator).getMaxSeverity();
 
         // If no serious errors, perform save.
         if (validationCode < ValidationDisplayHandler.ERROR) {

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ValidateAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ValidateAction.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ValidateAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ValidateAction.java Fri Feb 19 15:00:50 2010
@@ -33,8 +33,9 @@
 import org.apache.cayenne.modeler.util.CayenneAction;
 import org.apache.cayenne.project.ProjectPath;
 import org.apache.cayenne.project2.Project;
-import org.apache.cayenne.project2.validate.ConfigurationValidationVisitor;
+import org.apache.cayenne.project2.validate.DefaultValidator;
 import org.apache.cayenne.project2.validate.ValidationInfo;
+import org.apache.cayenne.project2.validate.Validator;
 
 /**
  * UI action that performs full project validation.
@@ -60,11 +61,12 @@
 	 * Validates project for possible conflicts and incomplete mappings.
 	 */
 	public void performAction(ActionEvent e) {
-
-        ConfigurationValidationVisitor validatVisitor = new ConfigurationValidationVisitor(getCurrentProject());
-        List<ValidationInfo> object = (List<ValidationInfo>) getCurrentProject().getRootNode().acceptVisitor(validatVisitor);
-        int validationCode = validatVisitor.getMaxSeverity();
+	    
+	    DefaultValidator validator = getApplication().getInjector().getInstance(
+                DefaultValidator.class);
+        List<ValidationInfo> object = validator.validate(getCurrentProject().getRootNode(), getCurrentProject());
         
+        int validationCode = ((Validator)validator).getMaxSeverity();
         
 		// If there were errors or warnings at validation, display them
 		if (validationCode >= ValidationDisplayHandler.WARNING) {

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/TableSelectorController.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/TableSelectorController.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/TableSelectorController.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/TableSelectorController.java Fri Feb 19 15:00:50 2010
@@ -34,8 +34,10 @@
 import org.apache.cayenne.modeler.ProjectController;
 import org.apache.cayenne.modeler.dialog.validator.ValidationDisplayHandler;
 import org.apache.cayenne.modeler.util.CayenneController;
-import org.apache.cayenne.project2.validate.ConfigurationValidationVisitor;
+import org.apache.cayenne.project2.Project;
+import org.apache.cayenne.project2.validate.DefaultValidator;
 import org.apache.cayenne.project2.validate.ValidationInfo;
+import org.apache.cayenne.project2.validate.Validator;
 import org.apache.cayenne.swing.BindingBuilder;
 import org.apache.cayenne.swing.ObjectBinding;
 import org.apache.cayenne.swing.TableBindingBuilder;
@@ -53,14 +55,14 @@
     protected Map excludedTables;
     protected List<DbEntity> selectableTablesList;
 
-    protected Map validationMessages;
+    protected Map<String, String> validationMessages;
 
     public TableSelectorController(ProjectController parent) {
         super(parent);
         this.view = new TableSelectorView();
         this.excludedTables = new HashMap();
         this.selectableTablesList = new ArrayList();
-        this.validationMessages = new HashMap();
+        this.validationMessages = new HashMap<String, String>();
         initController();
     }
 
@@ -179,14 +181,13 @@
         // TODO: this is inefficient.. we need targeted validation
         // instead of doing it on the whole project
 
-        ConfigurationValidationVisitor validatVisitor = new ConfigurationValidationVisitor(
-                ((ProjectController) getParent()).getProject());
-        List<ValidationInfo> object = (List<ValidationInfo>) getApplication()
-                .getProject()
-                .getRootNode()
-                .acceptVisitor(validatVisitor);
-        
-        int validationCode = validatVisitor.getMaxSeverity();
+        Project project = getApplication().getProject();
+
+        DefaultValidator validator = getApplication().getInjector().getInstance(
+                DefaultValidator.class);
+        List<ValidationInfo> object = validator.validate(project.getRootNode(), project);
+
+        int validationCode = ((Validator) validator).getMaxSeverity();
 
         if (validationCode >= ValidationDisplayHandler.WARNING) {
 

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/ValidatorDialog.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/ValidatorDialog.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/ValidatorDialog.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/ValidatorDialog.java Fri Feb 19 15:00:50 2010
@@ -65,7 +65,7 @@
     protected JTable problemsTable;
     protected JButton closeButton;
     protected JButton refreshButton;
-    protected List validationObjects;
+    protected List<ValidationInfo> validationObjects;
 
     public static synchronized void showDialog(
             CayenneModelerFrame frame,

Modified: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/CayenneProjectModule.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/CayenneProjectModule.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/CayenneProjectModule.java (original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/CayenneProjectModule.java Fri Feb 19 15:00:50 2010
@@ -23,6 +23,8 @@
 import org.apache.cayenne.di.Scopes;
 import org.apache.cayenne.project2.upgrade.ProjectUpgrader;
 import org.apache.cayenne.project2.upgrade.v6.ProjectUpgrader_V6;
+import org.apache.cayenne.project2.validate.DefaultValidator;
+import org.apache.cayenne.project2.validate.Validator;
 
 /**
  * A dependency injection (DI) module contributing configuration related to Cayenne
@@ -38,5 +40,6 @@
         binder.bind(ProjectSaver.class).to(FileProjectSaver.class).in(Scopes.SINGLETON);
         binder.bind(ProjectUpgrader.class).to(ProjectUpgrader_V6.class).in(
                 Scopes.SINGLETON);
+        binder.bind(DefaultValidator.class).to(Validator.class);
     }
 }

Copied: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ConfigurationValidator.java (from r911815, cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ConfigurationValidationVisitor.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ConfigurationValidator.java?p2=cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ConfigurationValidator.java&p1=cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ConfigurationValidationVisitor.java&r1=911815&r2=911831&rev=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ConfigurationValidationVisitor.java (original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ConfigurationValidator.java Fri Feb 19 15:00:50 2010
@@ -43,33 +43,13 @@
 import org.apache.cayenne.query.SQLTemplate;
 import org.apache.cayenne.query.SelectQuery;
 
-public class ConfigurationValidationVisitor implements
-        ConfigurationNodeVisitor<List<ValidationInfo>> {
+class ConfigurationValidator implements ConfigurationNodeVisitor<List<ValidationInfo>> {
 
     private List<ValidationInfo> validationResults = new ArrayList<ValidationInfo>();
     private int maxSeverity;
     private Project project;
 
-    /* Validators */
-    DataChannelValidator dataChannelValidator = new DataChannelValidator();
-    DataNodeValidator nodeValidator = new DataNodeValidator();
-    DataMapValidator mapValidator = new DataMapValidator();
-    ObjEntityValidator objEntityValidator = new ObjEntityValidator();
-    ObjAttributeValidator objAttrValidator = new ObjAttributeValidator();
-    ObjRelationshipValidator objRelValidator = new ObjRelationshipValidator();
-    DbEntityValidator dbEntityValidator = new DbEntityValidator();
-    DbAttributeValidator dbAttrValidator = new DbAttributeValidator();
-    DbRelationshipValidator dbRelValidator = new DbRelationshipValidator();
-    EmbeddableAttributeValidator embeddableAttributeValidator = new EmbeddableAttributeValidator();
-    EmbeddableValidator embeddableValidator = new EmbeddableValidator();
-    ProcedureValidator procedureValidator = new ProcedureValidator();
-    ProcedureParameterValidator procedureParameterValidator = new ProcedureParameterValidator();
-    SelectQueryValidator selectQueryValidator = new SelectQueryValidator();
-    ProcedureQueryValidator procedureQueryValidator = new ProcedureQueryValidator();
-    EJBQLQueryValidator ejbqlQueryValidator = new EJBQLQueryValidator();
-    SQLTemplateValidator sqlTemplateValidator = new SQLTemplateValidator();
-
-    public ConfigurationValidationVisitor(Project project) {
+    ConfigurationValidator(Project project) {
         this.project = project;
     }
 
@@ -81,8 +61,11 @@
         return project;
     }
 
-    public List<ValidationInfo> visitDataChannelDescriptor(DataChannelDescriptor channelDescriptor) {
-        dataChannelValidator.validate(channelDescriptor, this);
+    public List<ValidationInfo> visitDataChannelDescriptor(
+            DataChannelDescriptor channelDescriptor) {
+        Validators.getInstance().getDataChannelValidator().validate(
+                channelDescriptor,
+                this);
         Iterator<DataNodeDescriptor> it = channelDescriptor
                 .getNodeDescriptors()
                 .iterator();
@@ -100,7 +83,7 @@
     }
 
     public List<ValidationInfo> visitDataMap(DataMap dataMap) {
-        mapValidator.validate(dataMap, this);
+        Validators.getInstance().getMapValidator().validate(dataMap, this);
         Iterator<Embeddable> itEmb = dataMap.getEmbeddables().iterator();
         while (itEmb.hasNext()) {
             Embeddable emb = itEmb.next();
@@ -135,17 +118,17 @@
     }
 
     public List<ValidationInfo> visitDataNodeDescriptor(DataNodeDescriptor nodeDescriptor) {
-        nodeValidator.validate(nodeDescriptor, this);
+        Validators.getInstance().getNodeValidator().validate(nodeDescriptor, this);
         return validationResults;
     }
 
     public List<ValidationInfo> visitDbAttribute(DbAttribute attribute) {
-        dbAttrValidator.validate(attribute, this);
+        Validators.getInstance().getDbAttrValidator().validate(attribute, this);
         return validationResults;
     }
 
     public List<ValidationInfo> visitDbEntity(DbEntity entity) {
-        dbEntityValidator.validate(entity, this);
+        Validators.getInstance().getDbEntityValidator().validate(entity, this);
 
         Iterator<DbAttribute> itAttr = entity.getAttributes().iterator();
         while (itAttr.hasNext()) {
@@ -162,12 +145,12 @@
     }
 
     public List<ValidationInfo> visitDbRelationship(DbRelationship relationship) {
-        dbRelValidator.validate(relationship, this);
+        Validators.getInstance().getDbRelValidator().validate(relationship, this);
         return validationResults;
     }
 
     public List<ValidationInfo> visitEmbeddable(Embeddable embeddable) {
-        embeddableValidator.validate(embeddable, this);
+        Validators.getInstance().getEmbeddableValidator().validate(embeddable, this);
         Iterator<EmbeddableAttribute> it = embeddable.getAttributes().iterator();
         while (it.hasNext()) {
             EmbeddableAttribute attr = it.next();
@@ -177,17 +160,19 @@
     }
 
     public List<ValidationInfo> visitEmbeddableAttribute(EmbeddableAttribute attribute) {
-        embeddableAttributeValidator.validate(attribute, this);
+        Validators.getInstance().getEmbeddableAttributeValidator().validate(
+                attribute,
+                this);
         return validationResults;
     }
 
     public List<ValidationInfo> visitObjAttribute(ObjAttribute attribute) {
-        objAttrValidator.validate(attribute, this);
+        Validators.getInstance().getObjAttrValidator().validate(attribute, this);
         return validationResults;
     }
 
     public List<ValidationInfo> visitObjEntity(ObjEntity entity) {
-        objEntityValidator.validate(entity, this);
+        Validators.getInstance().getObjEntityValidator().validate(entity, this);
 
         Iterator<ObjAttribute> itAttr = entity.getAttributes().iterator();
         while (itAttr.hasNext()) {
@@ -204,12 +189,12 @@
     }
 
     public List<ValidationInfo> visitObjRelationship(ObjRelationship relationship) {
-        objRelValidator.validate(relationship, this);
+        Validators.getInstance().getObjRelValidator().validate(relationship, this);
         return validationResults;
     }
 
     public List<ValidationInfo> visitProcedure(Procedure procedure) {
-        procedureValidator.validate(procedure, this);
+        Validators.getInstance().getProcedureValidator().validate(procedure, this);
         ProcedureParameter parameter = procedure.getResultParam();
         visitProcedureParameter(parameter);
         Iterator<ProcedureParameter> itPrOut = procedure
@@ -229,22 +214,24 @@
     }
 
     public List<ValidationInfo> visitProcedureParameter(ProcedureParameter parameter) {
-        procedureParameterValidator.validate(parameter, this);
+        Validators.getInstance().getProcedureParameterValidator().validate(
+                parameter,
+                this);
         return validationResults;
     }
 
     public List<ValidationInfo> visitQuery(Query query) {
         if (query instanceof SelectQuery) {
-            selectQueryValidator.validate(query, this);
+            Validators.getInstance().getSelectQueryValidator().validate(query, this);
         }
         else if (query instanceof SQLTemplate) {
-            sqlTemplateValidator.validate(query, this);
+            Validators.getInstance().getSqlTemplateValidator().validate(query, this);
         }
         else if (query instanceof ProcedureQuery) {
-            procedureQueryValidator.validate(query, this);
+            Validators.getInstance().getProcedureQueryValidator().validate(query, this);
         }
         else if (query instanceof EJBQLQuery) {
-            ejbqlQueryValidator.validate(query, this);
+            Validators.getInstance().getEjbqlQueryValidator().validate(query, this);
         }
         else {
             // ignore unknown nodes
@@ -279,3 +266,122 @@
         return validationResults;
     }
 }
+
+class Validators {
+
+    private static Validators instance = null;
+
+    /* Validators */
+    private DataChannelValidator dataChannelValidator;
+    private DataNodeValidator nodeValidator;
+    private DataMapValidator mapValidator;
+    private ObjEntityValidator objEntityValidator;
+    private ObjAttributeValidator objAttrValidator;
+    private ObjRelationshipValidator objRelValidator;
+    private DbEntityValidator dbEntityValidator;
+    private DbAttributeValidator dbAttrValidator;
+    private DbRelationshipValidator dbRelValidator;
+    private EmbeddableAttributeValidator embeddableAttributeValidator;
+    private EmbeddableValidator embeddableValidator;
+    private ProcedureValidator procedureValidator;
+    private ProcedureParameterValidator procedureParameterValidator;
+    private SelectQueryValidator selectQueryValidator;
+    private ProcedureQueryValidator procedureQueryValidator;
+    private EJBQLQueryValidator ejbqlQueryValidator;
+    private SQLTemplateValidator sqlTemplateValidator;
+
+    protected Validators() {
+        dataChannelValidator = new DataChannelValidator();
+        nodeValidator = new DataNodeValidator();
+        mapValidator = new DataMapValidator();
+        objEntityValidator = new ObjEntityValidator();
+        objAttrValidator = new ObjAttributeValidator();
+        objRelValidator = new ObjRelationshipValidator();
+        dbEntityValidator = new DbEntityValidator();
+        dbAttrValidator = new DbAttributeValidator();
+        dbRelValidator = new DbRelationshipValidator();
+        embeddableAttributeValidator = new EmbeddableAttributeValidator();
+        embeddableValidator = new EmbeddableValidator();
+        procedureValidator = new ProcedureValidator();
+        procedureParameterValidator = new ProcedureParameterValidator();
+        selectQueryValidator = new SelectQueryValidator();
+        procedureQueryValidator = new ProcedureQueryValidator();
+        ejbqlQueryValidator = new EJBQLQueryValidator();
+        sqlTemplateValidator = new SQLTemplateValidator();
+    }
+
+    public static Validators getInstance() {
+        if (instance == null) {
+            instance = new Validators();
+        }
+        return instance;
+    }
+
+    public DataChannelValidator getDataChannelValidator() {
+        return dataChannelValidator;
+    }
+
+    public DataNodeValidator getNodeValidator() {
+        return nodeValidator;
+    }
+
+    public DataMapValidator getMapValidator() {
+        return mapValidator;
+    }
+
+    public ObjEntityValidator getObjEntityValidator() {
+        return objEntityValidator;
+    }
+
+    public ObjAttributeValidator getObjAttrValidator() {
+        return objAttrValidator;
+    }
+
+    public ObjRelationshipValidator getObjRelValidator() {
+        return objRelValidator;
+    }
+
+    public DbEntityValidator getDbEntityValidator() {
+        return dbEntityValidator;
+    }
+
+    public DbAttributeValidator getDbAttrValidator() {
+        return dbAttrValidator;
+    }
+
+    public DbRelationshipValidator getDbRelValidator() {
+        return dbRelValidator;
+    }
+
+    public EmbeddableAttributeValidator getEmbeddableAttributeValidator() {
+        return embeddableAttributeValidator;
+    }
+
+    public EmbeddableValidator getEmbeddableValidator() {
+        return embeddableValidator;
+    }
+
+    public ProcedureValidator getProcedureValidator() {
+        return procedureValidator;
+    }
+
+    public ProcedureParameterValidator getProcedureParameterValidator() {
+        return procedureParameterValidator;
+    }
+
+    public SelectQueryValidator getSelectQueryValidator() {
+        return selectQueryValidator;
+    }
+
+    public ProcedureQueryValidator getProcedureQueryValidator() {
+        return procedureQueryValidator;
+    }
+
+    public EJBQLQueryValidator getEjbqlQueryValidator() {
+        return ejbqlQueryValidator;
+    }
+
+    public SQLTemplateValidator getSqlTemplateValidator() {
+        return sqlTemplateValidator;
+    }
+}

Modified: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataChannelValidator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataChannelValidator.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataChannelValidator.java (original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataChannelValidator.java Fri Feb 19 15:00:50 2010
@@ -25,13 +25,13 @@
 
     void validate(
             Object object,
-            ConfigurationValidationVisitor configurationValidationVisitor) {
+            ConfigurationValidator configurationValidator) {
 
         // check for empty name
         DataChannelDescriptor domain = (DataChannelDescriptor) object;
         String name = domain.getName();
         if (Util.isEmptyString(name)) {
-            configurationValidationVisitor.registerError("Unnamed DataDomain.", object);
+            configurationValidator.registerError("Unnamed DataDomain.", object);
 
             // no more name assertions
             return;

Modified: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataMapValidator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataMapValidator.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataMapValidator.java (original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataMapValidator.java Fri Feb 19 15:00:50 2010
@@ -27,18 +27,18 @@
 
     void validate(
             Object object,
-            ConfigurationValidationVisitor configurationValidationVisitor) {
+            ConfigurationValidator configurationValidator) {
         DataMap map = (DataMap) object;
-        validateName(map, object, configurationValidationVisitor);
+        validateName(map, object, configurationValidator);
 
         // check if data map is not attached to any nodes
-        validateNodeLinks(map, object, configurationValidationVisitor);
+        validateNodeLinks(map, object, configurationValidator);
     }
 
     void validateNodeLinks(
             DataMap map,
             Object object,
-            ConfigurationValidationVisitor validator) {
+            ConfigurationValidator validator) {
         DataChannelDescriptor domain = (DataChannelDescriptor) validator
                 .getProject()
                 .getRootNode();
@@ -61,7 +61,7 @@
         }
     }
 
-    void validateName(DataMap map, Object object, ConfigurationValidationVisitor validator) {
+    void validateName(DataMap map, Object object, ConfigurationValidator validator) {
         String name = map.getName();
 
         if (Util.isEmptyString(name)) {

Modified: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataNodeValidator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataNodeValidator.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataNodeValidator.java (original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataNodeValidator.java Fri Feb 19 15:00:50 2010
@@ -27,16 +27,16 @@
 
     void validate(
             Object object,
-            ConfigurationValidationVisitor configurationValidationVisitor) {
+            ConfigurationValidator configurationValidator) {
         DataNodeDescriptor node = (DataNodeDescriptor) object;
-        validateName(node, object, configurationValidationVisitor);
-        validateConnection(node, object, configurationValidationVisitor);
+        validateName(node, object, configurationValidator);
+        validateConnection(node, object, configurationValidator);
     }
 
     void validateConnection(
             DataNodeDescriptor node,
             Object object,
-            ConfigurationValidationVisitor validator) {
+            ConfigurationValidator validator) {
         String factory = node.getDataSourceFactoryType();
 
         // If direct factory, make sure the location is a valid file name.
@@ -54,7 +54,7 @@
     void validateName(
             DataNodeDescriptor node,
             Object object,
-            ConfigurationValidationVisitor validator) {
+            ConfigurationValidator validator) {
         String name = node.getName();
 
         if (Util.isEmptyString(name)) {

Modified: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DbAttributeValidator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DbAttributeValidator.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DbAttributeValidator.java (original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DbAttributeValidator.java Fri Feb 19 15:00:50 2010
@@ -25,7 +25,7 @@
 
 class DbAttributeValidator {
 
-    void validate(Object object, ConfigurationValidationVisitor validator) {
+    void validate(Object object, ConfigurationValidator validator) {
         DbAttribute attribute = (DbAttribute) object;
 
         // Must have name

Modified: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DbEntityValidator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DbEntityValidator.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DbEntityValidator.java (original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DbEntityValidator.java Fri Feb 19 15:00:50 2010
@@ -25,7 +25,7 @@
 
 class DbEntityValidator {
 
-    void validate(Object object, ConfigurationValidationVisitor validator) {
+    void validate(Object object, ConfigurationValidator validator) {
         DbEntity ent = (DbEntity) object;
         validateName(ent, object, validator);
         validateAttributes(ent, object, validator);
@@ -37,7 +37,7 @@
      * map also conatins an ObjEntity mapped to this entity, since unmapped primary key is
      * ok if working with data rows.
      */
-    void validatePK(DbEntity ent, Object object, ConfigurationValidationVisitor validator) {
+    void validatePK(DbEntity ent, Object object, ConfigurationValidator validator) {
         if (ent.getAttributes().size() > 0 && ent.getPrimaryKeys().size() == 0) {
             DataMap map = ent.getDataMap();
             if (map != null && map.getMappedEntities(ent).size() > 0) {
@@ -55,7 +55,7 @@
     void validateAttributes(
             DbEntity ent,
             Object object,
-            ConfigurationValidationVisitor validator) {
+            ConfigurationValidator validator) {
         if (ent.getAttributes().size() == 0) {
             // complain about missing attributes
             validator.registerWarning("DbEntity \""
@@ -67,7 +67,7 @@
     void validateName(
             DbEntity ent,
             Object object,
-            ConfigurationValidationVisitor validator) {
+            ConfigurationValidator validator) {
         String name = ent.getName();
 
         // Must have name

Modified: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DbRelationshipValidator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DbRelationshipValidator.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DbRelationshipValidator.java (original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DbRelationshipValidator.java Fri Feb 19 15:00:50 2010
@@ -25,7 +25,7 @@
 
 class DbRelationshipValidator {
 
-    void validate(Object object, ConfigurationValidationVisitor validator) {
+    void validate(Object object, ConfigurationValidator validator) {
         DbRelationship rel = (DbRelationship) object;
 
         if (rel.getTargetEntity() == null) {

Copied: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DefaultValidator.java (from r911815, cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataChannelValidator.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DefaultValidator.java?p2=cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DefaultValidator.java&p1=cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataChannelValidator.java&r1=911815&r2=911831&rev=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataChannelValidator.java (original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DefaultValidator.java Fri Feb 19 15:00:50 2010
@@ -18,23 +18,12 @@
  ****************************************************************/
 package org.apache.cayenne.project2.validate;
 
-import org.apache.cayenne.configuration.DataChannelDescriptor;
-import org.apache.cayenne.util.Util;
+import java.util.List;
 
-class DataChannelValidator {
+import org.apache.cayenne.configuration.ConfigurationNode;
+import org.apache.cayenne.project2.Project;
 
-    void validate(
-            Object object,
-            ConfigurationValidationVisitor configurationValidationVisitor) {
+public interface DefaultValidator {
 
-        // check for empty name
-        DataChannelDescriptor domain = (DataChannelDescriptor) object;
-        String name = domain.getName();
-        if (Util.isEmptyString(name)) {
-            configurationValidationVisitor.registerError("Unnamed DataDomain.", object);
-
-            // no more name assertions
-            return;
-        }
-    }
+    public List<ValidationInfo> validate(ConfigurationNode node, Project project);
 }

Modified: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/EJBQLQueryValidator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/EJBQLQueryValidator.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/EJBQLQueryValidator.java (original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/EJBQLQueryValidator.java Fri Feb 19 15:00:50 2010
@@ -26,7 +26,7 @@
 
 class EJBQLQueryValidator {
 
-    void validate(Object object, ConfigurationValidationVisitor validator) {
+    void validate(Object object, ConfigurationValidator validator) {
         EJBQLQuery query = (EJBQLQuery) object;
 
         ProjectPath path = new ProjectPath(new Object[] {

Modified: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/EmbeddableAttributeValidator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/EmbeddableAttributeValidator.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/EmbeddableAttributeValidator.java (original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/EmbeddableAttributeValidator.java Fri Feb 19 15:00:50 2010
@@ -23,7 +23,7 @@
 
 class EmbeddableAttributeValidator {
 
-    void validate(Object object, ConfigurationValidationVisitor validator) {
+    void validate(Object object, ConfigurationValidator validator) {
 
         EmbeddableAttribute emAttribute = (EmbeddableAttribute) object;
 

Modified: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/EmbeddableValidator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/EmbeddableValidator.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/EmbeddableValidator.java (original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/EmbeddableValidator.java Fri Feb 19 15:00:50 2010
@@ -27,15 +27,15 @@
 
     void validate(
             Object object,
-            ConfigurationValidationVisitor configurationValidationVisitor) {
+            ConfigurationValidator configurationValidator) {
         Embeddable emb = (Embeddable) object;
-        validateName(emb, object, configurationValidationVisitor);
+        validateName(emb, object, configurationValidator);
     }
 
     void validateName(
             Embeddable emb,
             Object object,
-            ConfigurationValidationVisitor validator) {
+            ConfigurationValidator validator) {
         String name = emb.getClassName();
 
         // Must have name

Modified: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ObjAttributeValidator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ObjAttributeValidator.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ObjAttributeValidator.java (original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ObjAttributeValidator.java Fri Feb 19 15:00:50 2010
@@ -32,7 +32,7 @@
 
 class ObjAttributeValidator {
 
-    void validate(Object object, ConfigurationValidationVisitor validator) {
+    void validate(Object object, ConfigurationValidator validator) {
         ObjAttribute attribute = (ObjAttribute) object;
 
         // Must have name

Modified: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ObjEntityValidator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ObjEntityValidator.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ObjEntityValidator.java (original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ObjEntityValidator.java Fri Feb 19 15:00:50 2010
@@ -26,7 +26,7 @@
 
 class ObjEntityValidator {
 
-    void validate(Object object, ConfigurationValidationVisitor validator) {
+    void validate(Object object, ConfigurationValidator validator) {
         ObjEntity ent = (ObjEntity) object;
 
         validateName(ent, object, validator);
@@ -42,7 +42,7 @@
     void validateClassName(
             ObjEntity ent,
             Object object,
-            ConfigurationValidationVisitor validator) {
+            ConfigurationValidator validator) {
         String className = ent.getClassName();
 
         // if mapped to default class, ignore...
@@ -73,7 +73,7 @@
     void validateSuperClassName(
             ObjEntity ent,
             Object object,
-            ConfigurationValidationVisitor validator) {
+            ConfigurationValidator validator) {
         String superClassName = ent.getSuperClassName();
 
         if (Util.isEmptyString(superClassName)) {
@@ -103,7 +103,7 @@
     void validateName(
             ObjEntity entity,
             Object object,
-            ConfigurationValidationVisitor validator) {
+            ConfigurationValidator validator) {
         String name = entity.getName();
 
         // Must have name

Modified: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ObjRelationshipValidator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ObjRelationshipValidator.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ObjRelationshipValidator.java (original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ObjRelationshipValidator.java Fri Feb 19 15:00:50 2010
@@ -32,7 +32,7 @@
 
 class ObjRelationshipValidator {
 
-    void validate(Object object, ConfigurationValidationVisitor validator) {
+    void validate(Object object, ConfigurationValidator validator) {
         ObjRelationship rel = (ObjRelationship) object;
 
         if (Util.isEmptyString(rel.getName())) {

Modified: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ProcedureParameterValidator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ProcedureParameterValidator.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ProcedureParameterValidator.java (original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ProcedureParameterValidator.java Fri Feb 19 15:00:50 2010
@@ -24,7 +24,7 @@
 
 class ProcedureParameterValidator {
 
-    void validate(Object object, ConfigurationValidationVisitor validator) {
+    void validate(Object object, ConfigurationValidator validator) {
 
         ProcedureParameter parameter = (ProcedureParameter) object;
 

Modified: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ProcedureQueryValidator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ProcedureQueryValidator.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ProcedureQueryValidator.java (original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ProcedureQueryValidator.java Fri Feb 19 15:00:50 2010
@@ -26,14 +26,14 @@
 
 class ProcedureQueryValidator {
 
-    void validate(Object object, ConfigurationValidationVisitor validator) {
+    void validate(Object object, ConfigurationValidator validator) {
         ProcedureQuery query = (ProcedureQuery) object;
 
         validateName(query, validator);
         validateRoot(query, validator);
     }
 
-    void validateRoot(ProcedureQuery query, ConfigurationValidationVisitor validator) {
+    void validateRoot(ProcedureQuery query, ConfigurationValidator validator) {
 
         DataMap map = query.getDataMap();
         Object root = query.getRoot();
@@ -62,7 +62,7 @@
         }
     }
 
-    void validateName(ProcedureQuery query, ConfigurationValidationVisitor validator) {
+    void validateName(ProcedureQuery query, ConfigurationValidator validator) {
         String name = query.getName();
 
         // Must have name

Modified: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ProcedureValidator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ProcedureValidator.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ProcedureValidator.java (original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/ProcedureValidator.java Fri Feb 19 15:00:50 2010
@@ -27,7 +27,7 @@
 
 class ProcedureValidator {
 
-    void validate(Object object, ConfigurationValidationVisitor validator) {
+    void validate(Object object, ConfigurationValidator validator) {
         Procedure procedure = (Procedure) object;
 
         validateName(procedure, validator);
@@ -43,7 +43,7 @@
         }
     }
 
-    void validateName(Procedure procedure, ConfigurationValidationVisitor validator) {
+    void validateName(Procedure procedure, ConfigurationValidator validator) {
         String name = procedure.getName();
 
         // Must have name

Modified: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/SQLTemplateValidator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/SQLTemplateValidator.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/SQLTemplateValidator.java (original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/SQLTemplateValidator.java Fri Feb 19 15:00:50 2010
@@ -25,7 +25,7 @@
 
 class SQLTemplateValidator {
 
-    void validate(Object object, ConfigurationValidationVisitor validator) {
+    void validate(Object object, ConfigurationValidator validator) {
         SQLTemplate query = (SQLTemplate) object;
 
         validateName(query, validator);
@@ -33,7 +33,7 @@
         validateDefaultSQL(query, validator);
     }
 
-    void validateDefaultSQL(SQLTemplate query, ConfigurationValidationVisitor validator) {
+    void validateDefaultSQL(SQLTemplate query, ConfigurationValidator validator) {
 
         if (Util.isEmptyString(query.getDefaultTemplate())) {
             // see if there is at least one adapter-specific template...
@@ -48,14 +48,14 @@
         }
     }
 
-    void validateRoot(SQLTemplate query, ConfigurationValidationVisitor validator) {
+    void validateRoot(SQLTemplate query, ConfigurationValidator validator) {
         DataMap map = query.getDataMap();
         if (query.getRoot() == null && map != null) {
             validator.registerWarning("Query has no root", query);
         }
     }
 
-    void validateName(SQLTemplate query, ConfigurationValidationVisitor validator) {
+    void validateName(SQLTemplate query, ConfigurationValidator validator) {
         String name = query.getName();
 
         // Must have name

Modified: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/SelectQueryValidator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/SelectQueryValidator.java?rev=911831&r1=911830&r2=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/SelectQueryValidator.java (original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/SelectQueryValidator.java Fri Feb 19 15:00:50 2010
@@ -29,7 +29,7 @@
 
 class SelectQueryValidator {
 
-    void validate(Object object, ConfigurationValidationVisitor validator) {
+    void validate(Object object, ConfigurationValidator validator) {
         SelectQuery query = (SelectQuery) object;
 
         validateName(query, validator);
@@ -58,22 +58,22 @@
     void validatePrefetch(
             Entity root,
             String path,
-            ConfigurationValidationVisitor validator) {
+            ConfigurationValidator validator) {
     }
 
     void validateOrdering(
             Entity root,
             Ordering ordering,
-            ConfigurationValidationVisitor validator) {
+            ConfigurationValidator validator) {
     }
 
     void validateQualifier(
             Entity root,
             Expression qualifier,
-            ConfigurationValidationVisitor validator) {
+            ConfigurationValidator validator) {
     }
 
-    Entity validateRoot(SelectQuery query, ConfigurationValidationVisitor validator) {
+    Entity validateRoot(SelectQuery query, ConfigurationValidator validator) {
         DataMap map = query.getDataMap();
         if (query.getRoot() == null && map != null) {
             validator.registerWarning("Query has no root", query);
@@ -112,7 +112,7 @@
         return null;
     }
 
-    void validateName(SelectQuery query, ConfigurationValidationVisitor validator) {
+    void validateName(SelectQuery query, ConfigurationValidator validator) {
         String name = query.getName();
 
         // Must have name

Copied: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/Validator.java (from r911815, cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataChannelValidator.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/Validator.java?p2=cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/Validator.java&p1=cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataChannelValidator.java&r1=911815&r2=911831&rev=911831&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DataChannelValidator.java (original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/Validator.java Fri Feb 19 15:00:50 2010
@@ -18,23 +18,21 @@
  ****************************************************************/
 package org.apache.cayenne.project2.validate;
 
-import org.apache.cayenne.configuration.DataChannelDescriptor;
-import org.apache.cayenne.util.Util;
+import java.util.List;
 
-class DataChannelValidator {
+import org.apache.cayenne.configuration.ConfigurationNode;
+import org.apache.cayenne.project2.Project;
 
-    void validate(
-            Object object,
-            ConfigurationValidationVisitor configurationValidationVisitor) {
+public class Validator implements DefaultValidator {
 
-        // check for empty name
-        DataChannelDescriptor domain = (DataChannelDescriptor) object;
-        String name = domain.getName();
-        if (Util.isEmptyString(name)) {
-            configurationValidationVisitor.registerError("Unnamed DataDomain.", object);
-
-            // no more name assertions
-            return;
-        }
+    private ConfigurationValidator validateVisitor;
+    
+    public List<ValidationInfo> validate(ConfigurationNode node, Project project) {
+        validateVisitor = new ConfigurationValidator(project);
+        return node.acceptVisitor(validateVisitor);
+    }
+    
+    public int getMaxSeverity(){
+        return validateVisitor.getMaxSeverity();
     }
 }



Mime
View raw message