incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1059813 [6/10] - in /incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets: ./ actcoll/typeof/ actions/ actions/choices/ actions/debug/ actions/debug/annotation/ actions/defaults/ actions/describedas/ acti...
Date Mon, 17 Jan 2011 08:48:56 GMT
Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/update/UpdateCallbackFacetFactory.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/UpdateCallbackFacetFactory.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/update/UpdateCallbackFacetFactory.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/update/UpdateCallbackFacetFactory.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/UpdateCallbackFacetFactory.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/UpdateCallbackFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/update/UpdateCallbackFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.callbacks;
+package org.apache.isis.core.progmodel.facets.object.callbacks.update;
 
 import java.lang.reflect.Method;
 import java.util.ArrayList;
@@ -28,7 +28,8 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MethodRemover;
+import org.apache.isis.core.metamodel.methodutils.MethodScope;
+import org.apache.isis.core.progmodel.facets.MethodFinderUtils;
 import org.apache.isis.core.progmodel.facets.MethodPrefixBasedFacetFactoryAbstract;
 
 
@@ -40,29 +41,32 @@ public class UpdateCallbackFacetFactory 
     private static final String[] PREFIXES = { UPDATED_PREFIX, UPDATING_PREFIX, };
 
     public UpdateCallbackFacetFactory() {
-        super(PREFIXES, FeatureType.OBJECTS_ONLY);
+        super(FeatureType.OBJECTS_ONLY, PREFIXES);
     }
 
     @Override
-    public boolean process(final Class<?> cls, final MethodRemover remover, final FacetHolder facetHolder) {
+    public void process(ProcessClassContext processClassContext) {
+        final Class<?> cls = processClassContext.getCls();
+        final FacetHolder facetHolder = processClassContext.getFacetHolder();
+
         final List<Facet> facets = new ArrayList<Facet>();
         final List<Method> methods = new ArrayList<Method>();
 
         Method method = null;
-        method = findMethod(cls, OBJECT, UPDATING_PREFIX, void.class, NO_PARAMETERS_TYPES);
+        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, UPDATING_PREFIX, void.class, NO_PARAMETERS_TYPES);
         if (method != null) {
             methods.add(method);
             facets.add(new UpdatingCallbackFacetViaMethod(method, facetHolder));
         }
 
-        method = findMethod(cls, OBJECT, UPDATED_PREFIX, void.class, NO_PARAMETERS_TYPES);
+        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, UPDATED_PREFIX, void.class, NO_PARAMETERS_TYPES);
         if (method != null) {
             methods.add(method);
             facets.add(new UpdatedCallbackFacetViaMethod(method, facetHolder));
         }
 
-        remover.removeMethods(methods);
-        return FacetUtil.addFacets(facets);
+        processClassContext.removeMethods(methods);
+        FacetUtil.addFacets(facets);
     }
 
 }

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/update/UpdatedCallbackFacetAbstract.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/UpdatedCallbackFacetAbstract.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/update/UpdatedCallbackFacetAbstract.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/update/UpdatedCallbackFacetAbstract.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/UpdatedCallbackFacetAbstract.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/UpdatedCallbackFacetAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/update/UpdatedCallbackFacetAbstract.java Mon Jan 17 08:48:40 2011
@@ -18,11 +18,12 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.callbacks;
+package org.apache.isis.core.progmodel.facets.object.callbacks.update;
 
 import org.apache.isis.core.metamodel.facetapi.Facet;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.object.callbacks.UpdatedCallbackFacet;
