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 [2/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

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/FallbackFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/FallbackFacetFactory.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/FallbackFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/FallbackFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -29,18 +29,17 @@ 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.facetedmethod.FacetedMethod;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
+import org.apache.isis.core.metamodel.facets.FacetedMethod;
 import org.apache.isis.core.metamodel.facets.TypedHolder;
-import org.apache.isis.core.metamodel.spec.FacetFactoryAbstract;
-import org.apache.isis.core.progmodel.facets.actions.choices.ActionChoicesFacetNone;
-import org.apache.isis.core.progmodel.facets.actions.defaults.ActionDefaultsFacetNone;
 import org.apache.isis.core.progmodel.facets.actions.executed.ExecutedFacetAtDefault;
+import org.apache.isis.core.progmodel.facets.describedas.DescribedAsFacetNone;
 import org.apache.isis.core.progmodel.facets.help.HelpFacetNone;
-import org.apache.isis.core.progmodel.facets.naming.describedas.DescribedAsFacetNone;
-import org.apache.isis.core.progmodel.facets.naming.named.NamedFacetNone;
+import org.apache.isis.core.progmodel.facets.named.NamedFacetNone;
 import org.apache.isis.core.progmodel.facets.object.ident.title.TitleFacetNone;
 import org.apache.isis.core.progmodel.facets.object.notpersistable.NotPersistableFacetNull;
+import org.apache.isis.core.progmodel.facets.param.choices.ActionChoicesFacetNone;
+import org.apache.isis.core.progmodel.facets.param.defaults.ActionDefaultsFacetNone;
 import org.apache.isis.core.progmodel.facets.propparam.multiline.MultiLineFacetNone;
 import org.apache.isis.core.progmodel.facets.propparam.validate.maxlength.MaxLengthFacetUnlimited;
 
@@ -79,57 +78,64 @@ public class FallbackFacetFactory extend
     }
 
     @Override
