incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1096928 [11/16] - in /incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel: facetdecorators/help/ facetdecorators/help/file/ facetdecorators/help/file/internal/ facetdecorators/i18n/ facetdecorators/i18n/interna...
Date Tue, 26 Apr 2011 22:03:55 GMT
Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/defaults/methodnum/ActionParameterDefaultsFacetViaMethod.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/defaults/methodnum/ActionParameterDefaultsFacetViaMethod.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/defaults/methodnum/ActionParameterDefaultsFacetViaMethod.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/defaults/methodnum/ActionParameterDefaultsFacetViaMethod.java Tue Apr 26 22:03:43 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.param.defaults.methodnum;
 
 import java.lang.reflect.Method;
@@ -30,34 +29,35 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.ImperativeFacet;
 import org.apache.isis.core.progmodel.facets.param.defaults.ActionParameterDefaultsFacetAbstract;
 
-
-public class ActionParameterDefaultsFacetViaMethod extends ActionParameterDefaultsFacetAbstract implements ImperativeFacet {
+public class ActionParameterDefaultsFacetViaMethod extends ActionParameterDefaultsFacetAbstract implements
+    ImperativeFacet {
 
     private final Method method;
-    
-    public ActionParameterDefaultsFacetViaMethod(
-    		final Method method, 
-    		final FacetHolder holder) {
+
+    public ActionParameterDefaultsFacetViaMethod(final Method method, final FacetHolder holder) {
         super(holder);
         this.method = method;
     }
 
     /**
-     * Returns a singleton list of the {@link Method} provided in the constructor. 
+     * Returns a singleton list of the {@link Method} provided in the constructor.
      */
+    @Override
     public List<Method> getMethods() {
-    	return Collections.singletonList(method);
+        return Collections.singletonList(method);
     }
 
-	public boolean impliesResolve() {
-		return true;
-	}
+    @Override
+    public boolean impliesResolve() {
+        return true;
+    }
 
-	public boolean impliesObjectChanged() {
-		return false;
-	}
-	
+    @Override
+    public boolean impliesObjectChanged() {
+        return false;
+    }
 
+    @Override
     public Object getDefault(final ObjectAdapter owningAdapter) {
         return AdapterInvokeUtils.invoke(method, owningAdapter);
     }
@@ -68,4 +68,3 @@ public class ActionParameterDefaultsFace
     }
 
 }
-

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/describedas/annotation/DescribedAsAnnotationOnParameterFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/describedas/annotation/DescribedAsAnnotationOnParameterFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/describedas/annotation/DescribedAsAnnotationOnParameterFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/describedas/annotation/DescribedAsAnnotationOnParameterFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.param.describedas.annotation;
 
-package org.apache.isis.core.progmodel.facets.param.describedas.annotation;
-
 import java.lang.annotation.Annotation;
 
 import org.apache.isis.applib.annotation.DescribedAs;
@@ -29,43 +28,44 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.AnnotationBasedFacetFactoryAbstract;
 import org.apache.isis.core.metamodel.facets.describedas.DescribedAsFacet;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-
-
-public class DescribedAsAnnotationOnParameterFacetFactory extends AnnotationBasedFacetFactoryAbstract {
-
-    public DescribedAsAnnotationOnParameterFacetFactory() {
-        super(FeatureType.PARAMETERS_ONLY);
-    }
-
-    @Override
-    public void processParams(ProcessParameterContext processParameterContext) {
-
+
+public class DescribedAsAnnotationOnParameterFacetFactory extends AnnotationBasedFacetFactoryAbstract {
+
+    public DescribedAsAnnotationOnParameterFacetFactory() {
+        super(FeatureType.PARAMETERS_ONLY);
+    }
+
+    @Override
+    public void processParams(final ProcessParameterContext processParameterContext) {
+
         final int paramNum = processParameterContext.getParamNum();
-        final Class<?> parameterType = processParameterContext.getMethod().getParameterTypes()[paramNum];
-        final Annotation[] parameterAnnotations = getParameterAnnotations(processParameterContext.getMethod())[paramNum];
-        for (int j = 0; j < parameterAnnotations.length; j++) {
-            if (parameterAnnotations[j] instanceof DescribedAs) {
-                FacetUtil.addFacet(create((DescribedAs) parameterAnnotations[j], processParameterContext.getFacetHolder()));
-                return;
-            }
-        }
-
-        // otherwise, fall back to a description on the parameter's type, if available
-        final DescribedAsFacet parameterTypeDescribedAsFacet = getDescribedAsFacet(parameterType);
-        if (parameterTypeDescribedAsFacet != null) {
-            FacetUtil.addFacet(new DescribedAsFacetForParameterDerivedFromType(parameterTypeDescribedAsFacet, processParameterContext.getFacetHolder()));
-            return;
-        }
-
-    }
-
-    private DescribedAsFacet create(final DescribedAs annotation, final FacetHolder holder) {
-        return annotation == null ? null : new DescribedAsFacetAnnotationOnParameter(annotation.value(), holder);
-    }
-
-    private DescribedAsFacet getDescribedAsFacet(final Class<?> type) {
-        final ObjectSpecification paramTypeSpec = getSpecificationLookup().loadSpecification(type);
-        return paramTypeSpec.getFacet(DescribedAsFacet.class);
-    }
-
-}
+        final Class<?> parameterType = processParameterContext.getMethod().getParameterTypes()[paramNum];
+        final Annotation[] parameterAnnotations =
+            getParameterAnnotations(processParameterContext.getMethod())[paramNum];
+        for (final Annotation parameterAnnotation : parameterAnnotations) {
+            if (parameterAnnotation instanceof DescribedAs) {
+                FacetUtil.addFacet(create((DescribedAs) parameterAnnotation, processParameterContext.getFacetHolder()));
+                return;
+            }
+        }
+
+        // otherwise, fall back to a description on the parameter's type, if available
+        final DescribedAsFacet parameterTypeDescribedAsFacet = getDescribedAsFacet(parameterType);
+        if (parameterTypeDescribedAsFacet != null) {
+            FacetUtil.addFacet(new DescribedAsFacetForParameterDerivedFromType(parameterTypeDescribedAsFacet,
+                processParameterContext.getFacetHolder()));
+            return;
+        }
+
+    }
+
+    private DescribedAsFacet create(final DescribedAs annotation, final FacetHolder holder) {
+        return annotation == null ? null : new DescribedAsFacetAnnotationOnParameter(annotation.value(), holder);
+    }
+
+    private DescribedAsFacet getDescribedAsFacet(final Class<?> type) {
+        final ObjectSpecification paramTypeSpec = getSpecificationLookup().loadSpecification(type);
+        return paramTypeSpec.getFacet(DescribedAsFacet.class);
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/describedas/annotation/DescribedAsFacetAnnotationOnParameter.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/describedas/annotation/DescribedAsFacetAnnotationOnParameter.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/describedas/annotation/DescribedAsFacetAnnotationOnParameter.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/describedas/annotation/DescribedAsFacetAnnotationOnParameter.java Tue Apr 26 22:03:43 2011
@@ -17,18 +17,15 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.param.describedas.annotation;
 
-package org.apache.isis.core.progmodel.facets.param.describedas.annotation;
-
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.describedas.DescribedAsFacetAbstract;
-
-
-public class DescribedAsFacetAnnotationOnParameter extends DescribedAsFacetAbstract {
-
-    public DescribedAsFacetAnnotationOnParameter(final String value, final FacetHolder holder) {
-        super(value, holder);
-    }
-
-}
-
+
+public class DescribedAsFacetAnnotationOnParameter extends DescribedAsFacetAbstract {
+
+    public DescribedAsFacetAnnotationOnParameter(final String value, final FacetHolder holder) {
+        super(value, holder);
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/describedas/annotation/DescribedAsFacetForParameterDerivedFromType.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/describedas/annotation/DescribedAsFacetForParameterDerivedFromType.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/describedas/annotation/DescribedAsFacetForParameterDerivedFromType.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/describedas/annotation/DescribedAsFacetForParameterDerivedFromType.java Tue Apr 26 22:03:43 2011
@@ -17,18 +17,16 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.param.describedas.annotation;
 
-package org.apache.isis.core.progmodel.facets.param.describedas.annotation;
-
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.describedas.DescribedAsFacet;
 import org.apache.isis.core.metamodel.facets.describedas.DescribedAsFacetAbstract;
-
-
-public class DescribedAsFacetForParameterDerivedFromType extends DescribedAsFacetAbstract {
-
-    public DescribedAsFacetForParameterDerivedFromType(final DescribedAsFacet describedAsFacet, final FacetHolder holder) {
-        super(describedAsFacet.value(), holder);
-    }
-
-}
+
+public class DescribedAsFacetForParameterDerivedFromType extends DescribedAsFacetAbstract {
+
+    public DescribedAsFacetForParameterDerivedFromType(final DescribedAsFacet describedAsFacet, final FacetHolder holder) {
+        super(describedAsFacet.value(), holder);
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/describedas/staticmethod/ActionParameterDescriptionsMethodFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/describedas/staticmethod/ActionParameterDescriptionsMethodFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/describedas/staticmethod/ActionParameterDescriptionsMethodFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/describedas/staticmethod/ActionParameterDescriptionsMethodFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -38,7 +38,8 @@ import org.apache.isis.core.progmodel.fa
 import org.apache.isis.core.progmodel.facets.MethodPrefixConstants;
 import org.apache.isis.core.progmodel.facets.members.describedas.staticmethod.DescribedAsFacetViaMethod;
 
-public class ActionParameterDescriptionsMethodFacetFactory extends MethodPrefixBasedFacetFactoryAbstract implements AdapterMapAware {
+public class ActionParameterDescriptionsMethodFacetFactory extends MethodPrefixBasedFacetFactoryAbstract implements
+    AdapterMapAware {
 
     private static final String[] PREFIXES = { MethodPrefixConstants.DESCRIPTION_PREFIX };
 
@@ -56,7 +57,7 @@ public class ActionParameterDescriptions
     // ///////////////////////////////////////////////////////
 
     @Override
-    public void process(ProcessMethodContext processMethodContext) {
+    public void process(final ProcessMethodContext processMethodContext) {
 
         final FacetedMethod facetedMethod = processMethodContext.getFacetHolder();
         final List<FacetedMethodParameter> holderList = facetedMethod.getParameters();
@@ -75,7 +76,7 @@ public class ActionParameterDescriptions
 
         final String capitalizedName = NameUtils.capitalizeName(actionMethod.getName());
 
-        Class<?> cls = processMethodContext.getCls();
+        final Class<?> cls = processMethodContext.getCls();
         final Method descriptionMethod =
             MethodFinderUtils.findMethod(cls, MethodScope.CLASS, MethodPrefixConstants.DESCRIPTION_PREFIX
                 + capitalizedName, String[].class, new Class[0]);
@@ -84,7 +85,7 @@ public class ActionParameterDescriptions
         }
         processMethodContext.removeMethod(descriptionMethod);
 
-        String[] descriptions = invokeDescriptionsMethod(descriptionMethod, parameters.size());
+        final String[] descriptions = invokeDescriptionsMethod(descriptionMethod, parameters.size());
         for (int i = 0; i < descriptions.length; i++) {
             // add facets directly to parameters, not to actions
             FacetUtil.addFacet(new DescribedAsFacetViaMethod(descriptions[i], descriptionMethod, parameters.get(i)));
@@ -95,23 +96,22 @@ public class ActionParameterDescriptions
         String[] descriptions = null;
         try {
             descriptions = (String[]) InvokeUtils.invokeStatic(descriptionMethod, new Object[0]);
-        } catch(ClassCastException ex) {
+        } catch (final ClassCastException ex) {
             // ignore
         }
-        if(descriptions==null || descriptions.length != numElementsRequired) {
-            throw new MetaModelException(descriptionMethod + " must return an String[] array of same size as number of parameters of action");
+        if (descriptions == null || descriptions.length != numElementsRequired) {
+            throw new MetaModelException(descriptionMethod
+                + " must return an String[] array of same size as number of parameters of action");
         }
         return descriptions;
     }
 
-
-
     // ///////////////////////////////////////////////////////////////
     // Dependencies
     // ///////////////////////////////////////////////////////////////
 
     @Override
-    public void setAdapterMap(AdapterMap adapterMap) {
+    public void setAdapterMap(final AdapterMap adapterMap) {
         this.adapterMap = adapterMap;
     }
 

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/annotation/MandatoryFacetInvertedByOptionalForParameter.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/annotation/MandatoryFacetInvertedByOptionalForParameter.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/annotation/MandatoryFacetInvertedByOptionalForParameter.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/annotation/MandatoryFacetInvertedByOptionalForParameter.java Tue Apr 26 22:03:43 2011
@@ -17,37 +17,36 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.param.mandatory.annotation;
 
-package org.apache.isis.core.progmodel.facets.param.mandatory.annotation;
-
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacetAbstract;
-
-
-/**
- * Derived by presence of an <tt>@Optional</tt> method.
- * 
- * <p>
- * This implementation indicates that the {@link FacetHolder} is <i>not</i> mandatory, as per
- * {@link #isInvertedSemantics()}.
- */
-public class MandatoryFacetInvertedByOptionalForParameter extends MandatoryFacetAbstract {
-
-    public MandatoryFacetInvertedByOptionalForParameter(final FacetHolder holder) {
-        super(holder);
-    }
-
-    /**
-     * Always returns <tt>false</tt>, indicating that the facet holder is in fact optional.
-     */
-    public boolean isRequiredButNull(final ObjectAdapter adapter) {
-        return false;
-    }
-
-    public boolean isInvertedSemantics() {
-        return true;
-    }
-
-}
-
+
+/**
+ * Derived by presence of an <tt>@Optional</tt> method.
+ * 
+ * <p>
+ * This implementation indicates that the {@link FacetHolder} is <i>not</i> mandatory, as per
+ * {@link #isInvertedSemantics()}.
+ */
+public class MandatoryFacetInvertedByOptionalForParameter extends MandatoryFacetAbstract {
+
+    public MandatoryFacetInvertedByOptionalForParameter(final FacetHolder holder) {
+        super(holder);
+    }
+
+    /**
+     * Always returns <tt>false</tt>, indicating that the facet holder is in fact optional.
+     */
+    @Override
+    public boolean isRequiredButNull(final ObjectAdapter adapter) {
+        return false;
+    }
+
+    @Override
+    public boolean isInvertedSemantics() {
+        return true;
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/annotation/OptionalAnnotationForParameterFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/annotation/OptionalAnnotationForParameterFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/annotation/OptionalAnnotationForParameterFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/annotation/OptionalAnnotationForParameterFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -17,40 +17,40 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.param.mandatory.annotation;
 
-package org.apache.isis.core.progmodel.facets.param.mandatory.annotation;
-
 import java.lang.annotation.Annotation;
 
 import org.apache.isis.applib.annotation.Optional;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
 import org.apache.isis.core.metamodel.facets.AnnotationBasedFacetFactoryAbstract;
-
-
-public class OptionalAnnotationForParameterFacetFactory extends AnnotationBasedFacetFactoryAbstract {
-
-    public OptionalAnnotationForParameterFacetFactory() {
-        super(FeatureType.PARAMETERS_ONLY);
-    }
-
-    @Override
-    public void processParams(ProcessParameterContext processParameterContext) {
-        final Class<?>[] parameterTypes = processParameterContext.getMethod().getParameterTypes();
-        if (processParameterContext.getParamNum() >= parameterTypes.length) {
-            // ignore
-            return;
-        }
-        if (parameterTypes[processParameterContext.getParamNum()].isPrimitive()) {
-            return;
-        }
-        final Annotation[] parameterAnnotations = getParameterAnnotations(processParameterContext.getMethod())[processParameterContext.getParamNum()];
-        for (int j = 0; j < parameterAnnotations.length; j++) {
-            if (parameterAnnotations[j] instanceof Optional) {
-                FacetUtil.addFacet(new MandatoryFacetInvertedByOptionalForParameter(processParameterContext.getFacetHolder()));
-                return;
-            }
-        }
-    }
-
-}
+
+public class OptionalAnnotationForParameterFacetFactory extends AnnotationBasedFacetFactoryAbstract {
+
+    public OptionalAnnotationForParameterFacetFactory() {
+        super(FeatureType.PARAMETERS_ONLY);
+    }
+
+    @Override
+    public void processParams(final ProcessParameterContext processParameterContext) {
+        final Class<?>[] parameterTypes = processParameterContext.getMethod().getParameterTypes();
+        if (processParameterContext.getParamNum() >= parameterTypes.length) {
+            // ignore
+            return;
+        }
+        if (parameterTypes[processParameterContext.getParamNum()].isPrimitive()) {
+            return;
+        }
+        final Annotation[] parameterAnnotations =
+            getParameterAnnotations(processParameterContext.getMethod())[processParameterContext.getParamNum()];
+        for (final Annotation parameterAnnotation : parameterAnnotations) {
+            if (parameterAnnotation instanceof Optional) {
+                FacetUtil.addFacet(new MandatoryFacetInvertedByOptionalForParameter(processParameterContext
+                    .getFacetHolder()));
+                return;
+            }
+        }
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/dflt/MandatoryDefaultForParametersFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/dflt/MandatoryDefaultForParametersFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/dflt/MandatoryDefaultForParametersFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/dflt/MandatoryDefaultForParametersFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -17,9 +17,7 @@
  *  under the License.
  */
 
-
-package org.apache.isis.core.progmodel.facets.param.mandatory.dflt;
-
+package org.apache.isis.core.progmodel.facets.param.mandatory.dflt;
 
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
@@ -29,29 +27,28 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacet;
 import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacetDefault;
 import org.apache.isis.core.metamodel.specloader.facetprocessor.FacetProcessor;
-
-
-/**
- * Simply installs a {@link MandatoryFacetDefault} onto all properties and parameters.
- * 
- * <p>
- * The idea is that this {@link FacetFactory} is included early on in the {@link FacetProcessor}, but
- * other {@link MandatoryFacet} implementations which don't require mandatory semantics will potentially
- * replace these where the property or parameter is annotated or otherwise indicated as being optional.
- */
-public class MandatoryDefaultForParametersFacetFactory extends FacetFactoryAbstract {
-
-    public MandatoryDefaultForParametersFacetFactory() {
-        super(FeatureType.PARAMETERS_ONLY);
-    }
-
-    @Override
-    public void processParams(ProcessParameterContext processParameterContext) {
-        FacetUtil.addFacet(create(processParameterContext.getFacetHolder()));
-    }
-
-    private MandatoryFacet create(final FacetHolder holder) {
-        return new MandatoryFacetDefault(holder);
-    }
-
-}
+
+/**
+ * Simply installs a {@link MandatoryFacetDefault} onto all properties and parameters.
+ * 
+ * <p>
+ * The idea is that this {@link FacetFactory} is included early on in the {@link FacetProcessor}, but other
+ * {@link MandatoryFacet} implementations which don't require mandatory semantics will potentially replace these where
+ * the property or parameter is annotated or otherwise indicated as being optional.
+ */
+public class MandatoryDefaultForParametersFacetFactory extends FacetFactoryAbstract {
+
+    public MandatoryDefaultForParametersFacetFactory() {
+        super(FeatureType.PARAMETERS_ONLY);
+    }
+
+    @Override
+    public void processParams(final ProcessParameterContext processParameterContext) {
+        FacetUtil.addFacet(create(processParameterContext.getFacetHolder()));
+    }
+
+    private MandatoryFacet create(final FacetHolder holder) {
+        return new MandatoryFacetDefault(holder);
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/staticmethod/ActionParameterOptionalViaMethodFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/staticmethod/ActionParameterOptionalViaMethodFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/staticmethod/ActionParameterOptionalViaMethodFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/staticmethod/ActionParameterOptionalViaMethodFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -50,7 +50,7 @@ public class ActionParameterOptionalViaM
     }
 
     @Override
-    public void process(ProcessMethodContext processMethodContext) {
+    public void process(final ProcessMethodContext processMethodContext) {
 
         final FacetedMethod facetedMethod = processMethodContext.getFacetHolder();
         final List<FacetedMethodParameter> holderList = facetedMethod.getParameters();
@@ -69,16 +69,16 @@ public class ActionParameterOptionalViaM
         final Method actionMethod = processMethodContext.getMethod();
         final String capitalizedName = NameUtils.capitalizeName(actionMethod.getName());
 
-        Class<?> cls = processMethodContext.getCls();
+        final Class<?> cls = processMethodContext.getCls();
         final Method optionalMethod =
-            MethodFinderUtils.findMethod(cls, MethodScope.CLASS,
-                MethodPrefixConstants.OPTIONAL_PREFIX + capitalizedName, boolean[].class, new Class[0]);
+            MethodFinderUtils.findMethod(cls, MethodScope.CLASS, MethodPrefixConstants.OPTIONAL_PREFIX
+                + capitalizedName, boolean[].class, new Class[0]);
         if (optionalMethod == null) {
             return;
         }
         try {
-            boolean[] optionals = invokeOptionalsMethod(optionalMethod, parameters.size());
-            
+            final boolean[] optionals = invokeOptionalsMethod(optionalMethod, parameters.size());
+
             for (int i = 0; i < optionals.length; i++) {
                 if (optionals[i]) {
                     // add facets directly to parameters, not to actions
@@ -94,14 +94,14 @@ public class ActionParameterOptionalViaM
         boolean[] optionals = null;
         try {
             optionals = (boolean[]) InvokeUtils.invokeStatic(optionalMethod, new Object[0]);
-        } catch(ClassCastException ex) {
+        } catch (final ClassCastException ex) {
             // ignore, test below
         }
-        if(optionals==null || optionals.length != numElementsRequired) {
-            throw new MetaModelException(optionalMethod + " must return an boolean[] array of same size as number of parameters of action");
+        if (optionals == null || optionals.length != numElementsRequired) {
+            throw new MetaModelException(optionalMethod
+                + " must return an boolean[] array of same size as number of parameters of action");
         }
         return optionals;
     }
 
-
 }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/staticmethod/MandatoryFacetOptionalViaMethodForParameter.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/staticmethod/MandatoryFacetOptionalViaMethodForParameter.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/staticmethod/MandatoryFacetOptionalViaMethodForParameter.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/mandatory/staticmethod/MandatoryFacetOptionalViaMethodForParameter.java Tue Apr 26 22:03:43 2011
@@ -17,37 +17,36 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.param.mandatory.staticmethod;
 
-package org.apache.isis.core.progmodel.facets.param.mandatory.staticmethod;
-
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacetAbstract;
-
-
-/**
- * Derived by presence of an <tt>optionalXxx</tt> method.
- * 
- * <p>
- * This implementation indicates that the {@link FacetHolder} is <i>not</i> mandatory, as per
- * {@link #isInvertedSemantics()}.
- */
-public class MandatoryFacetOptionalViaMethodForParameter extends MandatoryFacetAbstract {
-
-    public MandatoryFacetOptionalViaMethodForParameter(final FacetHolder holder) {
-        super(holder);
-    }
-
-    /**
-     * Always returns <tt>false</tt>, indicating that the facet holder is in fact optional.
-     */
-    public boolean isRequiredButNull(final ObjectAdapter adapter) {
-        return false;
-    }
-
-    public boolean isInvertedSemantics() {
-        return true;
-    }
-
-}
-
+
+/**
+ * Derived by presence of an <tt>optionalXxx</tt> method.
+ * 
+ * <p>
+ * This implementation indicates that the {@link FacetHolder} is <i>not</i> mandatory, as per
+ * {@link #isInvertedSemantics()}.
+ */
+public class MandatoryFacetOptionalViaMethodForParameter extends MandatoryFacetAbstract {
+
+    public MandatoryFacetOptionalViaMethodForParameter(final FacetHolder holder) {
+        super(holder);
+    }
+
+    /**
+     * Always returns <tt>false</tt>, indicating that the facet holder is in fact optional.
+     */
+    @Override
+    public boolean isRequiredButNull(final ObjectAdapter adapter) {
+        return false;
+    }
+
+    @Override
+    public boolean isInvertedSemantics() {
+        return true;
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/multiline/annotation/MultiLineAnnotationOnParameterFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/multiline/annotation/MultiLineAnnotationOnParameterFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/multiline/annotation/MultiLineAnnotationOnParameterFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/multiline/annotation/MultiLineAnnotationOnParameterFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.param.multiline.annotation;
 
-package org.apache.isis.core.progmodel.facets.param.multiline.annotation;
-
 import java.lang.annotation.Annotation;
 
 import org.apache.isis.applib.annotation.MultiLine;
@@ -28,37 +27,37 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
 import org.apache.isis.core.metamodel.facets.AnnotationBasedFacetFactoryAbstract;
 import org.apache.isis.core.metamodel.facets.multiline.MultiLineFacet;
-
-
-public class MultiLineAnnotationOnParameterFacetFactory extends AnnotationBasedFacetFactoryAbstract {
-
-    public MultiLineAnnotationOnParameterFacetFactory() {
-        super(FeatureType.PARAMETERS_ONLY);
-    }
-
-    @Override
-    public void processParams(ProcessParameterContext processParameterContext) {
-        final Class<?>[] parameterTypes = processParameterContext.getMethod().getParameterTypes();
-        if (processParameterContext.getParamNum() >= parameterTypes.length) {
-            // ignore
-            return;
-        }
-        if (!isString(parameterTypes[processParameterContext.getParamNum()])) {
-            return;
-        }
-        final Annotation[] parameterAnnotations = getParameterAnnotations(processParameterContext.getMethod())[processParameterContext.getParamNum()];
-        for (int j = 0; j < parameterAnnotations.length; j++) {
-            if (parameterAnnotations[j] instanceof MultiLine) {
-                final MultiLine annotation = (MultiLine) parameterAnnotations[j];
+
+public class MultiLineAnnotationOnParameterFacetFactory extends AnnotationBasedFacetFactoryAbstract {
+
+    public MultiLineAnnotationOnParameterFacetFactory() {
+        super(FeatureType.PARAMETERS_ONLY);
+    }
+
+    @Override
+    public void processParams(final ProcessParameterContext processParameterContext) {
+        final Class<?>[] parameterTypes = processParameterContext.getMethod().getParameterTypes();
+        if (processParameterContext.getParamNum() >= parameterTypes.length) {
+            // ignore
+            return;
+        }
+        if (!isString(parameterTypes[processParameterContext.getParamNum()])) {
+            return;
+        }
+        final Annotation[] parameterAnnotations =
+            getParameterAnnotations(processParameterContext.getMethod())[processParameterContext.getParamNum()];
+        for (final Annotation parameterAnnotation : parameterAnnotations) {
+            if (parameterAnnotation instanceof MultiLine) {
+                final MultiLine annotation = (MultiLine) parameterAnnotation;
                 FacetUtil.addFacet(create(annotation, processParameterContext.getFacetHolder()));
-                return;
-            }
-        }
-    }
-
-    private MultiLineFacet create(final MultiLine annotation, final FacetHolder holder) {
-        return (annotation != null) ? new MultiLineFacetAnnotationOnParameter(annotation.numberOfLines(), annotation.preventWrapping(),
-                holder) : null;
-    }
-
-}
+                return;
+            }
+        }
+    }
+
+    private MultiLineFacet create(final MultiLine annotation, final FacetHolder holder) {
+        return (annotation != null) ? new MultiLineFacetAnnotationOnParameter(annotation.numberOfLines(),
+            annotation.preventWrapping(), holder) : null;
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/multiline/annotation/MultiLineFacetAnnotationOnParameter.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/multiline/annotation/MultiLineFacetAnnotationOnParameter.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/multiline/annotation/MultiLineFacetAnnotationOnParameter.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/multiline/annotation/MultiLineFacetAnnotationOnParameter.java Tue Apr 26 22:03:43 2011
@@ -17,18 +17,16 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.param.multiline.annotation;
 
-package org.apache.isis.core.progmodel.facets.param.multiline.annotation;
-
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.multiline.MultiLineFacetAbstract;
-
-
-public class MultiLineFacetAnnotationOnParameter extends MultiLineFacetAbstract {
-
-    public MultiLineFacetAnnotationOnParameter(final int numberOfLines, final boolean preventWrapping, final FacetHolder holder) {
-        super(numberOfLines, preventWrapping, holder);
-    }
-
-}
-
+
+public class MultiLineFacetAnnotationOnParameter extends MultiLineFacetAbstract {
+
+    public MultiLineFacetAnnotationOnParameter(final int numberOfLines, final boolean preventWrapping,
+        final FacetHolder holder) {
+        super(numberOfLines, preventWrapping, holder);
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/named/annotation/NamedAnnotationOnParameterFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/named/annotation/NamedAnnotationOnParameterFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/named/annotation/NamedAnnotationOnParameterFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/named/annotation/NamedAnnotationOnParameterFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.param.named.annotation;
 
-package org.apache.isis.core.progmodel.facets.param.named.annotation;
-
 import java.lang.annotation.Annotation;
 
 import org.apache.isis.applib.annotation.Named;
@@ -28,28 +27,28 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
 import org.apache.isis.core.metamodel.facets.AnnotationBasedFacetFactoryAbstract;
 import org.apache.isis.core.metamodel.facets.named.NamedFacet;
-
-
-public class NamedAnnotationOnParameterFacetFactory extends AnnotationBasedFacetFactoryAbstract {
-
-    public NamedAnnotationOnParameterFacetFactory() {
-        super(FeatureType.PARAMETERS_ONLY);
-    }
-
-    @Override
-    public void processParams(ProcessParameterContext processParameterContext) {
-        final Annotation[] parameterAnnotations = getParameterAnnotations(processParameterContext.getMethod())[processParameterContext.getParamNum()];
-        for (int j = 0; j < parameterAnnotations.length; j++) {
-            if (parameterAnnotations[j] instanceof Named) {
-                final Named annotation = (Named) parameterAnnotations[j];
+
+public class NamedAnnotationOnParameterFacetFactory extends AnnotationBasedFacetFactoryAbstract {
+
+    public NamedAnnotationOnParameterFacetFactory() {
+        super(FeatureType.PARAMETERS_ONLY);
+    }
+
+    @Override
+    public void processParams(final ProcessParameterContext processParameterContext) {
+        final Annotation[] parameterAnnotations =
+            getParameterAnnotations(processParameterContext.getMethod())[processParameterContext.getParamNum()];
+        for (final Annotation parameterAnnotation : parameterAnnotations) {
+            if (parameterAnnotation instanceof Named) {
+                final Named annotation = (Named) parameterAnnotation;
                 FacetUtil.addFacet(create(annotation, processParameterContext.getFacetHolder()));
-                return;
-            }
-        }
-    }
-
-    private NamedFacet create(final Named annotation, final FacetHolder holder) {
-        return annotation != null ? new NamedFacetAnnotationOnParameter(annotation.value(), holder) : null;
-    }
-
-}
+                return;
+            }
+        }
+    }
+
+    private NamedFacet create(final Named annotation, final FacetHolder holder) {
+        return annotation != null ? new NamedFacetAnnotationOnParameter(annotation.value(), holder) : null;
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/named/annotation/NamedFacetAnnotationOnParameter.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/named/annotation/NamedFacetAnnotationOnParameter.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/named/annotation/NamedFacetAnnotationOnParameter.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/named/annotation/NamedFacetAnnotationOnParameter.java Tue Apr 26 22:03:43 2011
@@ -17,18 +17,15 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.param.named.annotation;
 
-package org.apache.isis.core.progmodel.facets.param.named.annotation;
-
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.named.NamedFacetAbstract;
-
-
-public class NamedFacetAnnotationOnParameter extends NamedFacetAbstract {
-
-    public NamedFacetAnnotationOnParameter(final String value, final FacetHolder holder) {
-        super(value, holder);
-    }
-
-}
-
+
+public class NamedFacetAnnotationOnParameter extends NamedFacetAbstract {
+
+    public NamedFacetAnnotationOnParameter(final String value, final FacetHolder holder) {
+        super(value, holder);
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/named/staticmethod/ActionParameterNamesMethodFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/named/staticmethod/ActionParameterNamesMethodFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/named/staticmethod/ActionParameterNamesMethodFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/named/staticmethod/ActionParameterNamesMethodFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -41,7 +41,8 @@ import org.apache.isis.core.progmodel.fa
 /**
  * Sets up all the {@link Facet}s for an action in a single shot.
  */
-public class ActionParameterNamesMethodFacetFactory extends MethodPrefixBasedFacetFactoryAbstract implements AdapterMapAware {
+public class ActionParameterNamesMethodFacetFactory extends MethodPrefixBasedFacetFactoryAbstract implements
+    AdapterMapAware {
 
     private static final String[] PREFIXES = { MethodPrefixConstants.NAME_PREFIX };
 
@@ -59,7 +60,7 @@ public class ActionParameterNamesMethodF
     // ///////////////////////////////////////////////////////
 
     @Override
-    public void process(ProcessMethodContext processMethodContext) {
+    public void process(final ProcessMethodContext processMethodContext) {
 
         final FacetedMethod facetedMethod = processMethodContext.getFacetHolder();
         final List<FacetedMethodParameter> holderList = facetedMethod.getParameters();
@@ -77,15 +78,15 @@ public class ActionParameterNamesMethodF
         final Method actionMethod = processMethodContext.getMethod();
         final String capitalizedName = NameUtils.capitalizeName(actionMethod.getName());
 
-        Class<?> cls = processMethodContext.getCls();
-        Method namesMethod =
+        final Class<?> cls = processMethodContext.getCls();
+        final Method namesMethod =
             MethodFinderUtils.findMethod(cls, MethodScope.CLASS, MethodPrefixConstants.NAME_PREFIX + capitalizedName,
                 String[].class, new Class[0]);
         if (namesMethod == null) {
             return;
         }
         try {
-            String[] names = invokeNamesMethod(namesMethod, parameters.size());
+            final String[] names = invokeNamesMethod(namesMethod, parameters.size());
             for (int i = 0; i < names.length; i++) {
                 // add facets directly to parameters, not to actions
                 FacetUtil.addFacet(new NamedFacetViaMethod(names[i], namesMethod, parameters.get(i)));
@@ -95,27 +96,26 @@ public class ActionParameterNamesMethodF
         }
     }
 
-    private static String[] invokeNamesMethod(Method namesMethod, final int numElementsRequired) {
+    private static String[] invokeNamesMethod(final Method namesMethod, final int numElementsRequired) {
         String[] names = null;
         try {
             names = (String[]) InvokeUtils.invokeStatic(namesMethod, new Object[0]);
-        } catch(ClassCastException ex) {
+        } catch (final ClassCastException ex) {
             // ignore
         }
-        if(names==null || names.length != numElementsRequired) {
-            throw new MetaModelException(namesMethod + " must return an String[] array of same size as number of parameters of action");
+        if (names == null || names.length != numElementsRequired) {
+            throw new MetaModelException(namesMethod
+                + " must return an String[] array of same size as number of parameters of action");
         }
         return names;
     }
 
-
-
     // ///////////////////////////////////////////////////////////////
     // Dependencies
     // ///////////////////////////////////////////////////////////////
 
     @Override
-    public void setAdapterMap(AdapterMap adapterMap) {
+    public void setAdapterMap(final AdapterMap adapterMap) {
         this.adapterMap = adapterMap;
     }
 

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/typicallen/annotation/TypicalLengthAnnotationOnParameterFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/typicallen/annotation/TypicalLengthAnnotationOnParameterFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/typicallen/annotation/TypicalLengthAnnotationOnParameterFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/typicallen/annotation/TypicalLengthAnnotationOnParameterFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.param.typicallen.annotation;
 
-package org.apache.isis.core.progmodel.facets.param.typicallen.annotation;
-
 import java.lang.annotation.Annotation;
 
 import org.apache.isis.applib.annotation.TypicalLength;
@@ -28,28 +27,28 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
 import org.apache.isis.core.metamodel.facets.AnnotationBasedFacetFactoryAbstract;
 import org.apache.isis.core.metamodel.facets.typicallength.TypicalLengthFacet;
-
-
-public class TypicalLengthAnnotationOnParameterFacetFactory extends AnnotationBasedFacetFactoryAbstract {
-
-    public TypicalLengthAnnotationOnParameterFacetFactory() {
-        super(FeatureType.PARAMETERS_ONLY);
-    }
-
-    @Override
-    public void processParams(ProcessParameterContext processParameterContext) {
-        final Annotation[] parameterAnnotations = getParameterAnnotations(processParameterContext.getMethod())[processParameterContext.getParamNum()];
-        for (int j = 0; j < parameterAnnotations.length; j++) {
-            if (parameterAnnotations[j] instanceof TypicalLength) {
-                final TypicalLength annotation = (TypicalLength) parameterAnnotations[j];
+
+public class TypicalLengthAnnotationOnParameterFacetFactory extends AnnotationBasedFacetFactoryAbstract {
+
+    public TypicalLengthAnnotationOnParameterFacetFactory() {
+        super(FeatureType.PARAMETERS_ONLY);
+    }
+
+    @Override
+    public void processParams(final ProcessParameterContext processParameterContext) {
+        final Annotation[] parameterAnnotations =
+            getParameterAnnotations(processParameterContext.getMethod())[processParameterContext.getParamNum()];
+        for (final Annotation parameterAnnotation : parameterAnnotations) {
+            if (parameterAnnotation instanceof TypicalLength) {
+                final TypicalLength annotation = (TypicalLength) parameterAnnotation;
                 FacetUtil.addFacet(create(annotation, processParameterContext.getFacetHolder()));
-                return;
-            }
-        }
-    }
-
-    private TypicalLengthFacet create(final TypicalLength annotation, final FacetHolder holder) {
-        return annotation != null ? new TypicalLengthFacetAnnotationOnParameter(annotation.value(), holder) : null;
-    }
-
-}
+                return;
+            }
+        }
+    }
+
+    private TypicalLengthFacet create(final TypicalLength annotation, final FacetHolder holder) {
+        return annotation != null ? new TypicalLengthFacetAnnotationOnParameter(annotation.value(), holder) : null;
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/typicallen/annotation/TypicalLengthFacetAnnotationOnParameter.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/typicallen/annotation/TypicalLengthFacetAnnotationOnParameter.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/typicallen/annotation/TypicalLengthFacetAnnotationOnParameter.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/typicallen/annotation/TypicalLengthFacetAnnotationOnParameter.java Tue Apr 26 22:03:43 2011
@@ -17,26 +17,23 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.param.typicallen.annotation;
 
-package org.apache.isis.core.progmodel.facets.param.typicallen.annotation;
-
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.typicallength.TypicalLengthFacetAbstract;
-
-
-public class TypicalLengthFacetAnnotationOnParameter extends TypicalLengthFacetAbstract {
-
-    private final int value;
-
-	public TypicalLengthFacetAnnotationOnParameter(final int value, final FacetHolder holder) {
-        super(holder, false);
-        this.value = value;
-    }
-
-	@Override
-	public int value() {
-		return value;
-	}
-
-}
-
+
+public class TypicalLengthFacetAnnotationOnParameter extends TypicalLengthFacetAbstract {
+
+    private final int value;
+
+    public TypicalLengthFacetAnnotationOnParameter(final int value, final FacetHolder holder) {
+        super(holder, false);
+        this.value = value;
+    }
+
+    @Override
+    public int value() {
+        return value;
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/typicallen/fromtype/TypicalLengthFacetForParameterDerivedFromType.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/typicallen/fromtype/TypicalLengthFacetForParameterDerivedFromType.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/typicallen/fromtype/TypicalLengthFacetForParameterDerivedFromType.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/typicallen/fromtype/TypicalLengthFacetForParameterDerivedFromType.java Tue Apr 26 22:03:43 2011
@@ -17,27 +17,27 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.param.typicallen.fromtype;
 
-package org.apache.isis.core.progmodel.facets.param.typicallen.fromtype;
-
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.multiline.MultiLineFacet;
 import org.apache.isis.core.metamodel.facets.typicallength.TypicalLengthFacet;
 import org.apache.isis.core.metamodel.facets.typicallength.TypicalLengthFacetAbstract;
-
-
-public class TypicalLengthFacetForParameterDerivedFromType extends TypicalLengthFacetAbstract {
-
-    private final TypicalLengthFacet typicalLengthFacet;
-
-	public TypicalLengthFacetForParameterDerivedFromType(final TypicalLengthFacet typicalLengthFacet, final FacetHolder holder) {
-        super(holder, true);
-        this.typicalLengthFacet = typicalLengthFacet;
-    }
-
-    public int value() {
-        final MultiLineFacet facet = getFacetHolder().getFacet(MultiLineFacet.class);
-        return facet.numberOfLines() * typicalLengthFacet.value();
-    }
-
-}
+
+public class TypicalLengthFacetForParameterDerivedFromType extends TypicalLengthFacetAbstract {
+
+    private final TypicalLengthFacet typicalLengthFacet;
+
+    public TypicalLengthFacetForParameterDerivedFromType(final TypicalLengthFacet typicalLengthFacet,
+        final FacetHolder holder) {
+        super(holder, true);
+        this.typicalLengthFacet = typicalLengthFacet;
+    }
+
+    @Override
+    public int value() {
+        final MultiLineFacet facet = getFacetHolder().getFacet(MultiLineFacet.class);
+        return facet.numberOfLines() * typicalLengthFacet.value();
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/typicallen/fromtype/TypicalLengthFacetForParameterDerivedFromTypeFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/typicallen/fromtype/TypicalLengthFacetForParameterDerivedFromTypeFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/typicallen/fromtype/TypicalLengthFacetForParameterDerivedFromTypeFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/typicallen/fromtype/TypicalLengthFacetForParameterDerivedFromTypeFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -17,9 +17,7 @@
  *  under the License.
  */
 
-
-package org.apache.isis.core.progmodel.facets.param.typicallen.fromtype;
-
+package org.apache.isis.core.progmodel.facets.param.typicallen.fromtype;
 
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
@@ -28,31 +26,31 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.FacetedMethodParameter;
 import org.apache.isis.core.metamodel.facets.typicallength.TypicalLengthFacet;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-
-
-public class TypicalLengthFacetForParameterDerivedFromTypeFacetFactory extends FacetFactoryAbstract {
-
-    public TypicalLengthFacetForParameterDerivedFromTypeFacetFactory() {
-        super(FeatureType.PARAMETERS_ONLY);
-    }
-
-    @Override
-    public void processParams(ProcessParameterContext processParameterContext) {
-        final Class<?> type = processParameterContext.getMethod().getParameterTypes()[processParameterContext.getParamNum()];
+
+public class TypicalLengthFacetForParameterDerivedFromTypeFacetFactory extends FacetFactoryAbstract {
+
+    public TypicalLengthFacetForParameterDerivedFromTypeFacetFactory() {
+        super(FeatureType.PARAMETERS_ONLY);
+    }
+
+    @Override
+    public void processParams(final ProcessParameterContext processParameterContext) {
+        final Class<?> type =
+            processParameterContext.getMethod().getParameterTypes()[processParameterContext.getParamNum()];
         final FacetedMethodParameter facetHolder = processParameterContext.getFacetHolder();
-        addFacetDerivedFromTypeIfPresent(facetHolder, type);
-    }
-
-    private void addFacetDerivedFromTypeIfPresent(final FacetHolder holder, final Class<?> type) {
-        final TypicalLengthFacet facet = getTypicalLengthFacet(type);
-        if (facet != null) {
+        addFacetDerivedFromTypeIfPresent(facetHolder, type);
+    }
+
+    private void addFacetDerivedFromTypeIfPresent(final FacetHolder holder, final Class<?> type) {
+        final TypicalLengthFacet facet = getTypicalLengthFacet(type);
+        if (facet != null) {
             FacetUtil.addFacet(new TypicalLengthFacetForParameterDerivedFromType(facet, holder));
-        }
-    }
-
-    private TypicalLengthFacet getTypicalLengthFacet(final Class<?> type) {
-        final ObjectSpecification paramTypeSpec = getSpecificationLookup().loadSpecification(type);
-        return paramTypeSpec.getFacet(TypicalLengthFacet.class);
-    }
-
-}
+        }
+    }
+
+    private TypicalLengthFacet getTypicalLengthFacet(final Class<?> type) {
+        final ObjectSpecification paramTypeSpec = getSpecificationLookup().loadSpecification(type);
+        return paramTypeSpec.getFacet(TypicalLengthFacet.class);
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/maskannot/MaskAnnotationForParameterFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/maskannot/MaskAnnotationForParameterFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/maskannot/MaskAnnotationForParameterFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/maskannot/MaskAnnotationForParameterFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -17,9 +17,7 @@
  *  under the License.
  */
 
-
-package org.apache.isis.core.progmodel.facets.param.validate.maskannot;
-
+package org.apache.isis.core.progmodel.facets.param.validate.maskannot;
 
 import org.apache.isis.applib.annotation.Mask;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
@@ -30,40 +28,42 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.progmodel.facets.object.mask.MaskFacet;
 import org.apache.isis.core.progmodel.facets.object.mask.TitleFacetBasedOnMask;
-
-
-public class MaskAnnotationForParameterFacetFactory extends AnnotationBasedFacetFactoryAbstract {
-
-    public MaskAnnotationForParameterFacetFactory() {
-        super(FeatureType.PARAMETERS_ONLY);
-    }
-
-    @Override
-    public void processParams(ProcessParameterContext processParameterContext) {
-        final Class<?>[] parameterTypes = processParameterContext.getMethod().getParameterTypes();
-        if (processParameterContext.getParamNum() >= parameterTypes.length) {
-            // ignore
-            return;
-        }
-
-        final java.lang.annotation.Annotation[] parameterAnnotations = getParameterAnnotations(processParameterContext.getMethod())[processParameterContext.getParamNum()];
-        for (int i = 0; i < parameterAnnotations.length; i++) {
-            if (parameterAnnotations[i] instanceof Mask) {
-                final Mask annotation = (Mask) parameterAnnotations[i];
-                addMaskFacetAndCorrespondingTitleFacet(processParameterContext.getFacetHolder(), annotation, parameterTypes[i]);
-                return;
-            }
-        }
-    }
-
-    private boolean addMaskFacetAndCorrespondingTitleFacet(final FacetHolder holder, final Mask annotation, Class<?> cls) {
+
+public class MaskAnnotationForParameterFacetFactory extends AnnotationBasedFacetFactoryAbstract {
+
+    public MaskAnnotationForParameterFacetFactory() {
+        super(FeatureType.PARAMETERS_ONLY);
+    }
+
+    @Override
+    public void processParams(final ProcessParameterContext processParameterContext) {
+        final Class<?>[] parameterTypes = processParameterContext.getMethod().getParameterTypes();
+        if (processParameterContext.getParamNum() >= parameterTypes.length) {
+            // ignore
+            return;
+        }
+
+        final java.lang.annotation.Annotation[] parameterAnnotations =
+            getParameterAnnotations(processParameterContext.getMethod())[processParameterContext.getParamNum()];
+        for (int i = 0; i < parameterAnnotations.length; i++) {
+            if (parameterAnnotations[i] instanceof Mask) {
+                final Mask annotation = (Mask) parameterAnnotations[i];
+                addMaskFacetAndCorrespondingTitleFacet(processParameterContext.getFacetHolder(), annotation,
+                    parameterTypes[i]);
+                return;
+            }
+        }
+    }
+
+    private boolean addMaskFacetAndCorrespondingTitleFacet(final FacetHolder holder, final Mask annotation,
+        final Class<?> cls) {
         final MaskFacet maskFacet = createMaskFacet(annotation, holder);
         if (maskFacet == null) {
             return false;
         }
         FacetUtil.addFacet(maskFacet);
 
-        ObjectSpecification type = getSpecificationLookup().loadSpecification(cls);
+        final ObjectSpecification type = getSpecificationLookup().loadSpecification(cls);
         final TitleFacet underlyingTitleFacet = type.getFacet(TitleFacet.class);
         if (underlyingTitleFacet != null) {
             final TitleFacet titleFacet = new TitleFacetBasedOnMask(maskFacet, underlyingTitleFacet);
@@ -76,5 +76,4 @@ public class MaskAnnotationForParameterF
         return annotation != null ? new MaskFacetAnnotationForParameter(annotation.value(), null, holder) : null;
     }
 
-
-}
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/maskannot/MaskFacetAnnotationForParameter.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/maskannot/MaskFacetAnnotationForParameter.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/maskannot/MaskFacetAnnotationForParameter.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/maskannot/MaskFacetAnnotationForParameter.java Tue Apr 26 22:03:43 2011
@@ -17,37 +17,35 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.param.validate.maskannot;
 
-package org.apache.isis.core.progmodel.facets.param.validate.maskannot;
-
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.progmodel.facets.object.mask.MaskEvaluator;
 import org.apache.isis.core.progmodel.facets.object.mask.MaskFacetAbstract;
-
-
-public class MaskFacetAnnotationForParameter extends MaskFacetAbstract {
-    private final MaskEvaluator evaluator;
-
-    public MaskFacetAnnotationForParameter(final String outputMask, String inputMask, final FacetHolder holder) {
-        super(outputMask, holder);
-        evaluator = inputMask == null ? null : new MaskEvaluator(inputMask);
-    }
-
-    public boolean doesNotMatch(final ObjectAdapter adapter) {
-        if (evaluator == null) {
-            return false;
-        } else {
-            if (adapter == null) {
-                return false;
-            }
-            final Object object = adapter.getObject();
-            if (object == null) {
-                return false;
-            }
-            return !evaluator.evaluate(object.toString());
-        }
-    }
-
-}
-
+
+public class MaskFacetAnnotationForParameter extends MaskFacetAbstract {
+    private final MaskEvaluator evaluator;
+
+    public MaskFacetAnnotationForParameter(final String outputMask, final String inputMask, final FacetHolder holder) {
+        super(outputMask, holder);
+        evaluator = inputMask == null ? null : new MaskEvaluator(inputMask);
+    }
+
+    @Override
+    public boolean doesNotMatch(final ObjectAdapter adapter) {
+        if (evaluator == null) {
+            return false;
+        } else {
+            if (adapter == null) {
+                return false;
+            }
+            final Object object = adapter.getObject();
+            if (object == null) {
+                return false;
+            }
+            return !evaluator.evaluate(object.toString());
+        }
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/maxlenannot/MaxLengthAnnotationForParameterFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/maxlenannot/MaxLengthAnnotationForParameterFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/maxlenannot/MaxLengthAnnotationForParameterFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/maxlenannot/MaxLengthAnnotationForParameterFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -17,9 +17,9 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.param.validate.maxlenannot;
 
-package org.apache.isis.core.progmodel.facets.param.validate.maxlenannot;
-
+import java.lang.annotation.Annotation;
 
 import org.apache.isis.applib.annotation.MaxLength;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
@@ -27,28 +27,28 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
 import org.apache.isis.core.metamodel.facets.AnnotationBasedFacetFactoryAbstract;
 import org.apache.isis.core.metamodel.facets.propparam.maxlength.MaxLengthFacet;
-
-
-public class MaxLengthAnnotationForParameterFacetFactory extends AnnotationBasedFacetFactoryAbstract {
-
-    public MaxLengthAnnotationForParameterFacetFactory() {
-        super(FeatureType.PARAMETERS_ONLY);
-    }
-
-    @Override
-    public void processParams(ProcessParameterContext processParameterContext) {
-        final java.lang.annotation.Annotation[] parameterAnnotations = getParameterAnnotations(processParameterContext.getMethod())[processParameterContext.getParamNum()];
-
-        for (int j = 0; j < parameterAnnotations.length; j++) {
-            if (parameterAnnotations[j] instanceof MaxLength) {
-                final MaxLength annotation = (MaxLength) parameterAnnotations[j];
+
+public class MaxLengthAnnotationForParameterFacetFactory extends AnnotationBasedFacetFactoryAbstract {
+
+    public MaxLengthAnnotationForParameterFacetFactory() {
+        super(FeatureType.PARAMETERS_ONLY);
+    }
+
+    @Override
+    public void processParams(final ProcessParameterContext processParameterContext) {
+        final java.lang.annotation.Annotation[] parameterAnnotations =
+            getParameterAnnotations(processParameterContext.getMethod())[processParameterContext.getParamNum()];
+
+        for (final Annotation parameterAnnotation : parameterAnnotations) {
+            if (parameterAnnotation instanceof MaxLength) {
+                final MaxLength annotation = (MaxLength) parameterAnnotation;
                 FacetUtil.addFacet(create(annotation, processParameterContext.getFacetHolder()));
-                return;
-            }
-        }
-    }
-
-    private MaxLengthFacet create(final MaxLength annotation, final FacetHolder holder) {
-        return annotation == null ? null : new MaxLengthFacetAnnotationForParameter(annotation.value(), holder);
-    }
-}
+                return;
+            }
+        }
+    }
+
+    private MaxLengthFacet create(final MaxLength annotation, final FacetHolder holder) {
+        return annotation == null ? null : new MaxLengthFacetAnnotationForParameter(annotation.value(), holder);
+    }
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/maxlenannot/MaxLengthFacetAnnotationForParameter.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/maxlenannot/MaxLengthFacetAnnotationForParameter.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/maxlenannot/MaxLengthFacetAnnotationForParameter.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/maxlenannot/MaxLengthFacetAnnotationForParameter.java Tue Apr 26 22:03:43 2011
@@ -17,18 +17,15 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.param.validate.maxlenannot;
 
-package org.apache.isis.core.progmodel.facets.param.validate.maxlenannot;
-
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.propparam.maxlength.MaxLengthFacetAbstract;
-
-
-public class MaxLengthFacetAnnotationForParameter extends MaxLengthFacetAbstract {
-
-    public MaxLengthFacetAnnotationForParameter(final int value, final FacetHolder holder) {
-        super(value, holder);
-    }
-
-}
-
+
+public class MaxLengthFacetAnnotationForParameter extends MaxLengthFacetAbstract {
+
+    public MaxLengthFacetAnnotationForParameter(final int value, final FacetHolder holder) {
+        super(value, holder);
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/perspec/MustSatisfySpecificationOnParameterFacet.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/perspec/MustSatisfySpecificationOnParameterFacet.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/perspec/MustSatisfySpecificationOnParameterFacet.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/perspec/MustSatisfySpecificationOnParameterFacet.java Tue Apr 26 22:03:43 2011
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.param.validate.perspec;
 
-package org.apache.isis.core.progmodel.facets.param.validate.perspec;
-
 import java.util.List;
 
 import org.apache.isis.applib.events.ValidityEvent;
@@ -32,32 +31,33 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.interactions.ProposedHolder;
 import org.apache.isis.core.metamodel.interactions.ValidatingInteractionAdvisor;
 import org.apache.isis.core.metamodel.interactions.ValidityContext;
-
-public class MustSatisfySpecificationOnParameterFacet extends FacetAbstract implements ValidatingInteractionAdvisor {
-
-    public static Class<? extends Facet> type() {
-        return MustSatisfySpecificationOnParameterFacet.class;
-    }
-
-    private final List<Specification> specifications;
-
-    public MustSatisfySpecificationOnParameterFacet(final List<Specification> specifications, final FacetHolder holder) {
-        super(type(), holder, false);
-        this.specifications = specifications;
-    }
-
-    public String invalidates(final ValidityContext<? extends ValidityEvent> validityContext) {
-        if (!(validityContext instanceof ProposedHolder)) {
-            return null;
-        }
-        ProposedHolder proposedHolder = (ProposedHolder) validityContext;
-        final ObjectAdapter targetNO = proposedHolder.getProposed();
-        final Object targetObject = targetNO.getObject();
-        ReasonBuffer buf = new ReasonBuffer();
-        for(Specification specification: specifications) {
-            buf.append(specification.satisfies(targetObject));
-        }
-        return buf.getReason();
-    }
-
-}
+
+public class MustSatisfySpecificationOnParameterFacet extends FacetAbstract implements ValidatingInteractionAdvisor {
+
+    public static Class<? extends Facet> type() {
+        return MustSatisfySpecificationOnParameterFacet.class;
+    }
+
+    private final List<Specification> specifications;
+
+    public MustSatisfySpecificationOnParameterFacet(final List<Specification> specifications, final FacetHolder holder) {
+        super(type(), holder, false);
+        this.specifications = specifications;
+    }
+
+    @Override
+    public String invalidates(final ValidityContext<? extends ValidityEvent> validityContext) {
+        if (!(validityContext instanceof ProposedHolder)) {
+            return null;
+        }
+        final ProposedHolder proposedHolder = (ProposedHolder) validityContext;
+        final ObjectAdapter targetNO = proposedHolder.getProposed();
+        final Object targetObject = targetNO.getObject();
+        final ReasonBuffer buf = new ReasonBuffer();
+        for (final Specification specification : specifications) {
+            buf.append(specification.satisfies(targetObject));
+        }
+        return buf.getReason();
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/perspec/MustSatisfySpecificationOnParameterFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/perspec/MustSatisfySpecificationOnParameterFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/perspec/MustSatisfySpecificationOnParameterFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/perspec/MustSatisfySpecificationOnParameterFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -17,9 +17,9 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.param.validate.perspec;
 
-package org.apache.isis.core.progmodel.facets.param.validate.perspec;
-
+import java.lang.annotation.Annotation;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -30,52 +30,53 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
 import org.apache.isis.core.metamodel.facets.AnnotationBasedFacetFactoryAbstract;
-
-public class MustSatisfySpecificationOnParameterFacetFactory  extends AnnotationBasedFacetFactoryAbstract {
-
-    public MustSatisfySpecificationOnParameterFacetFactory() {
-        super(FeatureType.PARAMETERS_ONLY);
-    }
-
-    @Override
-    public void processParams(ProcessParameterContext processParameterContext) {
-        final java.lang.annotation.Annotation[] parameterAnnotations = getParameterAnnotations(processParameterContext.getMethod())[processParameterContext.getParamNum()];
-
-        for (int j = 0; j < parameterAnnotations.length; j++) {
-            if (parameterAnnotations[j] instanceof MustSatisfy) {
-                final MustSatisfy annotation = (MustSatisfy) parameterAnnotations[j];
-                FacetUtil.addFacet(create(annotation, processParameterContext.getFacetHolder()));
-                return; 
-            }
-        }
-    }
-    
-    private Facet create(final MustSatisfy annotation, final FacetHolder holder) {
-        if (annotation == null) {
-            return null;
-        }
-        Class<?>[] values = annotation.value();
-        List<Specification> specifications = new ArrayList<Specification>();
-        for(Class<?> value: values) {
-            Specification specification = newSpecificationElseNull(value);
-            if (specification != null) {
-                specifications.add(specification);
-            }
-        }
-        return specifications.size() > 0 ? new MustSatisfySpecificationOnParameterFacet(specifications, holder) : null;
-    }
-
-    private static Specification newSpecificationElseNull(Class<?> value) {
-        if (!(Specification.class.isAssignableFrom(value))) {
-            return null;
-        }
-        try {
-            return (Specification) value.newInstance();
-        } catch (InstantiationException e) {
-            return null;
-        } catch (IllegalAccessException e) {
-            return null;
-        }
-    }
-
-}
+
+public class MustSatisfySpecificationOnParameterFacetFactory extends AnnotationBasedFacetFactoryAbstract {
+
+    public MustSatisfySpecificationOnParameterFacetFactory() {
+        super(FeatureType.PARAMETERS_ONLY);
+    }
+
+    @Override
+    public void processParams(final ProcessParameterContext processParameterContext) {
+        final java.lang.annotation.Annotation[] parameterAnnotations =
+            getParameterAnnotations(processParameterContext.getMethod())[processParameterContext.getParamNum()];
+
+        for (final Annotation parameterAnnotation : parameterAnnotations) {
+            if (parameterAnnotation instanceof MustSatisfy) {
+                final MustSatisfy annotation = (MustSatisfy) parameterAnnotation;
+                FacetUtil.addFacet(create(annotation, processParameterContext.getFacetHolder()));
+                return;
+            }
+        }
+    }
+
+    private Facet create(final MustSatisfy annotation, final FacetHolder holder) {
+        if (annotation == null) {
+            return null;
+        }
+        final Class<?>[] values = annotation.value();
+        final List<Specification> specifications = new ArrayList<Specification>();
+        for (final Class<?> value : values) {
+            final Specification specification = newSpecificationElseNull(value);
+            if (specification != null) {
+                specifications.add(specification);
+            }
+        }
+        return specifications.size() > 0 ? new MustSatisfySpecificationOnParameterFacet(specifications, holder) : null;
+    }
+
+    private static Specification newSpecificationElseNull(final Class<?> value) {
+        if (!(Specification.class.isAssignableFrom(value))) {
+            return null;
+        }
+        try {
+            return (Specification) value.newInstance();
+        } catch (final InstantiationException e) {
+            return null;
+        } catch (final IllegalAccessException e) {
+            return null;
+        }
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/regexannot/RegExFacetAnnotationForParameter.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/regexannot/RegExFacetAnnotationForParameter.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/regexannot/RegExFacetAnnotationForParameter.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/param/validate/regexannot/RegExFacetAnnotationForParameter.java Tue Apr 26 22:03:43 2011
@@ -17,48 +17,44 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.param.validate.regexannot;
 
-package org.apache.isis.core.progmodel.facets.param.validate.regexannot;
-
 import java.util.regex.Pattern;
 
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.progmodel.facets.object.regex.RegExFacetAbstract;
-
-
-public class RegExFacetAnnotationForParameter extends RegExFacetAbstract {
-
-    private final Pattern pattern;
-
-    public RegExFacetAnnotationForParameter(
-            final String validation,
-            final String format,
-            final boolean caseSensitive,
-            final FacetHolder holder) {
-        super(validation, format, caseSensitive, holder);
-        pattern = Pattern.compile(validation(), patternFlags());
-    }
-
-    public String format(final String text) {
-        if (text == null) {
-            return "<not a string>";
-        }
-        if (format() == null || format().length() == 0) {
-            return text;
-        }
-        return pattern.matcher(text).replaceAll(format());
-    }
-
-    public boolean doesNotMatch(final String text) {
-        if (text == null) {
-            return true;
-        }
-        return !pattern.matcher(text).matches();
-    }
-
-    private int patternFlags() {
-        return !caseSensitive() ? Pattern.CASE_INSENSITIVE : 0;
-    }
-
-}
-
+
+public class RegExFacetAnnotationForParameter extends RegExFacetAbstract {
+
+    private final Pattern pattern;
+
+    public RegExFacetAnnotationForParameter(final String validation, final String format, final boolean caseSensitive,
+        final FacetHolder holder) {
+        super(validation, format, caseSensitive, holder);
+        pattern = Pattern.compile(validation(), patternFlags());
+    }
+
+    @Override
+    public String format(final String text) {
+        if (text == null) {
+            return "<not a string>";
+        }
+        if (format() == null || format().length() == 0) {
+            return text;
+        }
+        return pattern.matcher(text).replaceAll(format());
+    }
+
+    @Override
+    public boolean doesNotMatch(final String text) {
+        if (text == null) {
+            return true;
+        }
+        return !pattern.matcher(text).matches();
+    }
+
+    private int patternFlags() {
+        return !caseSensitive() ? Pattern.CASE_INSENSITIVE : 0;
+    }
+
+}



Mime
View raw message