+import org.apache.isis.core.progmodel.facets.object.callbacks.CallbackFacetAbstract;
 
 
 public abstract class UpdatedCallbackFacetAbstract extends CallbackFacetAbstract implements UpdatedCallbackFacet {

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/update/UpdatedCallbackFacetViaMethod.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/UpdatedCallbackFacetViaMethod.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/update/UpdatedCallbackFacetViaMethod.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/update/UpdatedCallbackFacetViaMethod.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/UpdatedCallbackFacetViaMethod.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/UpdatedCallbackFacetViaMethod.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/update/UpdatedCallbackFacetViaMethod.java Mon Jan 17 08:48:40 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.callbacks;
+package org.apache.isis.core.progmodel.facets.object.callbacks.update;
 
 import java.lang.reflect.Method;
 import java.util.ArrayList;

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/update/UpdatingCallbackFacetAbstract.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/UpdatingCallbackFacetAbstract.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/update/UpdatingCallbackFacetAbstract.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/update/UpdatingCallbackFacetAbstract.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/UpdatingCallbackFacetAbstract.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/UpdatingCallbackFacetAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/update/UpdatingCallbackFacetAbstract.java Mon Jan 17 08:48:40 2011
@@ -18,11 +18,12 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.callbacks;
+package org.apache.isis.core.progmodel.facets.object.callbacks.update;
 
 import org.apache.isis.core.metamodel.facetapi.Facet;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.object.callbacks.UpdatingCallbackFacet;
+import org.apache.isis.core.progmodel.facets.object.callbacks.CallbackFacetAbstract;
 
 
 public abstract class UpdatingCallbackFacetAbstract extends CallbackFacetAbstract implements UpdatingCallbackFacet {

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/update/UpdatingCallbackFacetViaMethod.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/UpdatingCallbackFacetViaMethod.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/update/UpdatingCallbackFacetViaMethod.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/update/UpdatingCallbackFacetViaMethod.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/UpdatingCallbackFacetViaMethod.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/UpdatingCallbackFacetViaMethod.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/callbacks/update/UpdatingCallbackFacetViaMethod.java Mon Jan 17 08:48:40 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.callbacks;
+package org.apache.isis.core.progmodel.facets.object.callbacks.update;
 
 import java.lang.reflect.Method;
 import java.util.ArrayList;

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/method/ClearDirtyObjectFacetViaMethod.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/ClearDirtyObjectFacetViaMethod.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/method/ClearDirtyObjectFacetViaMethod.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/method/ClearDirtyObjectFacetViaMethod.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/ClearDirtyObjectFacetViaMethod.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/ClearDirtyObjectFacetViaMethod.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/method/ClearDirtyObjectFacetViaMethod.java Mon Jan 17 08:48:40 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.dirty;
+package org.apache.isis.core.progmodel.facets.object.dirty.method;
 
 import java.lang.reflect.Method;
 import java.util.Collections;
@@ -28,6 +28,7 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.adapter.util.InvokeUtils;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.ImperativeFacet;
+import org.apache.isis.core.progmodel.facets.object.dirty.ClearDirtyObjectFacetAbstract;
 
 
 public class ClearDirtyObjectFacetViaMethod extends ClearDirtyObjectFacetAbstract implements ImperativeFacet {

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/method/DirtyMethodsFacetFactory.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/DirtyMethodsFacetFactory.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/method/DirtyMethodsFacetFactory.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/method/DirtyMethodsFacetFactory.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/DirtyMethodsFacetFactory.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/DirtyMethodsFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/method/DirtyMethodsFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.dirty;
+package org.apache.isis.core.progmodel.facets.object.dirty.method;
 
 import java.lang.reflect.Method;
 import java.util.ArrayList;
@@ -28,7 +28,8 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MethodRemover;
+import org.apache.isis.core.metamodel.methodutils.MethodScope;
+import org.apache.isis.core.progmodel.facets.MethodFinderUtils;
 import org.apache.isis.core.progmodel.facets.MethodPrefixBasedFacetFactoryAbstract;
 
 
@@ -42,33 +43,36 @@ public class DirtyMethodsFacetFactory ex
     private static final String[] PREFIXES = { MARK_DIRTY_PREFIX, CLEAR_DIRTY_PREFIX, IS_DIRTY_PREFIX, };
 
     public DirtyMethodsFacetFactory() {
-        super(PREFIXES, FeatureType.OBJECTS_ONLY);
+        super(FeatureType.OBJECTS_ONLY, PREFIXES);
 
     }
 
     @Override
-    public boolean process(final Class<?> cls, final MethodRemover methodRemover, final FacetHolder facetHolder) {
+    public void process(ProcessClassContext processClassContext) {
+        final FacetHolder facetHolder = processClassContext.getFacetHolder();
+        final Class<?> cls = processClassContext.getCls();
+
         final List<Facet> facets = new ArrayList<Facet>();
 
-        Method method = findMethod(cls, OBJECT, IS_DIRTY_PREFIX, boolean.class, NO_PARAMETERS_TYPES);
+        Method method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, IS_DIRTY_PREFIX, boolean.class, NO_PARAMETERS_TYPES);
         if (method != null) {
-            methodRemover.removeMethod(method);
+            processClassContext.removeMethod(method);
             facets.add(new IsDirtyObjectFacetViaMethod(method, facetHolder));
         }
 
-        method = findMethod(cls, OBJECT, CLEAR_DIRTY_PREFIX, void.class, NO_PARAMETERS_TYPES);
+        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, CLEAR_DIRTY_PREFIX, void.class, NO_PARAMETERS_TYPES);
         if (method != null) {
-            methodRemover.removeMethod(method);
+            processClassContext.removeMethod(method);
             facets.add(new ClearDirtyObjectFacetViaMethod(method, facetHolder));
         }
 
-        method = findMethod(cls, OBJECT, MARK_DIRTY_PREFIX, void.class, NO_PARAMETERS_TYPES);
+        method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MARK_DIRTY_PREFIX, void.class, NO_PARAMETERS_TYPES);
         if (method != null) {
-            methodRemover.removeMethod(method);
+            processClassContext.removeMethod(method);
             facets.add(new MarkDirtyObjectFacetViaMethod(method, facetHolder));
         }
 
-        return FacetUtil.addFacets(facets);
+        FacetUtil.addFacets(facets);
     }
 
 }

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/method/IsDirtyObjectFacetViaMethod.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/IsDirtyObjectFacetViaMethod.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/method/IsDirtyObjectFacetViaMethod.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/method/IsDirtyObjectFacetViaMethod.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/IsDirtyObjectFacetViaMethod.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/IsDirtyObjectFacetViaMethod.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/method/IsDirtyObjectFacetViaMethod.java Mon Jan 17 08:48:40 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.dirty;
+package org.apache.isis.core.progmodel.facets.object.dirty.method;
 
 import java.lang.reflect.Method;
 import java.util.Collections;