-    public boolean process(final Class<?> type, final MethodRemover methodRemover, final FacetHolder holder) {
-        return FacetUtil.addFacets(new Facet[] { new DescribedAsFacetNone(holder),
+    public void process(ProcessClassContext processClassContaxt) {
+        final FacetHolder facetHolder = processClassContaxt.getFacetHolder();
+        
+        final DescribedAsFacetNone describedAsFacet = new DescribedAsFacetNone(facetHolder);
+        final NotPersistableFacetNull notPersistableFacet = new NotPersistableFacetNull(facetHolder);
+        final TitleFacetNone titleFacet = new TitleFacetNone(facetHolder);
+        
+        final Facet[] facets = new Facet[] { 
+            describedAsFacet,
             // commenting these out, think this whole isNoop business is a little bogus
             // new ImmutableFacetNever(holder),
-            new NotPersistableFacetNull(holder), new TitleFacetNone(holder), });
+            notPersistableFacet, titleFacet, };
+        FacetUtil.addFacets(facets);
     }
 
     @Override
-    public boolean process(Class<?> cls, final Method method, final MethodRemover methodRemover,
-        final FacetHolder holder) {
+    public void process(ProcessMethodContext processMethodContext) {
         final List<Facet> facets = new ArrayList<Facet>();
 
-        if (holder instanceof FacetedMethod) {
-            facets.add(new NamedFacetNone(holder));
-            facets.add(new DescribedAsFacetNone(holder));
-            facets.add(new HelpFacetNone(holder));
+        if (processMethodContext.getFacetHolder() instanceof FacetedMethod) {
+            facets.add(new NamedFacetNone(processMethodContext.getFacetHolder()));
+            facets.add(new DescribedAsFacetNone(processMethodContext.getFacetHolder()));
+            facets.add(new HelpFacetNone(processMethodContext.getFacetHolder()));
             
-            FacetedMethod facetedMethod = (FacetedMethod) holder;
+            FacetedMethod facetedMethod = processMethodContext.getFacetHolder();
             final FeatureType featureType = facetedMethod.getFeatureType();
             if (featureType.isProperty()) {
-                facets.add(new MaxLengthFacetUnlimited(holder));
-                facets.add(new MultiLineFacetNone(true, holder));
+                facets.add(new MaxLengthFacetUnlimited(processMethodContext.getFacetHolder()));
+                facets.add(new MultiLineFacetNone(true, processMethodContext.getFacetHolder()));
             }
             if (featureType.isAction()) {
-                facets.add(new ExecutedFacetAtDefault(holder));
-                facets.add(new ActionDefaultsFacetNone(holder));
-                facets.add(new ActionChoicesFacetNone(holder));
+                facets.add(new ExecutedFacetAtDefault(processMethodContext.getFacetHolder()));
+                facets.add(new ActionDefaultsFacetNone(processMethodContext.getFacetHolder()));
+                facets.add(new ActionChoicesFacetNone(processMethodContext.getFacetHolder()));
             }
         }
 
-        return FacetUtil.addFacets(facets);
+        FacetUtil.addFacets(facets);
     }
 
     @Override
-    public boolean processParams(final Method method, final int paramNum, final FacetHolder holder) {
+    public void processParams(ProcessParameterContext processParameterContext) {
         final List<Facet> facets = new ArrayList<Facet>();
 
-        if (holder instanceof TypedHolder) {
+        if (processParameterContext.getFacetHolder() instanceof TypedHolder) {
 
-            TypedHolder typedHolder = (TypedHolder) holder;
+            TypedHolder typedHolder = processParameterContext.getFacetHolder();
             if (typedHolder.getFeatureType().isActionParameter()) {
-                facets.add(new NamedFacetNone(holder));
-                facets.add(new DescribedAsFacetNone(holder));
-                facets.add(new HelpFacetNone(holder));
-                facets.add(new MultiLineFacetNone(false, holder));
+                facets.add(new NamedFacetNone(processParameterContext.getFacetHolder()));
+                facets.add(new DescribedAsFacetNone(processParameterContext.getFacetHolder()));
+                facets.add(new HelpFacetNone(processParameterContext.getFacetHolder()));
+                facets.add(new MultiLineFacetNone(false, processParameterContext.getFacetHolder()));
                 
-                facets.add(new MaxLengthFacetUnlimited(holder));
+                facets.add(new MaxLengthFacetUnlimited(processParameterContext.getFacetHolder()));
             }
         }
 
-        return FacetUtil.addFacets(facets);
+        FacetUtil.addFacets(facets);
     }
 
 }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/MethodPrefixBasedFacetFactoryAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/MethodPrefixBasedFacetFactoryAbstract.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/MethodPrefixBasedFacetFactoryAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/MethodPrefixBasedFacetFactoryAbstract.java Mon Jan 17 08:48:40 2011
@@ -20,58 +20,26 @@
 
 package org.apache.isis.core.progmodel.facets;
 
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
+import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 
-import org.apache.isis.applib.security.UserMemento;
-import org.apache.isis.core.commons.lang.ListUtils;
-import org.apache.isis.core.metamodel.adapter.util.InvokeUtils;
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 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.MethodPrefixBasedFacetFactory;
-import org.apache.isis.core.metamodel.spec.FacetFactoryAbstract;
-import org.apache.isis.core.progmodel.facets.actions.DescribedAsFacetViaMethod;
-import org.apache.isis.core.progmodel.facets.actions.NamedFacetViaMethod;
-import org.apache.isis.core.progmodel.facets.disable.DisableForContextFacetViaMethod;
-import org.apache.isis.core.progmodel.facets.disable.DisableForSessionFacetViaMethod;
-import org.apache.isis.core.progmodel.facets.disable.DisabledFacetAlways;
-import org.apache.isis.core.progmodel.facets.hide.HiddenFacetAlways;
-import org.apache.isis.core.progmodel.facets.hide.HideForContextFacetViaMethod;
-import org.apache.isis.core.progmodel.facets.hide.HideForSessionFacetViaMethod;
 
 
 public abstract class MethodPrefixBasedFacetFactoryAbstract extends FacetFactoryAbstract implements MethodPrefixBasedFacetFactory {
 
-    protected static final boolean CLASS = true;
-    protected static final Object[] NO_PARAMETERS = new Object[0];
-    protected static final Class<?>[] NO_PARAMETERS_TYPES = new Class<?>[0];
-    protected static final boolean OBJECT = false;
-
-    private static final String DESCRIPTION_PREFIX = "description";
-    private static final String NAME_PREFIX = "name";
-
-    protected static final String VALIDATE_PREFIX = "validate";
-    protected static final String DEFAULT_PREFIX = "default";
-    protected static final String CHOICES_PREFIX = "choices";
-
-    private static final String ALWAYS_HIDE_PREFIX = "alwaysHide";
-    private static final String HIDE_FOR_SESSION_PREFIX = "hide";
-    private static final String HIDE_PREFIX = "hide";
-    private static final String PROTECT_PREFIX = "protect";
-    private static final String DISABLE_FOR_SESSION_PREFIX = "disable";
-    private static final String DISABLE_PREFIX = "disable";
-
-    private static final String[] PREFIXES = { DESCRIPTION_PREFIX, NAME_PREFIX, VALIDATE_PREFIX, DEFAULT_PREFIX, CHOICES_PREFIX,
-            ALWAYS_HIDE_PREFIX, HIDE_FOR_SESSION_PREFIX, HIDE_PREFIX, PROTECT_PREFIX, DISABLE_FOR_SESSION_PREFIX, DISABLE_PREFIX, };
-
     private final List<String> prefixes;
+
+    protected static final Object[] NO_PARAMETERS = new Object[0];
+    protected static final Class<?>[] NO_PARAMETERS_TYPES = new Class<?>[0];
+
 
-    public MethodPrefixBasedFacetFactoryAbstract(final String[] prefixes, final List<FeatureType> featureTypes) {
+    public MethodPrefixBasedFacetFactoryAbstract(final List<FeatureType> featureTypes, final String... prefixes) {
         super(featureTypes);
-        this.prefixes = ListUtils.merge(prefixes, PREFIXES);
+        this.prefixes = Collections.unmodifiableList(Arrays.asList(prefixes));
     }
 
     @Override
@@ -79,441 +47,4 @@ public abstract class MethodPrefixBasedF
         return prefixes;
     }
 
-    protected Method findMethodWithOrWithoutParameters(
-            final Class<?> type,
-            final boolean classMethod,
-            final String name,
-            final Class<?> returnType,
-            final Class<?>[] paramTypes) {
-        Method method = findMethod(type, classMethod, name, returnType, paramTypes);
-        if (method == null) {
-            method = findMethod(type, classMethod, name, returnType, NO_PARAMETERS_TYPES);
-        }
-        return method;
-    }
-
-    /**
-     * Returns a specific public methods that: have the specified prefix; have the specified return type, or
-     * void, if canBeVoid is true; and has the specified number of parameters. If the returnType is specified
-     * as null then the return type is ignored.
-     * 
-     * @param paramTypes
-     *            the set of parameters the method should have, if null then is ignored
-     */
-    protected Method findMethod(
-            final Class<?> type,
-            final boolean forClass,
-            final String name,
-            final Class<?> returnType,
-            final Class<?>[] paramTypes) {
-        Method method;
-        try {
-            method = type.getMethod(name, paramTypes);
-        } catch (final SecurityException e) {
-            return null;
-        } catch (final NoSuchMethodException e) {
-            return null;
-        }
-
-        final int modifiers = method.getModifiers();
-
-        // check for public modifier
-        if (!Modifier.isPublic(modifiers)) {
-            return null;
-        }
-
-        // check for static modifier
-        if (Modifier.isStatic(modifiers) != forClass) {
-            return null;
-        }
-
-        // check for name
-        if (!method.getName().equals(name)) {
-            return null;
-        }
-
-        // check for return type
-        if (returnType != null && returnType != method.getReturnType()) {
-            return null;
-        }
-
-        // check params (if required)
-        if (paramTypes != null) {
-            final Class<?>[] parameterTypes = method.getParameterTypes();
-            if (paramTypes.length != parameterTypes.length) {
-                return null;
-            }
-
-            for (int c = 0; c < paramTypes.length; c++) {
-                if ((paramTypes[c] != null) && (paramTypes[c] != parameterTypes[c])) {
-                    return null;
-                }
-            }
-        }
-
-        return method;
-    }
-
-    protected Method findMethod(
-    		final Class<?> type, 
-    		final boolean forClass, 
-    		final String name, 
-    		final Class<?> returnType) {
-        try {
-            final Method[] methods = type.getMethods();
-            for (int i = 0; i < methods.length; i++) {
-                final Method method = methods[i];
-                final int modifiers = method.getModifiers();
-                // check for public modifier
-                if (!Modifier.isPublic(modifiers)) {
-                    continue;
-                }
-
-                // check for static modifier
-                if (Modifier.isStatic(modifiers) != forClass) {
-                    continue;
-                }
-
-                // check for name
-                if (!method.getName().equals(name)) {
-                    continue;
-                }
-
-                // check for return type
-                if (returnType != null && returnType != method.getReturnType()) {
-                    continue;
-                }
-                return method;
-            }
-        } catch (final SecurityException e) {
-            return null;
-        }
-        return null;
-    }
-
-    protected void removeMethod(final MethodRemover methodRemover, final Method method) {
-        if (methodRemover != null && method != null) {
-            methodRemover.removeMethod(method);
-        }
-    }
-
-    protected Class<?>[] paramTypesOrNull(final Class<?> type) {
-        return type == null ? null : new Class[] { type };
-    }
-
-    protected void findAndRemoveNameMethod(
-            final List<Facet> facets,
-            final MethodRemover methodRemover,
-            final Class<?> type,
-            final String capitalizedName,
-            final FacetHolder facetHolder) {
-        findAndRemoveNameMethod(facets, methodRemover, type, capitalizedName, (Class<?>) null, facetHolder);
-    }
-
-    protected void findAndRemoveNameMethod(
-            final List<Facet> facets,
-            final MethodRemover methodRemover,
-            final Class<?> type,
-            final String capitalizedName,
-            final Class<?> paramType,
-            final FacetHolder facetHolder) {
-        findAndRemoveNameMethod(facets, methodRemover, type, capitalizedName, paramTypesOrNull(paramType), facetHolder);
-    }
-
-    protected void findAndRemoveNameMethod(
-            final List<Facet> facets,
-            final MethodRemover methodRemover,
-            final Class<?> type,
-            final String capitalizedName,
-            final Class<?>[] paramTypes,
-            final FacetHolder facetHolder) {
-        final Method method = findMethod(type, CLASS, NAME_PREFIX + capitalizedName, String.class, paramTypes);
-
-        if (method == null) {
-            return;
-        }
-
-        methodRemover.removeMethod(method);
-        final String name = (String) InvokeUtils.invokeStatic(method);
-        facets.add(new NamedFacetViaMethod(name, method, facetHolder));
-    }
-
-    protected void findAndRemoveDescriptionMethod(
-            final List<Facet> facets,
-            final MethodRemover methodRemover,
-            final Class<?> type,
-            final String capitalizedName,
-            final FacetHolder facetHolder) {
-        findAndRemoveDescriptionMethod(facets, methodRemover, type, capitalizedName, (Class<?>) null, facetHolder);
-    }
-
-    protected void findAndRemoveDescriptionMethod(
-            final List<Facet> facets,
-            final MethodRemover methodRemover,
-            final Class<?> type,
-            final String capitalizedName,
-            final Class<?> paramType,
-            final FacetHolder facetHolder) {
-        findAndRemoveDescriptionMethod(facets, methodRemover, type, capitalizedName, paramTypesOrNull(paramType), facetHolder);
-    }
-
-    protected void findAndRemoveDescriptionMethod(
-            final List<Facet> facets,
-            final MethodRemover methodRemover,
-            final Class<?> type,
-            final String capitalizedName,
-            final Class<?>[] paramTypes,
-            final FacetHolder facetHolder) {
-        Method method;
-        method = findMethod(type, CLASS, DESCRIPTION_PREFIX + capitalizedName, String.class, paramTypes);
-        if (method == null) {
-            return;
-        }
-
-        methodRemover.removeMethod(method);
-        final String description = (String) InvokeUtils.invokeStatic(method);
-        facets.add(new DescribedAsFacetViaMethod(description, method, facetHolder));
-    }
-
-    protected void findAndRemoveAlwaysHideMethod(
-            final List<Facet> facets,
-            final MethodRemover methodRemover,
-            final Class<?> type,
-            final String name,
-            final FacetHolder facetHolder) {
-        findAndRemoveAlwaysHideMethod(facets, methodRemover, type, name, (Class<?>) null, facetHolder);
-    }
-
-    protected void findAndRemoveAlwaysHideMethod(
-            final List<Facet> facets,
-            final MethodRemover methodRemover,
-            final Class<?> type,
-            final String name,
-            final Class<?> paramType,
-            final FacetHolder facetHolder) {
-        findAndRemoveAlwaysHideMethod(facets, methodRemover, type, name, paramTypesOrNull(paramType), facetHolder);
-    }
-
-    protected void findAndRemoveAlwaysHideMethod(
-            final List<Facet> facets,
-            final MethodRemover methodRemover,
-            final Class<?> type,
-            final String name,
-            final Class<?>[] paramTypes,
-            final FacetHolder facetHolder) {
-
-        final Method method = findMethodWithOrWithoutParameters(type, CLASS, ALWAYS_HIDE_PREFIX + name, boolean.class, paramTypes);
-        if (method == null) {
-            return;
-        }
-
-        methodRemover.removeMethod(method);
-
-        final Boolean alwaysHideMethodReturnValue = (Boolean) InvokeUtils.invokeStatic(method);
-        if (!alwaysHideMethodReturnValue.booleanValue()) {
-            return;
-        }
-        facets.add(new HiddenFacetAlways(facetHolder));
-    }
-
-    protected void findAndRemoveProtectMethod(
-            final List<Facet> facets,
-            final MethodRemover methodRemover,
-            final Class<?> type,
-            final String name,
-            final FacetHolder facetHolder) {
-        findAndRemoveProtectMethod(facets, methodRemover, type, name, (Class<?>) null, facetHolder);
-    }
-
-    protected void findAndRemoveProtectMethod(
-            final List<Facet> facets,
-            final MethodRemover methodRemover,
-            final Class<?> type,
-            final String name,
-            final Class<?> paramType,
-            final FacetHolder facetHolder) {
-        findAndRemoveProtectMethod(facets, methodRemover, type, name, paramTypesOrNull(paramType), facetHolder);
-    }
-
-    protected void findAndRemoveProtectMethod(
-            final List<Facet> facets,
-            final MethodRemover methodRemover,
-            final Class<?> type,
-            final String name,
-            final Class<?>[] paramTypes,
-            final FacetHolder facetHolder) {
-
-        final Method method = findMethodWithOrWithoutParameters(type, CLASS, PROTECT_PREFIX + name, boolean.class, paramTypes);
-        if (method == null) {
-            return;
-        }
-
-        methodRemover.removeMethod(method);
-
-        final Boolean protectMethodReturnValue = (Boolean) InvokeUtils.invokeStatic(method);
-        if (!protectMethodReturnValue.booleanValue()) {
-            return;
-        }
-        facets.add(new DisabledFacetAlways(facetHolder));
-    }
-
-    protected void findAndRemoveDisableMethod(
-            final List<Facet> facets,
-            final MethodRemover methodRemover,
-            final Class<?> type,
-            final boolean onClass,
-            final String capitalizedName,
-            final FacetHolder facetHolder) {
-        findAndRemoveDisableMethod(facets, methodRemover, type, onClass, capitalizedName, (Class<?>) null, facetHolder);
-    }
-
-    protected void findAndRemoveDisableMethod(
-            final List<Facet> facets,
-            final MethodRemover methodRemover,
-            final Class<?> type,
-            final boolean onClass,
-            final String capitalizedName,
-            final Class<?> paramType,
-            final FacetHolder facetHolder) {
-        findAndRemoveDisableMethod(facets, methodRemover, type, onClass, capitalizedName, paramTypesOrNull(paramType), facetHolder);
-    }
-
-    protected void findAndRemoveDisableMethod(
-            final List<Facet> facets,
-            final MethodRemover methodRemover,
-            final Class<?> type,
-            final boolean onClass,
-            final String capitalizedName,
-            final Class<?>[] paramTypes,
-            final FacetHolder facetHolder) {
-
-        Method method = findMethodWithOrWithoutParameters(type, onClass, DISABLE_PREFIX + capitalizedName, String.class,
-                paramTypes);
-        if (method == null) {
-        	method = findMethodWithOrWithoutParameters(type, onClass, DISABLE_PREFIX + capitalizedName, String.class,
-        			new Class[]{});
-        }
-        if (method == null) {
-            return;
-        }
-
-        methodRemover.removeMethod(method);
-        facets.add(new DisableForContextFacetViaMethod(method, facetHolder));
-    }
-
-    protected void findAndRemoveHideMethod(
-            final List<Facet> facets,
-            final MethodRemover methodRemover,
-            final Class<?> type,
-            final boolean onClass,
-            final String capitalizedName,
-            final FacetHolder facetHolder) {
-        findAndRemoveHideMethod(facets, methodRemover, type, onClass, capitalizedName, (Class<?>) null, facetHolder);
-    }
-
-    protected void findAndRemoveHideMethod(
-            final List<Facet> facets,
-            final MethodRemover methodRemover,
-            final Class<?> type,
-            final boolean onClass,
-            final String capitalizedName,
-            final Class<?> collectionType,
-            final FacetHolder facetHolder) {
-        findAndRemoveHideMethod(facets, methodRemover, type, onClass, capitalizedName, paramTypesOrNull(collectionType),
-                facetHolder);
-    }
-
-    protected void findAndRemoveHideMethod(
-            final List<Facet> facets,
-            final MethodRemover methodRemover,
-            final Class<?> type,
-            final boolean onClass,
-            final String capitalizedName,
-            final Class<?>[] paramTypes,
-            final FacetHolder facetHolder) {
-
-        Method method = findMethod(type, onClass, HIDE_PREFIX + capitalizedName, boolean.class, paramTypes);
-        if (method == null) {
-        	method = findMethod(type, onClass, HIDE_PREFIX + capitalizedName, boolean.class, new Class[]{});
-        }
-        if (method == null) {
-            return;
-        }
-
-        methodRemover.removeMethod(method);
-        facets.add(new HideForContextFacetViaMethod(method, facetHolder));
-    }
-
-    protected void findAndRemoveHideForSessionMethod(
-            final List<Facet> facets,
-            final MethodRemover methodRemover,
-            final Class<?> type,
-            final String capitalizedName,
-            final Class<?> paramType,
-            final FacetHolder facetHolder) {
-        findAndRemoveHideForSessionMethod(facets, methodRemover, type, capitalizedName, paramTypesOrNull(paramType), facetHolder);
-    }
-
-    protected void findAndRemoveHideForSessionMethod(
-            final List<Facet> facets,
-            final MethodRemover methodRemover,
-            final Class<?> type,
-            final String capitalizedName,
-            final Class<?>[] paramTypes,
-            final FacetHolder facetHolder) {
-
-        final Class<?>[] sessionParams = new Class[paramTypes.length + 1];
-        sessionParams[0] = UserMemento.class;
-        System.arraycopy(paramTypes, 0, sessionParams, 1, paramTypes.length);
-        Method method = findMethod(type, CLASS, HIDE_FOR_SESSION_PREFIX + capitalizedName, boolean.class, sessionParams);
-        if (method == null && paramTypes.length > 0) {
-            method = findMethod(type, CLASS, HIDE_FOR_SESSION_PREFIX + capitalizedName, boolean.class,
-                    new Class[] { UserMemento.class });
-        }
-
-        if (method == null) {
-            return;
-        }
-
-        methodRemover.removeMethod(method);
-        facets.add(new HideForSessionFacetViaMethod(method, facetHolder));
-    }
-
-    protected void findAndRemoveDisableForSessionMethod(
-            final List<Facet> facets,
-            final MethodRemover methodRemover,
-            final Class<?> type,
-            final String capitalizedName,
-            final Class<?> paramType,
-            final FacetHolder facetHolder) {
-        findAndRemoveDisableForSessionMethod(facets, methodRemover, type, capitalizedName, paramTypesOrNull(paramType),
-                facetHolder);
-    }
-
-    protected void findAndRemoveDisableForSessionMethod(
-            final List<Facet> facets,
-            final MethodRemover methodRemover,
-            final Class<?> type,
-            final String capitalizedName,
-            final Class<?>[] paramTypes,
-            final FacetHolder facetHolder) {
-
-        final Class<?>[] sessionParams = new Class[paramTypes.length + 1];
-        sessionParams[0] = UserMemento.class;
-        System.arraycopy(paramTypes, 0, sessionParams, 1, paramTypes.length);
-
-        Method method = findMethod(type, CLASS, DISABLE_FOR_SESSION_PREFIX + capitalizedName, String.class, sessionParams);
-        if (method == null && paramTypes.length > 0) {
-            method = findMethod(type, CLASS, DISABLE_FOR_SESSION_PREFIX + capitalizedName, String.class,
-                    new Class[] { UserMemento.class });
-        }
-
-        if (method == null) {
-            return;
-        }
-
-        methodRemover.removeMethod(method);
-        facets.add(new DisableForSessionFacetViaMethod(method, facetHolder));
-    }
-
 }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/PropertyOrCollectionIdentifyingFacetFactoryAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/PropertyOrCollectionIdentifyingFacetFactoryAbstract.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/PropertyOrCollectionIdentifyingFacetFactoryAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/PropertyOrCollectionIdentifyingFacetFactoryAbstract.java Mon Jan 17 08:48:40 2011
@@ -22,8 +22,8 @@ package org.apache.isis.core.progmodel.f
 
 import java.util.List;
 
-import org.apache.isis.core.metamodel.facetapi.FacetFactory;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.FacetFactory;
 import org.apache.isis.core.metamodel.facets.PropertyOrCollectionIdentifyingFacetFactory;
 import org.apache.isis.core.metamodel.specloader.collectiontyperegistry.CollectionTypeRegistry;
 import org.apache.isis.core.metamodel.specloader.collectiontyperegistry.CollectionTypeRegistryAware;
@@ -35,9 +35,9 @@ public abstract class PropertyOrCollecti
     private CollectionTypeRegistry collectionTypeRegistry;
 
     public PropertyOrCollectionIdentifyingFacetFactoryAbstract(
-            final String[] prefixes,
-            final List<FeatureType> featureTypes) {
-        super(prefixes, featureTypes);
+            final List<FeatureType> featureTypes,
+            final String... prefixes) {
+        super(featureTypes, prefixes);
     }
 
     protected boolean isCollectionOrArray(final Class<?> cls) {

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actcoll/typeof/TypeOfAnnotationFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actcoll/typeof/TypeOfAnnotationFacetFactory.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actcoll/typeof/TypeOfAnnotationFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actcoll/typeof/TypeOfAnnotationFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -20,16 +20,13 @@
 
 package org.apache.isis.core.progmodel.facets.actcoll.typeof;
 
-import java.lang.reflect.Method;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
 import java.lang.reflect.TypeVariable;
 
 import org.apache.isis.applib.annotation.TypeOf;
-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.specloader.collectiontyperegistry.CollectionTypeRegistry;
 import org.apache.isis.core.metamodel.specloader.collectiontyperegistry.CollectionTypeRegistryAware;
@@ -43,50 +40,51 @@ public class TypeOfAnnotationFacetFactor
     }
 
     @Override
-    public boolean process(Class<?> cls, final Method method, final MethodRemover methodRemover, final FacetHolder holder) {
+    public void process(ProcessMethodContext processMethodContext) {
 
-        final TypeOf annotation = getAnnotation(method, TypeOf.class);
+        final TypeOf annotation = getAnnotation(processMethodContext.getMethod(), TypeOf.class);
 
-        final Class<?> methodReturnType = method.getReturnType();
+        final Class<?> methodReturnType = processMethodContext.getMethod().getReturnType();
         if (!collectionTypeRegistry.isCollectionType(methodReturnType) && !collectionTypeRegistry.isArrayType(methodReturnType)) {
-            return false;
+            return;
         }
 
-        final Class<?> returnType = method.getReturnType();
+        final Class<?> returnType = processMethodContext.getMethod().getReturnType();
         if (returnType.isArray()) {
             final Class<?> componentType = returnType.getComponentType();
-            FacetUtil.addFacet(new TypeOfFacetInferredFromArray(componentType, holder, getSpecificationLookup()));
-            return false;
+            FacetUtil.addFacet(new TypeOfFacetInferredFromArray(componentType, processMethodContext.getFacetHolder(), getSpecificationLookup()));
+            return;
         }
 
         if (annotation != null) {
-            return FacetUtil.addFacet(new TypeOfFacetViaAnnotation(annotation.value(), holder, getSpecificationLookup()));
+            FacetUtil.addFacet(new TypeOfFacetViaAnnotation(annotation.value(), processMethodContext.getFacetHolder(), getSpecificationLookup()));
+            return;
         }
 
-        final Type type = method.getGenericReturnType();
+        final Type type = processMethodContext.getMethod().getGenericReturnType();
         if (!(type instanceof ParameterizedType)) {
-            return false;
+            return;
         }
 
         final ParameterizedType parameterizedType = (ParameterizedType) type;
         final Type[] actualTypeArguments = parameterizedType.getActualTypeArguments();
         if (actualTypeArguments.length == 0) {
-            return false;
+            return;
         }
 
         final Object actualTypeArgument = actualTypeArguments[0];
         if (actualTypeArgument instanceof Class) {
             final Class<?> actualType = (Class<?>) actualTypeArgument;
-            return FacetUtil.addFacet(new TypeOfFacetInferredFromGenerics(actualType, holder, getSpecificationLookup()));
+            FacetUtil.addFacet(new TypeOfFacetInferredFromGenerics(actualType, processMethodContext.getFacetHolder(), getSpecificationLookup()));
+            return;
         }
 
         if (actualTypeArgument instanceof TypeVariable) {
 
             // TODO: what to do here?
-            return false;
+            return;
         }
 
-        return false;
     }
 
     @Override

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/debug/annotation/DebugAnnotationFacetFactory.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/debug/DebugAnnotationFacetFactory.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/debug/annotation/DebugAnnotationFacetFactory.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/debug/annotation/DebugAnnotationFacetFactory.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/debug/DebugAnnotationFacetFactory.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/debug/DebugAnnotationFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/debug/annotation/DebugAnnotationFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -18,19 +18,22 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.actions.debug;
+package org.apache.isis.core.progmodel.facets.actions.debug.annotation;
 
-import java.lang.reflect.Method;
 
 import org.apache.isis.applib.annotation.Debug;
 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.actions.debug.DebugFacet;
+import org.apache.isis.core.progmodel.facets.actions.invoke.ActionInvocationFacetFactory;
 
-
+
+/**
+ * {@link DebugFacet} can also be installed via a naming convention, see
+ * {@link ActionInvocationFacetFactory}.
+ */
 public class DebugAnnotationFacetFactory extends AnnotationBasedFacetFactoryAbstract {
 
     public DebugAnnotationFacetFactory() {
@@ -38,9 +41,9 @@ public class DebugAnnotationFacetFactory
     }
 
     @Override
-    public boolean process(Class<?> cls, final Method method, final MethodRemover methodRemover, final FacetHolder holder) {
-        final Debug annotation = getAnnotation(method, Debug.class);
-        return FacetUtil.addFacet(create(annotation, holder));
+    public void process(ProcessMethodContext processMethodContext) {
+        final Debug annotation = getAnnotation(processMethodContext.getMethod(), Debug.class);
+        FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
     }
 
     private DebugFacet create(final Debug annotation, final FacetHolder holder) {

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

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/executed/annotation/ExecutedAnnotationFacetFactory.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/executed/ExecutedAnnotationFacetFactory.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/executed/annotation/ExecutedAnnotationFacetFactory.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/executed/annotation/ExecutedAnnotationFacetFactory.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/executed/ExecutedAnnotationFacetFactory.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/executed/ExecutedAnnotationFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/executed/annotation/ExecutedAnnotationFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -18,22 +18,25 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.actions.executed;
+package org.apache.isis.core.progmodel.facets.actions.executed.annotation;
 
-import java.lang.reflect.Method;
 
 import org.apache.isis.applib.annotation.Executed;
 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.actions.executed.ExecutedFacet;
+import org.apache.isis.core.progmodel.facets.actions.invoke.ActionInvocationFacetFactory;
 
 
 /**
- * Creates an {@link ExecutedFacet} bsaed on the presence of an {@link Executed} annotation.
- */
+ * Creates an {@link ExecutedFacet} based on the presence of an {@link Executed} annotation.
+ * 
+ * <p>
+ * {@link ExecutedFacet} can also be installed via a naming convention, see
+ * {@link ActionInvocationFacetFactory}.
+ */
 public class ExecutedAnnotationFacetFactory extends AnnotationBasedFacetFactoryAbstract {
 
     public ExecutedAnnotationFacetFactory() {
@@ -41,9 +44,9 @@ public class ExecutedAnnotationFacetFact
     }
 
     @Override
-    public boolean process(Class<?> cls, final Method method, final MethodRemover methodRemover, final FacetHolder holder) {
-        final Executed annotation = getAnnotation(method, Executed.class);
-        return FacetUtil.addFacet(create(annotation, holder));
+    public void process(ProcessMethodContext processMethodContext) {
+        final Executed annotation = getAnnotation(processMethodContext.getMethod(), Executed.class);
+        FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
     }
 
     private ExecutedFacet create(final Executed annotation, final FacetHolder holder) {

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

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/executed/prefix/ExecutedViaNamingConventionFacetFactory.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/executed/ExecutedViaNamingConventionFacetFactory.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/executed/prefix/ExecutedViaNamingConventionFacetFactory.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/executed/prefix/ExecutedViaNamingConventionFacetFactory.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/executed/ExecutedViaNamingConventionFacetFactory.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/executed/ExecutedViaNamingConventionFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/executed/prefix/ExecutedViaNamingConventionFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -18,27 +18,25 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.actions.executed;
+package org.apache.isis.core.progmodel.facets.actions.executed.prefix;
 
 import java.lang.reflect.Method;
 
 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.facetapi.MethodRemover;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
 import org.apache.isis.core.metamodel.facets.actions.executed.ExecutedFacet;
 import org.apache.isis.core.metamodel.facets.naming.named.NamedFacetInferred;
-import org.apache.isis.core.metamodel.spec.FacetFactoryAbstract;
-import org.apache.isis.core.progmodel.facets.actions.ActionMethodsFacetFactory;
-import org.apache.isis.core.progmodel.facets.actions.ExecutedFacetViaNamingConvention;
+import org.apache.isis.core.progmodel.facets.actions.invoke.ActionInvocationFacetFactory;
+import org.apache.isis.core.progmodel.facets.actions.invoke.ExecutedFacetViaNamingConvention;
 
 
 /**
  * Creates an {@link ExecutedFacet} based on the prefix of the action's name.
  * 
  * <p>
- * TODO: think that this prefix is handled by the {@link ActionMethodsFacetFactory}.
+ * TODO: think that this prefix is handled by the {@link ActionInvocationFacetFactory}.
  */
 public class ExecutedViaNamingConventionFacetFactory extends FacetFactoryAbstract {
 
@@ -49,16 +47,16 @@ public class ExecutedViaNamingConvention
     }
 
     @Override
-    public boolean process(Class<?> cls, final Method method, final MethodRemover methodRemover, final FacetHolder holder) {
-        final String fullMethodName = method.getName();
+    public void process(ProcessMethodContext processMethodContext) {
+        final String fullMethodName = processMethodContext.getMethod().getName();
         final String capitalizedName = fullMethodName.substring(0, 1).toUpperCase() + fullMethodName.substring(1);
 
         if (!capitalizedName.startsWith(LOCAL_PREFIX)) {
-            return false;
+            return;
         }
 
-        return FacetUtil.addFacets(new Facet[] { new ExecutedFacetViaNamingConvention(ExecutedFacet.Where.LOCALLY, holder),
-                new NamedFacetInferred(capitalizedName.substring(5), holder) });
+        FacetUtil.addFacets(new Facet[] { new ExecutedFacetViaNamingConvention(ExecutedFacet.Where.LOCALLY, processMethodContext.getFacetHolder()),
+                new NamedFacetInferred(capitalizedName.substring(5), processMethodContext.getFacetHolder()) });
     }
 
     public boolean recognizes(final Method method) {

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/exploration/annotation/ExplorationAnnotationFacetFactory.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/exploration/ExplorationAnnotationFacetFactory.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/exploration/annotation/ExplorationAnnotationFacetFactory.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/exploration/annotation/ExplorationAnnotationFacetFactory.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/exploration/ExplorationAnnotationFacetFactory.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/exploration/ExplorationAnnotationFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/exploration/annotation/ExplorationAnnotationFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -18,19 +18,22 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.actions.exploration;
+package org.apache.isis.core.progmodel.facets.actions.exploration.annotation;
 
-import java.lang.reflect.Method;
 
 import org.apache.isis.applib.annotation.Exploration;
 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.actions.exploration.ExplorationFacet;
+import org.apache.isis.core.progmodel.facets.actions.invoke.ActionInvocationFacetFactory;
 
 
+/**
+ * {@link ExplorationFacet} can also be installed via a naming convention, see
+ * {@link ActionInvocationFacetFactory}.
+ */
 public class ExplorationAnnotationFacetFactory extends AnnotationBasedFacetFactoryAbstract {
 
     public ExplorationAnnotationFacetFactory() {
@@ -38,9 +41,9 @@ public class ExplorationAnnotationFacetF
     }
 
     @Override
-    public boolean process(Class<?> cls, final Method method, final MethodRemover methodRemover, final FacetHolder holder) {
-        final Exploration annotation = getAnnotation(method, Exploration.class);
-        return FacetUtil.addFacet(create(annotation, holder));
+    public void process(ProcessMethodContext processMethodContext) {
+        final Exploration annotation = getAnnotation(processMethodContext.getMethod(), Exploration.class);
+        FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
     }
 
     private ExplorationFacet create(final Exploration annotation, final FacetHolder holder) {

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

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ActionInvocationFacetViaMethod.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ActionInvocationFacetViaMethod.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ActionInvocationFacetViaMethod.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/invoke/ActionInvocationFacetViaMethod.java Mon Jan 17 08:48:40 2011
@@ -33,6 +33,7 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.ImperativeFacet;
 import org.apache.isis.core.metamodel.facets.actcoll.typeof.ElementSpecificationProviderFromTypeOfFacet;
 import org.apache.isis.core.metamodel.facets.actcoll.typeof.TypeOfFacet;
+import org.apache.isis.core.metamodel.facets.actions.invoke.ActionInvocationFacetAbstract;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.specloader.ReflectiveActionException;
 

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

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

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

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/annotation/NotContributedAnnotationFacetFactory.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/NotContributedAnnotationFacetFactory.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/annotation/NotContributedAnnotationFacetFactory.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/annotation/NotContributedAnnotationFacetFactory.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/NotContributedAnnotationFacetFactory.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/NotContributedAnnotationFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notcontributed/annotation/NotContributedAnnotationFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -18,16 +18,15 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.actions.notcontributed;
+package org.apache.isis.core.progmodel.facets.actions.notcontributed.annotation;
 
-import java.lang.reflect.Method;
 
 import org.apache.isis.applib.annotation.NotContributed;
 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.progmodel.facets.actions.notcontributed.NotContributedFacet;
 
 
 public class NotContributedAnnotationFacetFactory extends AnnotationBasedFacetFactoryAbstract {
@@ -37,9 +36,9 @@ public class NotContributedAnnotationFac
     }
 
     @Override
-    public boolean process(Class<?> cls, final Method method, final MethodRemover methodRemover, final FacetHolder holder) {
-        final NotContributed annotation = getAnnotation(method, NotContributed.class);
-        return FacetUtil.addFacet(create(annotation, holder));
+    public void process(ProcessMethodContext processMethodContext) {
+        final NotContributed annotation = getAnnotation(processMethodContext.getMethod(), NotContributed.class);
+        FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
     }
 
     private NotContributedFacet create(final NotContributed annotation, final FacetHolder holder) {

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

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/annotation/NotInServiceMenuAnnotationFacetFactory.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/NotInServiceMenuAnnotationFacetFactory.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/annotation/NotInServiceMenuAnnotationFacetFactory.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/annotation/NotInServiceMenuAnnotationFacetFactory.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/NotInServiceMenuAnnotationFacetFactory.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/NotInServiceMenuAnnotationFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/notinservicemenu/annotation/NotInServiceMenuAnnotationFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -18,16 +18,16 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.actions.notinservicemenu;
+package org.apache.isis.core.progmodel.facets.actions.notinservicemenu.annotation;
 
-import java.lang.reflect.Method;
 
 import org.apache.isis.applib.annotation.NotInServiceMenu;
 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.progmodel.facets.actions.notinservicemenu.NotInServiceMenuFacet;
+import org.apache.isis.core.progmodel.facets.actions.notinservicemenu.NotInServiceMenuFacetAnnotation;
 
 
 public class NotInServiceMenuAnnotationFacetFactory extends AnnotationBasedFacetFactoryAbstract {
@@ -37,9 +37,9 @@ public class NotInServiceMenuAnnotationF
     }
 
     @Override
-    public boolean process(Class<?> cls, final Method method, final MethodRemover methodRemover, final FacetHolder holder) {
-        final NotInServiceMenu annotation = getAnnotation(method, NotInServiceMenu.class);
-        return FacetUtil.addFacet(create(annotation, holder));
+    public void process(ProcessMethodContext processMethodContext) {
+        final NotInServiceMenu annotation = getAnnotation(processMethodContext.getMethod(), NotInServiceMenu.class);
+        FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
     }
 
     private NotInServiceMenuFacet create(final NotInServiceMenu annotation, final FacetHolder holder) {

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/prototype/annotation/PrototypeAnnotationFacetFactory.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/prototype/PrototypeAnnotationFacetFactory.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/prototype/annotation/PrototypeAnnotationFacetFactory.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/prototype/annotation/PrototypeAnnotationFacetFactory.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/prototype/PrototypeAnnotationFacetFactory.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/prototype/PrototypeAnnotationFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/prototype/annotation/PrototypeAnnotationFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -18,15 +18,13 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.actions.prototype;
+package org.apache.isis.core.progmodel.facets.actions.prototype.annotation;
 
-import java.lang.reflect.Method;
 
 import org.apache.isis.applib.annotation.Prototype;
 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.actions.prototype.PrototypeFacet;
 
@@ -38,9 +36,9 @@ public class PrototypeAnnotationFacetFac
     }
 
     @Override
-    public boolean process(Class<?> cls, final Method method, final MethodRemover methodRemover, final FacetHolder holder) {
-        final Prototype annotation = getAnnotation(method, Prototype.class);
-        return FacetUtil.addFacet(create(annotation, holder));
+    public void process(ProcessMethodContext processMethodContext) {
+        final Prototype annotation = getAnnotation(processMethodContext.getMethod(), Prototype.class);
+        FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
     }
 
     private PrototypeFacet create(final Prototype annotation, final FacetHolder holder) {

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

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/validate/method/ActionValidationFacetViaMethod.java (from r1056813, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/validate/ActionValidationFacetViaMethod.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/validate/method/ActionValidationFacetViaMethod.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/validate/method/ActionValidationFacetViaMethod.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/validate/ActionValidationFacetViaMethod.java&r1=1056813&r2=1059813&rev=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/validate/ActionValidationFacetViaMethod.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/validate/method/ActionValidationFacetViaMethod.java Mon Jan 17 08:48:40 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.actions.validate;
+package org.apache.isis.core.progmodel.facets.actions.validate.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.AdapterInvokeUtils;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.ImperativeFacet;
+import org.apache.isis.core.progmodel.facets.actions.validate.ActionValidationFacetAbstract;
 
 
 public class ActionValidationFacetViaMethod extends ActionValidationFacetAbstract implements ImperativeFacet {

Added: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/validate/method/ActionValidationFacetViaValidateMethodFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/validate/method/ActionValidationFacetViaValidateMethodFacetFactory.java?rev=1059813&view=auto
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/validate/method/ActionValidationFacetViaValidateMethodFacetFactory.java (added)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/actions/validate/method/ActionValidationFacetViaValidateMethodFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -0,0 +1,83 @@
+/*
+ *  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.actions.validate.method;
+
+import java.lang.reflect.Method;
+
+import org.apache.isis.core.commons.lang.NameUtils;
+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;
+import org.apache.isis.core.progmodel.facets.actions.validate.ActionValidationFacet;
+
+/**
+ * Sets up {@link ActionValidationFacet}.
+ */
+public class ActionValidationFacetViaValidateMethodFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
+
+    private static final String[] PREFIXES = { MethodPrefixConstants.VALIDATE_PREFIX };
+
+    /**
+     * Note that the {@link Facet}s registered are the generic ones from noa-architecture (where they exist)
+     */
+    public ActionValidationFacetViaValidateMethodFacetFactory() {
+        super(FeatureType.ACTIONS_ONLY, PREFIXES);
+    }
+
+    // ///////////////////////////////////////////////////////
+    // Actions
+    // ///////////////////////////////////////////////////////
+
+    @Override
+    public void process(ProcessMethodContext processMethodContext) {
+        attachValidatingAdvisorFacetForValidateMethodIfFound(processMethodContext);
+    }
+
+
+    private void attachValidatingAdvisorFacetForValidateMethodIfFound(ProcessMethodContext processMethodContext) {
+
+        Class<?> cls = processMethodContext.getCls();
+        final Method actionMethod = processMethodContext.getMethod();
+
+        final String capitalizedName = NameUtils.capitalizeName(actionMethod.getName());
+        final Class<?>[] paramTypes = actionMethod.getParameterTypes();
+        final MethodScope onClass = MethodScope.scopeFor(actionMethod);
+
+        final Method validateMethod =
+            MethodFinderUtils.findMethod(cls, onClass, MethodPrefixConstants.VALIDATE_PREFIX + capitalizedName,
+                String.class, paramTypes);
+        if (validateMethod == null) {
+            return;
+        }
+        processMethodContext.removeMethod(validateMethod);
+
+        final FacetHolder facetedMethod = processMethodContext.getFacetHolder();
+        FacetUtil.addFacet(new ActionValidationFacetViaMethod(validateMethod, facetedMethod));
+    }
+
+
+
+
+}

Added: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/collections/accessor/CollectionAccessorFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/collections/accessor/CollectionAccessorFacetFactory.java?rev=1059813&view=auto
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/collections/accessor/CollectionAccessorFacetFactory.java (added)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/collections/accessor/CollectionAccessorFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -0,0 +1,112 @@
+/*
+ *  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.collections.accessor;
+
+import java.lang.reflect.Method;
+import java.util.List;
+
+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.facetapi.MethodRemover;
+import org.apache.isis.core.metamodel.methodutils.MethodScope;
+import org.apache.isis.core.progmodel.facets.MethodPrefixConstants;
+import org.apache.isis.core.progmodel.facets.PropertyOrCollectionIdentifyingFacetFactoryAbstract;
+import org.apache.isis.core.progmodel.facets.properties.accessor.PropertyOrCollectionAccessorFacetViaAccessor;
+
+
+public class CollectionAccessorFacetFactory extends PropertyOrCollectionIdentifyingFacetFactoryAbstract {
+
+    private static final String[] PREFIXES = { MethodPrefixConstants.GET_PREFIX };
+
+    public CollectionAccessorFacetFactory() {
+        super(FeatureType.COLLECTIONS_ONLY, PREFIXES);
+    }
+
+    @Override
+    public void process(ProcessMethodContext processMethodContext) {
+
+        attachAccessorFacetForAccessorMethod(processMethodContext);
+    }
+
+    private void attachAccessorFacetForAccessorMethod(ProcessMethodContext processMethodContext) {
+        final Method accessorMethod = processMethodContext.getMethod();
+        processMethodContext.removeMethod(accessorMethod);
+        
+        final FacetHolder holder = processMethodContext.getFacetHolder();
+        final Facet facet = new PropertyOrCollectionAccessorFacetViaAccessor(accessorMethod, holder);
+        FacetUtil.addFacet(facet);
+    }
+
+
+    // ///////////////////////////////////////////////////////////////
+    // PropertyOrCollectionIdentifyingFacetFactory impl.
+    // ///////////////////////////////////////////////////////////////
+
+    @Override
+    public boolean isPropertyOrCollectionAccessorCandidate(final Method method) {
+        return method.getName().startsWith(MethodPrefixConstants.GET_PREFIX);
+    }
+
+    @Override
+    public boolean isCollectionAccessor(final Method method) {
+        if (!isPropertyOrCollectionAccessorCandidate(method)) {
+            return false;
+        }
+        final Class<?> methodReturnType = method.getReturnType();
+        return isCollectionOrArray(methodReturnType);
+    }
+
+    /**
+     * The method way well represent a reference property, but this facet factory does not have any opinion on
+     * the matter.
+     */
+    @Override
+    public boolean isPropertyAccessor(final Method method) {
+        return false;
+    }
+
+    /**
+     * The method way well represent a value property, but this facet factory does not have any opinion on the
+     * matter.
+     */
+    public boolean isValuePropertyAccessor(final Method method) {
+        return false;
+    }
+
+    @Override
+    public void findAndRemoveCollectionAccessors(final MethodRemover methodRemover, final List<Method> methodListToAppendTo) {
+        final Class<?>[] collectionClasses = getCollectionTypeRepository().getCollectionType();
+        for (int i = 0; i < collectionClasses.length; i++) {
+            final Class<?> returnType = collectionClasses[i];
+            final List<Method> list = methodRemover.removeMethods(MethodScope.OBJECT, MethodPrefixConstants.GET_PREFIX, returnType, false, 0);
+            methodListToAppendTo.addAll(list);
+        }
+    }
+
+    @Override
+    public void findAndRemovePropertyAccessors(final MethodRemover methodRemover, final List<Method> methodListToAppendTo) {
+    // does nothing
+    }
+
+    
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/collections/aggregated/AggregatedIfCollectionFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/collections/aggregated/AggregatedIfCollectionFacetFactory.java?rev=1059813&r1=1059812&r2=1059813&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/collections/aggregated/AggregatedIfCollectionFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/collections/aggregated/AggregatedIfCollectionFacetFactory.java Mon Jan 17 08:48:40 2011
@@ -20,16 +20,14 @@
 
 package org.apache.isis.core.progmodel.facets.collections.aggregated;
 
-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.collections.modify.CollectionFacet;
 import org.apache.isis.core.metamodel.facets.object.aggregated.AggregatedFacet;
 import org.apache.isis.core.metamodel.progmodel.ProgrammingModel;
-import org.apache.isis.core.metamodel.spec.FacetFactoryAbstract;
 import org.apache.isis.core.metamodel.specloader.collectiontyperegistry.CollectionTypeRegistry;
-import org.apache.isis.core.progmodel.facets.collections.CollectionFacetFactory;
+import org.apache.isis.core.progmodel.facets.collections.collection.CollectionFacetFactory;
 
 
 /**
@@ -45,11 +43,11 @@ public class AggregatedIfCollectionFacet
     }
 
     @Override
-    public boolean process(final Class<?> cls, final MethodRemover methodRemover, final FacetHolder holder) {
-        if (!holder.containsFacet(CollectionFacet.class)) {
-            return false;
+    public void process(ProcessClassContext processClassContaxt) {
+        if (!processClassContaxt.getFacetHolder().containsFacet(CollectionFacet.class)) {
+            return;
         }
-        return FacetUtil.addFacet(new AggregatedSinceCollection(holder));
+        FacetUtil.addFacet(new AggregatedSinceCollection(processClassContaxt.getFacetHolder()));
     }
 
 }



Mime
View raw message