cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r911838 - 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:17:37 GMT
Author: oltka
Date: Fri Feb 19 15:17:32 2010
New Revision: 911838

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

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-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/DefaultValidator.java
    cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/Validator.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=911838&r1=911837&r2=911838&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:17:32 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.DefaultValidator;
+import org.apache.cayenne.project2.validate.Validator;
 import org.apache.cayenne.project2.validate.ValidationInfo;
 
 /**
@@ -235,8 +235,8 @@
             project.setModified(true);
             projectController.setDirty(true);
             
-            DefaultValidator validator = getApplication().getInjector().getInstance(
-                    DefaultValidator.class);
+            Validator validator = getApplication().getInjector().getInstance(
+                    Validator.class);
             List<ValidationInfo> object = validator.validate(project.getRootNode(),
project);
             
             // show warning dialog

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=911838&r1=911837&r2=911838&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:17:32 2010
@@ -40,9 +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.DefaultValidator;
-import org.apache.cayenne.project2.validate.ValidationInfo;
 import org.apache.cayenne.project2.validate.Validator;
+import org.apache.cayenne.project2.validate.ValidationInfo;
+import org.apache.cayenne.project2.validate.DefaultValidator;
 import org.apache.cayenne.resource.URLResource;
 
 /**
@@ -158,11 +158,11 @@
 
     public synchronized void performAction(int warningLevel) {
         
-        DefaultValidator validator = getApplication().getInjector().getInstance(
-                DefaultValidator.class);
+        Validator validator = getApplication().getInjector().getInstance(
+                Validator.class);
         List<ValidationInfo> object = validator.validate(getCurrentProject().getRootNode(),
getCurrentProject());
         
-        int validationCode = ((Validator)validator).getMaxSeverity();
+        int validationCode = ((DefaultValidator)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=911838&r1=911837&r2=911838&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:17:32 2010
@@ -33,9 +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.DefaultValidator;
-import org.apache.cayenne.project2.validate.ValidationInfo;
 import org.apache.cayenne.project2.validate.Validator;
+import org.apache.cayenne.project2.validate.ValidationInfo;
+import org.apache.cayenne.project2.validate.DefaultValidator;
 
 /**
  * UI action that performs full project validation.
@@ -62,11 +62,11 @@
 	 */
 	public void performAction(ActionEvent e) {
 	    
-	    DefaultValidator validator = getApplication().getInjector().getInstance(
-                DefaultValidator.class);
+	    Validator validator = getApplication().getInjector().getInstance(
+                Validator.class);
         List<ValidationInfo> object = validator.validate(getCurrentProject().getRootNode(),
getCurrentProject());
         
-        int validationCode = ((Validator)validator).getMaxSeverity();
+        int validationCode = ((DefaultValidator)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=911838&r1=911837&r2=911838&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:17:32 2010
@@ -35,9 +35,9 @@
 import org.apache.cayenne.modeler.dialog.validator.ValidationDisplayHandler;
 import org.apache.cayenne.modeler.util.CayenneController;
 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.project2.validate.ValidationInfo;
+import org.apache.cayenne.project2.validate.DefaultValidator;
 import org.apache.cayenne.swing.BindingBuilder;
 import org.apache.cayenne.swing.ObjectBinding;
 import org.apache.cayenne.swing.TableBindingBuilder;
@@ -183,11 +183,11 @@
 
         Project project = getApplication().getProject();
 
-        DefaultValidator validator = getApplication().getInjector().getInstance(
-                DefaultValidator.class);
+        Validator validator = getApplication().getInjector().getInstance(
+                Validator.class);
         List<ValidationInfo> object = validator.validate(project.getRootNode(), project);
 
-        int validationCode = ((Validator) validator).getMaxSeverity();
+        int validationCode = ((DefaultValidator) validator).getMaxSeverity();
 
         if (validationCode >= ValidationDisplayHandler.WARNING) {
 

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=911838&r1=911837&r2=911838&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:17:32 2010
@@ -26,6 +26,7 @@
 import org.apache.cayenne.project2.validate.DefaultValidator;
 import org.apache.cayenne.project2.validate.Validator;
 
+
 /**
  * A dependency injection (DI) module contributing configuration related to Cayenne
  * mapping project manipulation to a DI container.
@@ -40,6 +41,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);
+        binder.bind(Validator.class).to(DefaultValidator.class);
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DefaultValidator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DefaultValidator.java?rev=911838&r1=911837&r2=911838&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DefaultValidator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/DefaultValidator.java
Fri Feb 19 15:17:32 2010
@@ -23,7 +23,16 @@
 import org.apache.cayenne.configuration.ConfigurationNode;
 import org.apache.cayenne.project2.Project;
 
-public interface DefaultValidator {
+public class DefaultValidator implements Validator {
 
-    public List<ValidationInfo> validate(ConfigurationNode node, Project project);
+    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();
+    }
 }

Modified: cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/Validator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/Validator.java?rev=911838&r1=911837&r2=911838&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/Validator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-project-unpublished/src/main/java/org/apache/cayenne/project2/validate/Validator.java
Fri Feb 19 15:17:32 2010
@@ -23,16 +23,7 @@
 import org.apache.cayenne.configuration.ConfigurationNode;
 import org.apache.cayenne.project2.Project;
 
-public class Validator implements DefaultValidator {
+public interface Validator {
 
-    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();
-    }
+    public List<ValidationInfo> validate(ConfigurationNode node, Project project);
 }



Mime
View raw message