@@ -28,6 +28,7 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.adapter.util.InvokeUtils;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.ImperativeFacet;
+import org.apache.isis.core.progmodel.facets.object.dirty.IsDirtyObjectFacetAbstract;
 
 
 public class IsDirtyObjectFacetViaMethod extends IsDirtyObjectFacetAbstract implements ImperativeFacet {

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/method/MarkDirtyObjectFacetViaMethod.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/MarkDirtyObjectFacetViaMethod.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/method/MarkDirtyObjectFacetViaMethod.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/method/MarkDirtyObjectFacetViaMethod.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/MarkDirtyObjectFacetViaMethod.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/MarkDirtyObjectFacetViaMethod.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/dirty/method/MarkDirtyObjectFacetViaMethod.java Mon Jan 17 08:48:40 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.dirty;
+package org.apache.isis.core.progmodel.facets.object.dirty.method;
 
 import java.lang.reflect.Method;
 import java.util.Collections;
@@ -28,6 +28,7 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.adapter.util.InvokeUtils;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.ImperativeFacet;
+import org.apache.isis.core.progmodel.facets.object.dirty.MarkDirtyObjectFacetAbstract;
 
 
 public class MarkDirtyObjectFacetViaMethod extends MarkDirtyObjectFacetAbstract implements ImperativeFacet {

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/facets/FacetsFacetAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/facets/FacetsFacetAbstract.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/facets/FacetsFacetAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/facets/FacetsFacetAbstract.java Mon Jan 17 08:48:40 2011
@@ -27,8 +27,8 @@ import org.apache.isis.core.commons.exce
 import org.apache.isis.core.commons.factory.InstanceUtil;
 import org.apache.isis.core.metamodel.facetapi.Facet;
 import org.apache.isis.core.metamodel.facetapi.FacetAbstract;
-import org.apache.isis.core.metamodel.facetapi.FacetFactory;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.FacetFactory;
 import org.apache.isis.core.metamodel.facets.facets.FacetsFacet;
 
 

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/facets/annotation/FacetsAnnotationFacetFactory.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/facets/FacetsAnnotationFacetFactory.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/facets/annotation/FacetsAnnotationFacetFactory.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/facets/annotation/FacetsAnnotationFacetFactory.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/facets/FacetsAnnotationFacetFactory.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/facets/FacetsAnnotationFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/facets/annotation/FacetsAnnotationFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -18,13 +18,12 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.facets;
+package org.apache.isis.core.progmodel.facets.object.facets.annotation;
 
 import org.apache.isis.applib.annotation.Facets;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MethodRemover;
 import org.apache.isis.core.metamodel.facets.AnnotationBasedFacetFactoryAbstract;
 import org.apache.isis.core.metamodel.facets.facets.FacetsFacet;
 
@@ -36,9 +35,9 @@ public class FacetsAnnotationFacetFactor
     }
 
     @Override
-    public boolean process(final Class<?> cls, final MethodRemover methodRemover, final FacetHolder holder) {
-        final Facets annotation = (Facets) getAnnotation(cls, Facets.class);
-        return FacetUtil.addFacet(create(annotation, holder));
+    public void process(ProcessClassContext processClassContaxt) {
+        final Facets annotation = getAnnotation(processClassContaxt.getCls(), Facets.class);
+        FacetUtil.addFacet(create(annotation, processClassContaxt.getFacetHolder()));
     }
 
     /**

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/facets/annotation/FacetsFacetAnnotation.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/facets/FacetsFacetAnnotation.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/facets/annotation/FacetsFacetAnnotation.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/facets/annotation/FacetsFacetAnnotation.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/facets/FacetsFacetAnnotation.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/facets/FacetsFacetAnnotation.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/facets/annotation/FacetsFacetAnnotation.java Mon Jan 17 08:48:40 2011
@@ -18,10 +18,11 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.facets;
+package org.apache.isis.core.progmodel.facets.object.facets.annotation;
 
 import org.apache.isis.applib.annotation.Facets;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.progmodel.facets.object.facets.FacetsFacetAbstract;
 
 
 public class FacetsFacetAnnotation extends FacetsFacetAbstract {

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/icon/IconFacetAbstract.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/icon/IconFacetAbstract.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/icon/IconFacetAbstract.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/icon/IconFacetAbstract.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/icon/IconFacetAbstract.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/icon/IconFacetAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/icon/IconFacetAbstract.java Mon Jan 17 08:48:40 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.ident.icon;
+package org.apache.isis.core.progmodel.facets.object.icon;
 
 import org.apache.isis.core.metamodel.facetapi.Facet;
 import org.apache.isis.core.metamodel.facetapi.FacetAbstract;

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/icon/method/IconFacetViaMethod.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/icon/IconFacetViaMethod.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/icon/method/IconFacetViaMethod.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/icon/method/IconFacetViaMethod.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/icon/IconFacetViaMethod.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/icon/IconFacetViaMethod.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/icon/method/IconFacetViaMethod.java Mon Jan 17 08:48:40 2011
@@ -18,13 +18,14 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.ident.icon;
+package org.apache.isis.core.progmodel.facets.object.icon.method;
 
 import java.lang.reflect.Method;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.util.AdapterInvokeUtils;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.progmodel.facets.object.icon.IconFacetAbstract;
 
 
 public class IconFacetViaMethod extends IconFacetAbstract {

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/icon/method/IconMethodFacetFactory.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/icon/IconMethodFacetFactory.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/icon/method/IconMethodFacetFactory.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/icon/method/IconMethodFacetFactory.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/icon/IconMethodFacetFactory.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/icon/IconMethodFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/icon/method/IconMethodFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -18,14 +18,15 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.ident.icon;
+package org.apache.isis.core.progmodel.facets.object.icon.method;
 
 import java.lang.reflect.Method;
 
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MethodRemover;
+import org.apache.isis.core.metamodel.methodutils.MethodScope;
+import org.apache.isis.core.progmodel.facets.MethodFinderUtils;
 import org.apache.isis.core.progmodel.facets.MethodPrefixBasedFacetFactoryAbstract;
 
 
@@ -36,16 +37,19 @@ public class IconMethodFacetFactory exte
     private static final String[] PREFIXES = { ICON_NAME_PREFIX, };
 
     public IconMethodFacetFactory() {
-        super(PREFIXES, FeatureType.OBJECTS_ONLY);
+        super(FeatureType.OBJECTS_ONLY, PREFIXES);
     }
 
     @Override
-    public boolean process(final Class<?> cls, final MethodRemover methodRemover, final FacetHolder facetHolder) {
-        final Method method = findMethod(cls, OBJECT, ICON_NAME_PREFIX, String.class, NO_PARAMETERS_TYPES);
+    public void process(ProcessClassContext processClassContext) {
+        final Class<?> cls = processClassContext.getCls();
+        final FacetHolder facetHolder = processClassContext.getFacetHolder();
+
+        final Method method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, ICON_NAME_PREFIX, String.class, NO_PARAMETERS_TYPES);
         if (method == null) {
-            return false;
+            return;
         }
-        methodRemover.removeMethod(method);
-        return FacetUtil.addFacet(new IconFacetViaMethod(method, facetHolder));
+        processClassContext.removeMethod(method);
+        FacetUtil.addFacet(new IconFacetViaMethod(method, facetHolder));
     }
 }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/singular/SingularMethodFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/singular/SingularMethodFacetFactory.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/singular/SingularMethodFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/singular/SingularMethodFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -26,7 +26,8 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MethodRemover;
+import org.apache.isis.core.metamodel.methodutils.MethodScope;
+import org.apache.isis.core.progmodel.facets.MethodFinderUtils;
 import org.apache.isis.core.progmodel.facets.MethodPrefixBasedFacetFactoryAbstract;
 
 
@@ -37,18 +38,19 @@ public class SingularMethodFacetFactory 
     private static final String[] PREFIXES = { SINGULAR_NAME, };
 
     public SingularMethodFacetFactory() {
-        super(PREFIXES, FeatureType.OBJECTS_ONLY);
+        super(FeatureType.OBJECTS_ONLY, PREFIXES);
     }
 
     @Override
-    public boolean process(final Class<?> type, final MethodRemover methodRemover, final FacetHolder facetHolder) {
-        final Method method = findMethod(type, CLASS, SINGULAR_NAME, String.class, NO_PARAMETERS_TYPES);
+    public void process(ProcessClassContext processClassContext) {
+        final Class<?> cls = processClassContext.getCls();
+        final FacetHolder facetHolder = processClassContext.getFacetHolder();
+
+        final Method method = MethodFinderUtils.findMethod(cls, MethodScope.CLASS, SINGULAR_NAME, String.class, NO_PARAMETERS_TYPES);
         if (method != null) {
             final String name = (String) InvokeUtils.invokeStatic(method);
-            methodRemover.removeMethod(method);
-            return FacetUtil.addFacet(new NamedFacetViaMethod(name, facetHolder));
-        } else {
-            return false;
+            processClassContext.removeMethod(method);
+            FacetUtil.addFacet(new NamedFacetViaMethod(name, facetHolder));
         }
     }
 }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/title/TitleMethodFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/title/TitleMethodFacetFactory.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/title/TitleMethodFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/title/TitleMethodFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -26,8 +26,9 @@ import org.apache.isis.core.commons.lang
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MethodRemover;
+import org.apache.isis.core.metamodel.methodutils.MethodScope;
 import org.apache.isis.core.progmodel.facets.FallbackFacetFactory;
+import org.apache.isis.core.progmodel.facets.MethodFinderUtils;
 import org.apache.isis.core.progmodel.facets.MethodPrefixBasedFacetFactoryAbstract;
 
 
@@ -39,7 +40,7 @@ public class TitleMethodFacetFactory ext
     private static final String[] PREFIXES = { TO_STRING, TITLE, };
 
     public TitleMethodFacetFactory() {
-        super(PREFIXES, FeatureType.OBJECTS_ONLY);
+        super(FeatureType.OBJECTS_ONLY, PREFIXES);
     }
 
     /**
@@ -47,28 +48,31 @@ public class TitleMethodFacetFactory ext
      * instead.
      */
     @Override
-    public boolean process(final Class<?> type, final MethodRemover methodRemover, final FacetHolder facetHolder) {
+    public void process(ProcessClassContext processClassContext) {
+        final Class<?> cls = processClassContext.getCls();
+        final FacetHolder facetHolder = processClassContext.getFacetHolder();
 
-        Method method = findMethod(type, OBJECT, TITLE, String.class, null);
+
+        Method method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, TITLE, String.class, null);
         if (method != null) {
-            methodRemover.removeMethod(method);
-            return FacetUtil.addFacet(new TitleFacetViaTitleMethod(method, facetHolder));
+            processClassContext.removeMethod(method);
+            FacetUtil.addFacet(new TitleFacetViaTitleMethod(method, facetHolder));
+            return;
         }
 
         try {
-            method = findMethod(type, OBJECT, TO_STRING, String.class, null);
+            method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, TO_STRING, String.class, null);
             if (method == null) {
-                return false;
+                return;
             }
             if (JavaClassUtils.isJavaClass(method.getDeclaringClass())) {
-                return false;
+                return;
             }
-            methodRemover.removeMethod(method);
+            processClassContext.removeMethod(method);
             FacetUtil.addFacet(new TitleFacetViaToStringMethod(method, facetHolder));
-            return false;
 
         } catch (final Exception e) {
-            return false;
+            return;
         }
     }
 }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/immutable/DisabledFacetDerivedFromImmutable.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/immutable/DisabledFacetDerivedFromImmutable.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/immutable/DisabledFacetDerivedFromImmutable.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/immutable/DisabledFacetDerivedFromImmutable.java Mon Jan 17 08:48:40 2011
@@ -23,7 +23,7 @@ package org.apache.isis.core.progmodel.f
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.object.immutable.ImmutableFacet;
-import org.apache.isis.core.progmodel.facets.disable.DisabledFacetAbstract;
+import org.apache.isis.core.progmodel.facets.members.disable.DisabledFacetAbstract;
 
 
 public class DisabledFacetDerivedFromImmutable extends DisabledFacetAbstract {

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/immutable/ImmutableAnnotationFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/immutable/ImmutableAnnotationFacetFactory.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/immutable/ImmutableAnnotationFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/immutable/ImmutableAnnotationFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -20,13 +20,11 @@
 
 package org.apache.isis.core.progmodel.facets.object.immutable;
 
-import java.lang.reflect.Method;
 
 import org.apache.isis.applib.annotation.Immutable;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MethodRemover;
 import org.apache.isis.core.metamodel.facets.AnnotationBasedFacetFactoryAbstract;
 import org.apache.isis.core.metamodel.facets.When;
 import org.apache.isis.core.metamodel.facets.object.immutable.ImmutableFacet;
@@ -40,19 +38,18 @@ public class ImmutableAnnotationFacetFac
     }
 
     @Override
-    public boolean process(final Class<?> cls, final MethodRemover methodRemover, final FacetHolder holder) {
-        final Immutable annotation = getAnnotation(cls, Immutable.class);
-        return FacetUtil.addFacet(create(annotation, holder));
+    public void process(ProcessClassContext processClassContaxt) {
+        final Immutable annotation = getAnnotation(processClassContaxt.getCls(), Immutable.class);
+        FacetUtil.addFacet(create(annotation, processClassContaxt.getFacetHolder()));
     }
 
     @Override
-    public boolean process(Class<?> cls, final Method method, final MethodRemover methodRemover, final FacetHolder holder) {
-    	ObjectSpecification spec = getSpecificationLookup().loadSpecification(method.getDeclaringClass());
+    public void process(ProcessMethodContext processMethodContext) {
+    	ObjectSpecification spec = getSpecificationLookup().loadSpecification(processMethodContext.getMethod().getDeclaringClass());
         final ImmutableFacet immutableFacet = spec.getFacet(ImmutableFacet.class);
         if (immutableFacet != null && !immutableFacet.isNoop()) {
-            return FacetUtil.addFacet(new DisabledFacetDerivedFromImmutable(immutableFacet, holder));
+            FacetUtil.addFacet(new DisabledFacetDerivedFromImmutable(immutableFacet, processMethodContext.getFacetHolder()));
         }
-        return false;
     }
 
     private ImmutableFacet create(final Immutable annotation, final FacetHolder holder) {

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/immutable/ImmutableMarkerInterfacesFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/immutable/ImmutableMarkerInterfacesFacetFactory.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/immutable/ImmutableMarkerInterfacesFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/immutable/ImmutableMarkerInterfacesFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -20,17 +20,12 @@
 
 package org.apache.isis.core.progmodel.facets.object.immutable;
 
-import org.apache.isis.applib.marker.AlwaysImmutable;
-import org.apache.isis.applib.marker.ImmutableOncePersisted;
-import org.apache.isis.applib.marker.ImmutableUntilPersisted;
-import org.apache.isis.applib.marker.NeverImmutable;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MethodRemover;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
 import org.apache.isis.core.metamodel.facets.When;
 import org.apache.isis.core.metamodel.facets.object.immutable.ImmutableFacet;
-import org.apache.isis.core.metamodel.spec.FacetFactoryAbstract;
 
 
 public class ImmutableMarkerInterfacesFacetFactory extends FacetFactoryAbstract {
@@ -40,20 +35,11 @@ public class ImmutableMarkerInterfacesFa
     }
 
     @Override
-    public boolean process(final Class<?> cls, final MethodRemover methodRemover, final FacetHolder holder) {
-        When when = null;
-        if (AlwaysImmutable.class.isAssignableFrom(cls)) {
-            when = When.ALWAYS;
-        } else if (ImmutableOncePersisted.class.isAssignableFrom(cls)) {
-            when = When.ONCE_PERSISTED;
-        } else if (ImmutableUntilPersisted.class.isAssignableFrom(cls)) {
-            when = When.UNTIL_PERSISTED;
-        } else if (NeverImmutable.class.isAssignableFrom(cls)) {
-            when = When.NEVER;
-        }
-        return FacetUtil.addFacet(create(when, holder));
-    }
-
+    public void process(ProcessClassContext processClassContaxt) {
+        When when = When.forCorrespondingMarkerSubType(processClassContaxt.getCls());
+        FacetUtil.addFacet(create(when, processClassContaxt.getFacetHolder()));
+    }
+
     private ImmutableFacet create(final When when, final FacetHolder holder) {
         return when == null ? null : new ImmutableFacetMarkerInterface(when, holder);
     }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/notpersistable/NotPersistableAnnotationFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/notpersistable/NotPersistableAnnotationFacetFactory.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/notpersistable/NotPersistableAnnotationFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/notpersistable/NotPersistableAnnotationFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -20,13 +20,11 @@
 
 package org.apache.isis.core.progmodel.facets.object.notpersistable;
 
-import java.lang.reflect.Method;
 
 import org.apache.isis.applib.annotation.NotPersistable;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MethodRemover;
 import org.apache.isis.core.metamodel.facets.AnnotationBasedFacetFactoryAbstract;
 import org.apache.isis.core.metamodel.facets.object.notpersistable.InitiatedBy;
 import org.apache.isis.core.metamodel.facets.object.notpersistable.NotPersistableFacet;
@@ -39,29 +37,19 @@ public class NotPersistableAnnotationFac
     }
 
     @Override
-    public boolean process(final Class<?> cls, final MethodRemover methodRemover, final FacetHolder holder) {
-        final NotPersistable annotation = getAnnotation(cls, NotPersistable.class);
-        return FacetUtil.addFacet(create(annotation, holder));
+    public void process(ProcessClassContext processClassContaxt) {
+        final NotPersistable annotation = getAnnotation(processClassContaxt.getCls(), NotPersistable.class);
+        FacetUtil.addFacet(create(annotation, processClassContaxt.getFacetHolder()));
     }
 
     @Override
-    public boolean process(Class<?> cls, final Method method, final MethodRemover methodRemover, final FacetHolder holder) {
-        final NotPersistable annotation = getAnnotation(method, NotPersistable.class);
-        return FacetUtil.addFacet(create(annotation, holder));
+    public void process(ProcessMethodContext processMethodContext) {
+        final NotPersistable annotation = getAnnotation(processMethodContext.getMethod(), NotPersistable.class);
+        FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
     }
 
     private NotPersistableFacet create(final NotPersistable annotation, final FacetHolder holder) {
-        return annotation != null ? new NotPersistableFacetAnnotation(decodeBy(annotation.value()), holder) : null;
-    }
-
-    private InitiatedBy decodeBy(final NotPersistable.By by) {
-        if (by == NotPersistable.By.USER) {
-            return InitiatedBy.USER;
-        }
-        if (by == NotPersistable.By.USER_OR_PROGRAM) {
-            return InitiatedBy.USER_OR_PROGRAM;
-        }
-        return null;
+        return annotation != null ? new NotPersistableFacetAnnotation(InitiatedBy.decodeBy(annotation.value()), holder) : null;
     }
 
 }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/notpersistable/NotPersistableMarkerInterfacesFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/notpersistable/NotPersistableMarkerInterfacesFacetFactory.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/notpersistable/NotPersistableMarkerInterfacesFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/notpersistable/NotPersistableMarkerInterfacesFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -22,15 +22,12 @@ package org.apache.isis.core.progmodel.f
 
 import java.lang.reflect.Method;
 
-import org.apache.isis.applib.marker.NonPersistable;
-import org.apache.isis.applib.marker.ProgramPersistable;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MethodRemover;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
 import org.apache.isis.core.metamodel.facets.object.notpersistable.InitiatedBy;
 import org.apache.isis.core.metamodel.facets.object.notpersistable.NotPersistableFacet;
-import org.apache.isis.core.metamodel.spec.FacetFactoryAbstract;
 
 
 public class NotPersistableMarkerInterfacesFacetFactory extends FacetFactoryAbstract {
@@ -44,16 +41,11 @@ public class NotPersistableMarkerInterfa
     }
 
     @Override
-    public boolean process(final Class<?> type, final MethodRemover methodRemover, final FacetHolder holder) {
-        InitiatedBy initiatedBy = null;
-        if (ProgramPersistable.class.isAssignableFrom(type)) {
-            initiatedBy = InitiatedBy.USER;
-        } else if (NonPersistable.class.isAssignableFrom(type)) {
-            initiatedBy = InitiatedBy.USER_OR_PROGRAM;
-        }
-        return FacetUtil.addFacet(create(initiatedBy, holder));
-    }
-
+    public void process(ProcessClassContext processClassContaxt) {
+        InitiatedBy initiatedBy = InitiatedBy.forCorrespondingMarkerSubType(processClassContaxt.getCls());
+        FacetUtil.addFacet(create(initiatedBy, processClassContaxt.getFacetHolder()));
+    }
+
     private NotPersistableFacet create(final InitiatedBy initiatedBy, final FacetHolder holder) {
         return initiatedBy != null ? new NotPersistableFacetMarkerInterface(initiatedBy, holder) : null;
     }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/parseable/ParseableFacetAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/parseable/ParseableFacetAbstract.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/parseable/ParseableFacetAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/parseable/ParseableFacetAbstract.java Mon Jan 17 08:48:40 2011
@@ -28,7 +28,7 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.object.parseable.ParseableFacet;
 import org.apache.isis.core.metamodel.runtimecontext.DependencyInjector;
-import org.apache.isis.core.progmodel.facets.ClassUtil;
+import org.apache.isis.core.progmodel.util.ClassUtil;
 
 
 public abstract class ParseableFacetAbstract extends FacetAbstract implements ParseableFacet {

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/parseable/ParseableFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/parseable/ParseableFacetFactory.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/parseable/ParseableFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/parseable/ParseableFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -31,7 +31,6 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MethodRemover;
 import org.apache.isis.core.metamodel.facets.AnnotationBasedFacetFactoryAbstract;
 import org.apache.isis.core.metamodel.runtimecontext.DependencyInjector;
 import org.apache.isis.core.metamodel.runtimecontext.DependencyInjectorAware;
@@ -50,8 +49,8 @@ public class ParseableFacetFactory exten
     }
 
     @Override
-    public boolean process(final Class<?> cls, final MethodRemover methodRemover, final FacetHolder holder) {
-        return FacetUtil.addFacet(create(cls, holder));
+    public void process(ProcessClassContext processClassContaxt) {
+        FacetUtil.addFacet(create(processClassContaxt.getCls(), processClassContaxt.getFacetHolder()));
     }
 
     private ParseableFacetAbstract create(final Class<?> cls, final FacetHolder holder) {

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/annotation/PluralAnnotationFacetFactory.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/plural/PluralAnnotationFacetFactory.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/annotation/PluralAnnotationFacetFactory.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/annotation/PluralAnnotationFacetFactory.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/plural/PluralAnnotationFacetFactory.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/plural/PluralAnnotationFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/annotation/PluralAnnotationFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -18,13 +18,12 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.ident.plural;
+package org.apache.isis.core.progmodel.facets.object.plural.annotation;
 
 import org.apache.isis.applib.annotation.Plural;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MethodRemover;
 import org.apache.isis.core.metamodel.facets.AnnotationBasedFacetFactoryAbstract;
 import org.apache.isis.core.metamodel.facets.object.ident.plural.PluralFacet;
 
@@ -36,9 +35,9 @@ public class PluralAnnotationFacetFactor
     }
 
     @Override
-    public boolean process(final Class<?> cls, final MethodRemover methodRemover, final FacetHolder holder) {
-        final Plural annotation = getAnnotation(cls, Plural.class);
-        return FacetUtil.addFacet(create(annotation, holder));
+    public void process(ProcessClassContext processClassContaxt) {
+        final Plural annotation = getAnnotation(processClassContaxt.getCls(), Plural.class);
+        FacetUtil.addFacet(create(annotation, processClassContaxt.getFacetHolder()));
     }
 
     private PluralFacet create(final Plural annotation, final FacetHolder holder) {

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/annotation/PluralFacetAnnotation.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/plural/PluralFacetAnnotation.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/annotation/PluralFacetAnnotation.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/annotation/PluralFacetAnnotation.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/plural/PluralFacetAnnotation.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/plural/PluralFacetAnnotation.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/annotation/PluralFacetAnnotation.java Mon Jan 17 08:48:40 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.ident.plural;
+package org.apache.isis.core.progmodel.facets.object.plural.annotation;
 
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.object.ident.plural.PluralFacetAbstract;

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/staticmethod/PluralFacetViaMethod.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/plural/PluralFacetViaMethod.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/staticmethod/PluralFacetViaMethod.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/staticmethod/PluralFacetViaMethod.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/plural/PluralFacetViaMethod.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/plural/PluralFacetViaMethod.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/staticmethod/PluralFacetViaMethod.java Mon Jan 17 08:48:40 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.ident.plural;
+package org.apache.isis.core.progmodel.facets.object.plural.staticmethod;
 
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.object.ident.plural.PluralFacetAbstract;

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/staticmethod/PluralMethodFacetFactory.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/plural/PluralMethodFacetFactory.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/staticmethod/PluralMethodFacetFactory.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/staticmethod/PluralMethodFacetFactory.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/plural/PluralMethodFacetFactory.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/plural/PluralMethodFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/staticmethod/PluralMethodFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.ident.plural;
+package org.apache.isis.core.progmodel.facets.object.plural.staticmethod;
 
 import java.lang.reflect.Method;
 
@@ -26,7 +26,8 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MethodRemover;
+import org.apache.isis.core.metamodel.methodutils.MethodScope;
+import org.apache.isis.core.progmodel.facets.MethodFinderUtils;
 import org.apache.isis.core.progmodel.facets.MethodPrefixBasedFacetFactoryAbstract;
 
 
@@ -37,18 +38,19 @@ public class PluralMethodFacetFactory ex
     private static final String[] PREFIXES = { PLURAL_NAME, };
 
     public PluralMethodFacetFactory() {
-        super(PREFIXES, FeatureType.OBJECTS_ONLY);
+        super(FeatureType.OBJECTS_ONLY, PREFIXES);
     }
 
     @Override
-    public boolean process(final Class<?> type, final MethodRemover methodRemover, final FacetHolder facetHolder) {
-        final Method method = findMethod(type, CLASS, PLURAL_NAME, String.class, NO_PARAMETERS_TYPES);
+    public void process(ProcessClassContext processClassContext) {
+        final Class<?> type = processClassContext.getCls();
+        final FacetHolder facetHolder = processClassContext.getFacetHolder();
+
+        final Method method = MethodFinderUtils.findMethod(type, MethodScope.CLASS, PLURAL_NAME, String.class, NO_PARAMETERS_TYPES);
         if (method != null) {
             final String name = (String) InvokeUtils.invokeStatic(method);
-            methodRemover.removeMethod(method);
-            return FacetUtil.addFacet(new PluralFacetViaMethod(name, facetHolder));
-        } else {
-            return false;
+            processClassContext.removeMethod(method);
+            FacetUtil.addFacet(new PluralFacetViaMethod(name, facetHolder));
         }
     }
 }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validate/ValidateObjectViaValidateMethodFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validate/ValidateObjectViaValidateMethodFacetFactory.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validate/ValidateObjectViaValidateMethodFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validate/ValidateObjectViaValidateMethodFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -25,7 +25,8 @@ import java.lang.reflect.Method;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MethodRemover;
+import org.apache.isis.core.metamodel.methodutils.MethodScope;
+import org.apache.isis.core.progmodel.facets.MethodFinderUtils;
 import org.apache.isis.core.progmodel.facets.MethodPrefixBasedFacetFactoryAbstract;
 
 
@@ -36,20 +37,18 @@ public class ValidateObjectViaValidateMe
     private static final String[] PREFIXES = { VALIDATE_PREFIX, };
 
     public ValidateObjectViaValidateMethodFacetFactory() {
-        super(PREFIXES, FeatureType.OBJECTS_ONLY);
+        super(FeatureType.OBJECTS_ONLY, PREFIXES);
     }
 
     @Override
-    public boolean process(
-    		final Class<?> type, 
-    		final MethodRemover methodRemover, 
-    		final FacetHolder facetHolder) {
-        final Method method = findMethod(type, OBJECT, VALIDATE_PREFIX, String.class, NO_PARAMETERS_TYPES);
-        if (method != null) {
-            methodRemover.removeMethod(method);
-            return FacetUtil.addFacet(new ValidateObjectFacetViaValidateMethod(method, facetHolder));
-        } else {
-            return false;
+    public void process(ProcessClassContext processClassContext) {
+        final Class<?> cls = processClassContext.getCls();
+        final FacetHolder facetHolder = processClassContext.getFacetHolder();
+        
+        final Method method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, VALIDATE_PREFIX, String.class, NO_PARAMETERS_TYPES);
+        if (method != null) {
+            FacetUtil.addFacet(new ValidateObjectFacetViaValidateMethod(method, facetHolder));
+            processClassContext.removeMethod(method);
         }
     }
 }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validprops/ObjectValidPropertiesFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validprops/ObjectValidPropertiesFacetFactory.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validprops/ObjectValidPropertiesFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validprops/ObjectValidPropertiesFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -20,11 +20,9 @@
 
 package org.apache.isis.core.progmodel.facets.object.validprops;
 
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MethodRemover;
-import org.apache.isis.core.metamodel.spec.FacetFactoryAbstract;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
 
 
 public class ObjectValidPropertiesFacetFactory extends FacetFactoryAbstract {
@@ -34,7 +32,7 @@ public class ObjectValidPropertiesFacetF
     }
 
     @Override
-    public boolean process(final Class<?> cls, final MethodRemover methodRemover, final FacetHolder facetHolder) {
-        return FacetUtil.addFacet(new ObjectValidPropertiesFacetImpl(facetHolder));
+    public void process(ProcessClassContext processClassContaxt) {
+        FacetUtil.addFacet(new ObjectValidPropertiesFacetImpl(processClassContaxt.getFacetHolder()));
     }
 }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueFacetAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueFacetAbstract.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueFacetAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueFacetAbstract.java Mon Jan 17 08:48:40 2011
@@ -33,12 +33,12 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.MultipleValueFacetAbstract;
 import org.apache.isis.core.metamodel.facets.object.value.ValueFacet;
 import org.apache.isis.core.metamodel.runtimecontext.DependencyInjector;
-import org.apache.isis.core.progmodel.facets.ClassUtil;
-import org.apache.isis.core.progmodel.facets.object.defaults.DefaultedFacetUsingDefaultsProvider;
-import org.apache.isis.core.progmodel.facets.object.encodeable.EncodableFacetUsingEncoderDecoder;
+import org.apache.isis.core.progmodel.facets.defaults.DefaultedFacetUsingDefaultsProvider;
+import org.apache.isis.core.progmodel.facets.encodeable.EncodableFacetUsingEncoderDecoder;
 import org.apache.isis.core.progmodel.facets.object.ident.title.TitleFacetUsingParser;
 import org.apache.isis.core.progmodel.facets.object.parseable.ParseableFacetUsingParser;
-import org.apache.isis.core.progmodel.facets.propparam.typicallength.TypicalLengthFacetUsingParser;
+import org.apache.isis.core.progmodel.facets.propparam.typicallength.parser.TypicalLengthFacetUsingParser;
+import org.apache.isis.core.progmodel.util.ClassUtil;
 
 
 public abstract class ValueFacetAbstract extends MultipleValueFacetAbstract implements ValueFacet {

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueFacetFactory.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -32,7 +32,6 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MethodRemover;
 import org.apache.isis.core.metamodel.facets.AnnotationBasedFacetFactoryAbstract;
 import org.apache.isis.core.metamodel.facets.object.aggregated.AggregatedFacet;
 import org.apache.isis.core.metamodel.facets.object.encodeable.EncodableFacet;
@@ -84,8 +83,8 @@ public class ValueFacetFactory extends A
     }
 
     @Override
-    public boolean process(final Class<?> cls, final MethodRemover methodRemover, final FacetHolder holder) {
-        return FacetUtil.addFacet(create(cls, holder));
+    public void process(ProcessClassContext processClassContaxt) {
+        FacetUtil.addFacet(create(processClassContaxt.getCls(), processClassContaxt.getFacetHolder()));
     }
 
     /**

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/actionorder/ActionOrderAnnotationFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/actionorder/ActionOrderAnnotationFacetFactory.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/actionorder/ActionOrderAnnotationFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/actionorder/ActionOrderAnnotationFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -24,7 +24,6 @@ import org.apache.isis.applib.annotation
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MethodRemover;
 import org.apache.isis.core.metamodel.facets.AnnotationBasedFacetFactoryAbstract;
 import org.apache.isis.core.metamodel.facets.ordering.actionorder.ActionOrderFacet;
 
@@ -36,9 +35,9 @@ public class ActionOrderAnnotationFacetF
     }
 
     @Override
-    public boolean process(final Class<?> cls, final MethodRemover methodRemover, final FacetHolder facetHolder) {
-        final ActionOrder annotation = (ActionOrder) getAnnotation(cls, ActionOrder.class);
-        return FacetUtil.addFacet(create(annotation, facetHolder));
+    public void process(ProcessClassContext processClassContaxt) {
+        final ActionOrder annotation = getAnnotation(processClassContaxt.getCls(), ActionOrder.class);
+        FacetUtil.addFacet(create(annotation, processClassContaxt.getFacetHolder()));
     }
 
     private ActionOrderFacet create(final ActionOrder annotation, final FacetHolder facetHolder) {

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/fieldorder/FieldOrderAnnotationFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/fieldorder/FieldOrderAnnotationFacetFactory.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/fieldorder/FieldOrderAnnotationFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/fieldorder/FieldOrderAnnotationFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -24,7 +24,6 @@ import org.apache.isis.applib.annotation
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MethodRemover;
 import org.apache.isis.core.metamodel.facets.AnnotationBasedFacetFactoryAbstract;
 import org.apache.isis.core.metamodel.layout.ordermethod.FieldOrderFacet;
 
@@ -36,9 +35,9 @@ public class FieldOrderAnnotationFacetFa
     }
 
     @Override
-    public boolean process(final Class<?> cls, final MethodRemover methodRemover, final FacetHolder holder) {
-        final FieldOrder annotation = getAnnotation(cls, FieldOrder.class);
-        return FacetUtil.addFacet(create(annotation, holder));
+    public void process(ProcessClassContext processClassContaxt) {
+        final FieldOrder annotation = getAnnotation(processClassContaxt.getCls(), FieldOrder.class);
+        FacetUtil.addFacet(create(annotation, processClassContaxt.getFacetHolder()));
     }
 
     private FieldOrderFacet create(final FieldOrder annotation, final FacetHolder holder) {

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/memberorder/MemberOrderAnnotationFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/memberorder/MemberOrderAnnotationFacetFactory.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/memberorder/MemberOrderAnnotationFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/memberorder/MemberOrderAnnotationFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -20,13 +20,11 @@
 
 package org.apache.isis.core.progmodel.facets.ordering.memberorder;
 
-import java.lang.reflect.Method;
 
 import org.apache.isis.applib.annotation.MemberOrder;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MethodRemover;
 import org.apache.isis.core.metamodel.facets.AnnotationBasedFacetFactoryAbstract;
 import org.apache.isis.core.metamodel.facets.ordering.MemberOrderFacet;
 
@@ -38,10 +36,10 @@ public class MemberOrderAnnotationFacetF
     }
 
     @Override
-    public boolean process(Class<?> cls, final Method method, final MethodRemover methodRemover, final FacetHolder holder) {
+    public void process(ProcessMethodContext processMethodContext) {
         Class<MemberOrder> annotationClass = MemberOrder.class;
-		final MemberOrder annotation = getAnnotation(method, annotationClass);
-        return FacetUtil.addFacet(create(annotation, holder));
+		final MemberOrder annotation = getAnnotation(processMethodContext.getMethod(), annotationClass);
+        FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
     }
 
     private MemberOrderFacet create(final MemberOrder annotation, final FacetHolder holder) {

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/choices/ActionChoicesFacetAbstract.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/choices/ActionChoicesFacetAbstract.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/choices/ActionChoicesFacetAbstract.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/choices/ActionChoicesFacetAbstract.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/choices/ActionChoicesFacetAbstract.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/choices/ActionChoicesFacetAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/choices/ActionChoicesFacetAbstract.java Mon Jan 17 08:48:40 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.actions.choices;
+package org.apache.isis.core.progmodel.facets.param.choices;
 
 import org.apache.isis.core.metamodel.facetapi.Facet;
 import org.apache.isis.core.metamodel.facetapi.FacetAbstract;

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/choices/ActionChoicesFacetNone.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/choices/ActionChoicesFacetNone.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/choices/ActionChoicesFacetNone.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/choices/ActionChoicesFacetNone.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/choices/ActionChoicesFacetNone.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/choices/ActionChoicesFacetNone.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/choices/ActionChoicesFacetNone.java Mon Jan 17 08:48:40 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.actions.choices;
+package org.apache.isis.core.progmodel.facets.param.choices;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/choices/ActionParameterChoicesFacetAbstract.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/choices/ActionParameterChoicesFacetAbstract.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/choices/ActionParameterChoicesFacetAbstract.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/choices/ActionParameterChoicesFacetAbstract.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/choices/ActionParameterChoicesFacetAbstract.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/choices/ActionParameterChoicesFacetAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/choices/ActionParameterChoicesFacetAbstract.java Mon Jan 17 08:48:40 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.actions.choices;
+package org.apache.isis.core.progmodel.facets.param.choices;
 
 import org.apache.isis.core.metamodel.adapter.map.AdapterMap;
 import org.apache.isis.core.metamodel.facetapi.Facet;

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/choices/ActionParameterChoicesFacetNone.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/choices/ActionParameterChoicesFacetNone.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/choices/ActionParameterChoicesFacetNone.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/choices/ActionParameterChoicesFacetNone.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/choices/ActionParameterChoicesFacetNone.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/choices/ActionParameterChoicesFacetNone.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/choices/ActionParameterChoicesFacetNone.java Mon Jan 17 08:48:40 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.actions.choices;
+package org.apache.isis.core.progmodel.facets.param.choices;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.map.AdapterMap;

Added: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/choices/method/ActionChoicesFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/choices/method/ActionChoicesFacetFactory.java?rev=1059813&view=auto
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/choices/method/ActionChoicesFacetFactory.java (added)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/choices/method/ActionChoicesFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -0,0 +1,119 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.progmodel.facets.param.choices.method;
+
+import java.lang.reflect.Method;
+import java.util.List;
+
+import org.apache.isis.core.commons.lang.NameUtils;
+import org.apache.isis.core.metamodel.adapter.map.AdapterMap;
+import org.apache.isis.core.metamodel.adapter.map.AdapterMapAware;
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facetapi.FacetUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.methodutils.MethodScope;
+import org.apache.isis.core.progmodel.facets.MethodFinderUtils;
+import org.apache.isis.core.progmodel.facets.MethodPrefixBasedFacetFactoryAbstract;
+import org.apache.isis.core.progmodel.facets.MethodPrefixConstants;
+
+public class ActionChoicesFacetFactory extends MethodPrefixBasedFacetFactoryAbstract implements AdapterMapAware {
+
+    private static final String[] PREFIXES = { MethodPrefixConstants.CHOICES_PREFIX };
+
+    private AdapterMap adapterMap;
+
+    /**
+     * Note that the {@link Facet}s registered are the generic ones from noa-architecture (where they exist)
+     */
+    public ActionChoicesFacetFactory() {
+        super(FeatureType.ACTIONS_ONLY, PREFIXES);
+    }
+
+    // ///////////////////////////////////////////////////////
+    // Actions
+    // ///////////////////////////////////////////////////////
+
+    @Override
+    public void process(ProcessMethodContext processMethodContext) {
+        attachActionChoicesFacetIfParameterChoicesMethodIsFound(processMethodContext);
+    }
+
+    private void attachActionChoicesFacetIfParameterChoicesMethodIsFound(final ProcessMethodContext processMethodContext) {
+
+        final Method actionMethod = processMethodContext.getMethod();
+        final Class<?>[] actionParamTypes = actionMethod.getParameterTypes();
+
+        if (actionParamTypes.length <= 0) {
+            return;
+        }
+        
+        Method choicesMethod = null;
+        if (choicesMethod == null) {
+            choicesMethod = findChoicesMethodReturning(processMethodContext, Object[][].class);
+        }
+        if (choicesMethod == null) {
+            choicesMethod = findChoicesMethodReturning(processMethodContext, Object[].class);
+        }
+        if (choicesMethod == null) {
+            choicesMethod = findChoicesMethodReturning(processMethodContext, List.class);
+        }
+        if (choicesMethod == null) {
+            return;
+        }
+        processMethodContext.removeMethod(choicesMethod);
+
+        final Class<?> returnType = actionMethod.getReturnType();
+        final FacetHolder action = processMethodContext.getFacetHolder();
+        final ActionChoicesFacetViaMethod facet =
+            new ActionChoicesFacetViaMethod(choicesMethod, returnType, action, getSpecificationLookup(),
+                getAdapterMap());
+        FacetUtil.addFacet(facet);
+    }
+
+    protected Method findChoicesMethodReturning(final ProcessMethodContext processMethodContext,
+        final Class<?> returnType2) {
+        Method choicesMethod;
+        Class<?> cls = processMethodContext.getCls();
+
+        final Method actionMethod = processMethodContext.getMethod();
+        final MethodScope methodScope = MethodScope.scopeFor(actionMethod);
+        final String capitalizedName = NameUtils.capitalizeName(actionMethod.getName());
+
+        String name = MethodPrefixConstants.CHOICES_PREFIX + capitalizedName;
+        choicesMethod =
+            MethodFinderUtils.findMethod(cls, methodScope, name, returnType2, new Class[0]);
+        return choicesMethod;
+    }
+
+
+    // ///////////////////////////////////////////////////////////////
+    // Dependencies
+    // ///////////////////////////////////////////////////////////////
+
+    @Override
+    public void setAdapterMap(AdapterMap adapterMap) {
+        this.adapterMap = adapterMap;
+    }
+
+    protected AdapterMap getAdapterMap() {
+        return adapterMap;
+    }
+}



Mime
View raw message