isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1096928 [13/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/properties/modify/PropertyModifyFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/modify/PropertyModifyFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/modify/PropertyModifyFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/modify/PropertyModifyFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.properties.modify;
 
-package org.apache.isis.core.progmodel.facets.properties.modify;
-
 import java.lang.reflect.Method;
 
 import org.apache.isis.core.commons.lang.NameUtils;
@@ -30,40 +29,41 @@ import org.apache.isis.core.metamodel.me
 import org.apache.isis.core.progmodel.facets.MethodFinderUtils;
 import org.apache.isis.core.progmodel.facets.MethodPrefixBasedFacetFactoryAbstract;
 import org.apache.isis.core.progmodel.facets.MethodPrefixConstants;
-
-
-public class PropertyModifyFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
-
-    private static final String[] PREFIXES = { MethodPrefixConstants.MODIFY_PREFIX };
-
-    public PropertyModifyFacetFactory() {
-        super(FeatureType.PROPERTIES_ONLY, PREFIXES);
-    }
-
+
+public class PropertyModifyFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
+
+    private static final String[] PREFIXES = { MethodPrefixConstants.MODIFY_PREFIX };
+
+    public PropertyModifyFacetFactory() {
+        super(FeatureType.PROPERTIES_ONLY, PREFIXES);
+    }
+
     @Override
-    public void process(ProcessMethodContext processMethodContext) {
+    public void process(final ProcessMethodContext processMethodContext) {
 
         attachPropertyModifyFacetIfModifyMethodIsFound(processMethodContext);
     }
 
-    private void attachPropertyModifyFacetIfModifyMethodIsFound(ProcessMethodContext processMethodContext) {
-        
+    private void attachPropertyModifyFacetIfModifyMethodIsFound(final ProcessMethodContext processMethodContext) {
+
         final Method getMethod = processMethodContext.getMethod();
         final String capitalizedName = NameUtils.javaBaseName(getMethod.getName());
-        
+
         final Class<?> returnType = getMethod.getReturnType();
         final Class<?>[] paramTypes = new Class[] { returnType };
-        
-        Class<?> cls = processMethodContext.getCls();
-        final Method modifyMethod = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.MODIFY_PREFIX + capitalizedName, void.class, paramTypes);
-        
+
+        final Class<?> cls = processMethodContext.getCls();
+        final Method modifyMethod =
+            MethodFinderUtils.findMethod(cls, MethodScope.OBJECT,
+                MethodPrefixConstants.MODIFY_PREFIX + capitalizedName, void.class, paramTypes);
+
         if (modifyMethod == null) {
             return;
-        } 
+        }
         processMethodContext.removeMethod(modifyMethod);
-        
+
         final FacetHolder property = processMethodContext.getFacetHolder();
         FacetUtil.addFacet(new PropertySetterFacetViaModifyMethod(modifyMethod, property));
     }
 
-}
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/modify/PropertySetAndClearFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/modify/PropertySetAndClearFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/modify/PropertySetAndClearFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/modify/PropertySetAndClearFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.properties.modify;
 
-package org.apache.isis.core.progmodel.facets.properties.modify;
-
 import java.lang.reflect.Method;
 
 import org.apache.isis.core.commons.lang.NameUtils;
@@ -33,41 +32,41 @@ import org.apache.isis.core.progmodel.fa
 import org.apache.isis.core.progmodel.facets.members.disable.DisabledFacet;
 import org.apache.isis.core.progmodel.facets.members.disable.staticmethod.DisabledFacetAlways;
 import org.apache.isis.core.progmodel.facets.properties.derived.inferred.DerivedFacetInferred;
-
-
-public class PropertySetAndClearFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
-
-    private static final String[] PREFIXES = { MethodPrefixConstants.SET_PREFIX, MethodPrefixConstants.CLEAR_PREFIX };
-
-    public PropertySetAndClearFacetFactory() {
-        super(FeatureType.PROPERTIES_ONLY, PREFIXES);
-    }
-
+
+public class PropertySetAndClearFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
+
+    private static final String[] PREFIXES = { MethodPrefixConstants.SET_PREFIX, MethodPrefixConstants.CLEAR_PREFIX };
+
+    public PropertySetAndClearFacetFactory() {
+        super(FeatureType.PROPERTIES_ONLY, PREFIXES);
+    }
+
     @Override
-    public void process(ProcessMethodContext processMethodContext) {
+    public void process(final ProcessMethodContext processMethodContext) {
 
-        Method setMethod = attachPropertyModifyFacetIfSetterIsFound(processMethodContext);
-        Method clearMethod = attachPropertyClearFacetIfClearMethodIsFound(processMethodContext);
+        final Method setMethod = attachPropertyModifyFacetIfSetterIsFound(processMethodContext);
+        final Method clearMethod = attachPropertyClearFacetIfClearMethodIsFound(processMethodContext);
 
         attachPropertyClearFacetUsingSetterIfRequired(processMethodContext, setMethod, clearMethod);
     }
 
     /**
-     * Sets up the {@link PropertySetterFacetViaSetterMethod} to invoke the property's setter if available,
-     * but if none then marks the property as {@link DerivedFacet derived} and {@link DisabledFacet disabled}
-     * otherwise.
+     * Sets up the {@link PropertySetterFacetViaSetterMethod} to invoke the property's setter if available, but if none
+     * then marks the property as {@link DerivedFacet derived} and {@link DisabledFacet disabled} otherwise.
      */
-    private static Method attachPropertyModifyFacetIfSetterIsFound(ProcessMethodContext processMethodContext) {
-        
+    private static Method attachPropertyModifyFacetIfSetterIsFound(final ProcessMethodContext processMethodContext) {
+
         final Method getMethod = processMethodContext.getMethod();
         final String capitalizedName = NameUtils.javaBaseName(getMethod.getName());
-        
-        Class<?> cls = processMethodContext.getCls();
+
+        final Class<?> cls = processMethodContext.getCls();
         final Class<?> returnType = getMethod.getReturnType();
         final Class<?>[] paramTypes = new Class[] { returnType };
-        Method setMethod = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.SET_PREFIX + capitalizedName, void.class, paramTypes);
+        final Method setMethod =
+            MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.SET_PREFIX + capitalizedName,
+                void.class, paramTypes);
         processMethodContext.removeMethod(setMethod);
-        
+
         final FacetHolder property = processMethodContext.getFacetHolder();
         if (setMethod != null) {
             FacetUtil.addFacet(new PropertySetterFacetViaSetterMethod(setMethod, property));
@@ -76,40 +75,41 @@ public class PropertySetAndClearFacetFac
             FacetUtil.addFacet(new DerivedFacetInferred(property));
             FacetUtil.addFacet(new DisabledFacetAlways(property));
         }
-        
+
         return setMethod;
     }
 
-    private Method attachPropertyClearFacetIfClearMethodIsFound(ProcessMethodContext processMethodContext) {
-        Class<?> cls = processMethodContext.getCls();
+    private Method attachPropertyClearFacetIfClearMethodIsFound(final ProcessMethodContext processMethodContext) {
+        final Class<?> cls = processMethodContext.getCls();
         final Method getMethod = processMethodContext.getMethod();
         final FacetHolder property = processMethodContext.getFacetHolder();
 
         final String capitalizedName = NameUtils.javaBaseName(getMethod.getName());
-        final Method clearMethod = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.CLEAR_PREFIX + capitalizedName, void.class, NO_PARAMETERS_TYPES);
-        
+        final Method clearMethod =
+            MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.CLEAR_PREFIX + capitalizedName,
+                void.class, NO_PARAMETERS_TYPES);
+
         if (clearMethod == null) {
             return null;
-        } 
+        }
         processMethodContext.removeMethod(clearMethod);
-        
+
         FacetUtil.addFacet(new PropertyClearFacetViaClearMethod(clearMethod, property));
-        
+
         return clearMethod;
     }
 
-    private static void attachPropertyClearFacetUsingSetterIfRequired(ProcessMethodContext processMethodContext, Method setMethod,
-        Method clearMethod) {
-        
+    private static void attachPropertyClearFacetUsingSetterIfRequired(final ProcessMethodContext processMethodContext,
+        final Method setMethod, final Method clearMethod) {
+
         if (clearMethod != null) {
             return;
         }
         if (setMethod == null) {
             return;
-        } 
+        }
         final FacetHolder property = processMethodContext.getFacetHolder();
         FacetUtil.addFacet(new PropertyClearFacetViaSetterMethod(setMethod, property));
     }
 
-
-}
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/modify/PropertySetterFacetViaModifyMethod.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/modify/PropertySetterFacetViaModifyMethod.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/modify/PropertySetterFacetViaModifyMethod.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/modify/PropertySetterFacetViaModifyMethod.java Tue Apr 26 22:03:43 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.properties.modify;
 
 import java.lang.reflect.Method;
@@ -30,33 +29,34 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.ImperativeFacet;
 import org.apache.isis.core.metamodel.facets.properties.modify.PropertySetterFacetAbstract;
 
-
 public class PropertySetterFacetViaModifyMethod extends PropertySetterFacetAbstract implements ImperativeFacet {
 
     private final Method method;
 
-    public PropertySetterFacetViaModifyMethod(
-    		final Method method, 
-    		final FacetHolder holder) {
+    public PropertySetterFacetViaModifyMethod(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 true;
-	}
+    @Override
+    public boolean impliesObjectChanged() {
+        return true;
+    }
 
+    @Override
     public void setProperty(final ObjectAdapter adapter, final ObjectAdapter valueAdapter) {
         AdapterInvokeUtils.invoke(method, adapter, valueAdapter);
     }
@@ -67,4 +67,3 @@ public class PropertySetterFacetViaModif
     }
 
 }
-

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/modify/PropertySetterFacetViaSetterMethod.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/modify/PropertySetterFacetViaSetterMethod.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/modify/PropertySetterFacetViaSetterMethod.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/modify/PropertySetterFacetViaSetterMethod.java Tue Apr 26 22:03:43 2011
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.properties.modify;
 
-package org.apache.isis.core.progmodel.facets.properties.modify;
-
 import java.lang.reflect.Method;
 import java.util.Collections;
 import java.util.List;
@@ -29,41 +28,42 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.ImperativeFacet;
 import org.apache.isis.core.metamodel.facets.properties.modify.PropertySetterFacetAbstract;
-
-
-public class PropertySetterFacetViaSetterMethod extends PropertySetterFacetAbstract implements ImperativeFacet {
-
-    private final Method method;
-
-    public PropertySetterFacetViaSetterMethod(
-    		final Method method, 
-    		final FacetHolder holder) {
-        super(holder);
-        this.method = method;
-    }
-
-    /**
-     * Returns a singleton list of the {@link Method} provided in the constructor. 
-     */
-    public List<Method> getMethods() {
-    	return Collections.singletonList(method);
-    }
-
-	public boolean impliesResolve() {
-		return true;
-	}
-
-	public boolean impliesObjectChanged() {
-		return true;
-	}
-
-    public void setProperty(final ObjectAdapter adapter, final ObjectAdapter valueAdapter) {
-        AdapterInvokeUtils.invoke(method, adapter, valueAdapter);
-    }
-
-    @Override
-    protected String toStringValues() {
-        return "method=" + method;
-    }
-
-}
+
+public class PropertySetterFacetViaSetterMethod extends PropertySetterFacetAbstract implements ImperativeFacet {
+
+    private final Method method;
+
+    public PropertySetterFacetViaSetterMethod(final Method method, final FacetHolder holder) {
+        super(holder);
+        this.method = method;
+    }
+
+    /**
+     * Returns a singleton list of the {@link Method} provided in the constructor.
+     */
+    @Override
+    public List<Method> getMethods() {
+        return Collections.singletonList(method);
+    }
+
+    @Override
+    public boolean impliesResolve() {
+        return true;
+    }
+
+    @Override
+    public boolean impliesObjectChanged() {
+        return true;
+    }
+
+    @Override
+    public void setProperty(final ObjectAdapter adapter, final ObjectAdapter valueAdapter) {
+        AdapterInvokeUtils.invoke(method, adapter, valueAdapter);
+    }
+
+    @Override
+    protected String toStringValues() {
+        return "method=" + method;
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/multiline/annotation/MultiLineAnnotationOnPropertyFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/multiline/annotation/MultiLineAnnotationOnPropertyFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/multiline/annotation/MultiLineAnnotationOnPropertyFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/multiline/annotation/MultiLineAnnotationOnPropertyFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -17,36 +17,34 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.properties.multiline.annotation;
 
-package org.apache.isis.core.progmodel.facets.properties.multiline.annotation;
-
 import org.apache.isis.applib.annotation.MultiLine;
 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.facets.AnnotationBasedFacetFactoryAbstract;
 import org.apache.isis.core.metamodel.facets.multiline.MultiLineFacet;
-
-
-public class MultiLineAnnotationOnPropertyFacetFactory extends AnnotationBasedFacetFactoryAbstract {
-
-    public MultiLineAnnotationOnPropertyFacetFactory() {
-        super(FeatureType.PROPERTIES_ONLY);
-    }
-
-    @Override
-    public void process(ProcessMethodContext processMethodContext) {
-        final Class<?> returnType = processMethodContext.getMethod().getReturnType();
-        if (!isString(returnType)) {
-            return;
-        }
-        final MultiLine annotation = getAnnotation(processMethodContext.getMethod(), MultiLine.class);
-        FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
-    }
-
-    private MultiLineFacet create(final MultiLine annotation, final FacetHolder holder) {
-        return (annotation != null) ? new MultiLineFacetAnnotationOnProperty(annotation.numberOfLines(), annotation.preventWrapping(),
-                holder) : null;
-    }
-
-}
+
+public class MultiLineAnnotationOnPropertyFacetFactory extends AnnotationBasedFacetFactoryAbstract {
+
+    public MultiLineAnnotationOnPropertyFacetFactory() {
+        super(FeatureType.PROPERTIES_ONLY);
+    }
+
+    @Override
+    public void process(final ProcessMethodContext processMethodContext) {
+        final Class<?> returnType = processMethodContext.getMethod().getReturnType();
+        if (!isString(returnType)) {
+            return;
+        }
+        final MultiLine annotation = getAnnotation(processMethodContext.getMethod(), MultiLine.class);
+        FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
+    }
+
+    private MultiLineFacet create(final MultiLine annotation, final FacetHolder holder) {
+        return (annotation != null) ? new MultiLineFacetAnnotationOnProperty(annotation.numberOfLines(),
+            annotation.preventWrapping(), holder) : null;
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/multiline/annotation/MultiLineFacetAnnotationOnProperty.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/multiline/annotation/MultiLineFacetAnnotationOnProperty.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/multiline/annotation/MultiLineFacetAnnotationOnProperty.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/multiline/annotation/MultiLineFacetAnnotationOnProperty.java Tue Apr 26 22:03:43 2011
@@ -17,18 +17,16 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.properties.multiline.annotation;
 
-package org.apache.isis.core.progmodel.facets.properties.multiline.annotation;
-
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.multiline.MultiLineFacetAbstract;
-
-
-public class MultiLineFacetAnnotationOnProperty extends MultiLineFacetAbstract {
-
-    public MultiLineFacetAnnotationOnProperty(final int numberOfLines, final boolean preventWrapping, final FacetHolder holder) {
-        super(numberOfLines, preventWrapping, holder);
-    }
-
-}
-
+
+public class MultiLineFacetAnnotationOnProperty extends MultiLineFacetAbstract {
+
+    public MultiLineFacetAnnotationOnProperty(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/properties/notpersisted/annotation/NotPersistedAnnotationForPropertyFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/notpersisted/annotation/NotPersistedAnnotationForPropertyFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/notpersisted/annotation/NotPersistedAnnotationForPropertyFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/notpersisted/annotation/NotPersistedAnnotationForPropertyFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -17,9 +17,7 @@
  *  under the License.
  */
 
-
-package org.apache.isis.core.progmodel.facets.properties.notpersisted.annotation;
-
+package org.apache.isis.core.progmodel.facets.properties.notpersisted.annotation;
 
 import org.apache.isis.applib.annotation.NotPersisted;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
@@ -27,22 +25,21 @@ 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.notpersisted.NotPersistedFacet;
-
-
-public class NotPersistedAnnotationForPropertyFacetFactory extends AnnotationBasedFacetFactoryAbstract {
-
-    public NotPersistedAnnotationForPropertyFacetFactory() {
-        super(FeatureType.PROPERTIES_ONLY);
-    }
-
-    @Override
-    public void process(ProcessMethodContext processMethodContext) {
-        final NotPersisted annotation = getAnnotation(processMethodContext.getMethod(), NotPersisted.class);
-        FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
-    }
-
-    private NotPersistedFacet create(final NotPersisted annotation, final FacetHolder holder) {
-        return annotation == null ? null : new NotPersistedFacetAnnotationForProperty(holder);
-    }
-
-}
+
+public class NotPersistedAnnotationForPropertyFacetFactory extends AnnotationBasedFacetFactoryAbstract {
+
+    public NotPersistedAnnotationForPropertyFacetFactory() {
+        super(FeatureType.PROPERTIES_ONLY);
+    }
+
+    @Override
+    public void process(final ProcessMethodContext processMethodContext) {
+        final NotPersisted annotation = getAnnotation(processMethodContext.getMethod(), NotPersisted.class);
+        FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
+    }
+
+    private NotPersistedFacet create(final NotPersisted annotation, final FacetHolder holder) {
+        return annotation == null ? null : new NotPersistedFacetAnnotationForProperty(holder);
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/notpersisted/annotation/NotPersistedFacetAnnotationForProperty.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/notpersisted/annotation/NotPersistedFacetAnnotationForProperty.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/notpersisted/annotation/NotPersistedFacetAnnotationForProperty.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/notpersisted/annotation/NotPersistedFacetAnnotationForProperty.java Tue Apr 26 22:03:43 2011
@@ -17,27 +17,25 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.properties.notpersisted.annotation;
 
-package org.apache.isis.core.progmodel.facets.properties.notpersisted.annotation;
-
 import org.apache.isis.applib.events.UsabilityEvent;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.notpersisted.NotPersistedFacetAbstract;
 import org.apache.isis.core.metamodel.interactions.UsabilityContext;
-
-
-public class NotPersistedFacetAnnotationForProperty extends NotPersistedFacetAbstract {
-
-    public NotPersistedFacetAnnotationForProperty(final FacetHolder holder) {
-        super(holder);
-    }
-
-    /**
-     * Always returns <i>Not Persisted</i>.
-     */
-    public String disables(final UsabilityContext<? extends UsabilityEvent> ic) {
-        return "Not Persisted";
-    }
-
-}
-
+
+public class NotPersistedFacetAnnotationForProperty extends NotPersistedFacetAbstract {
+
+    public NotPersistedFacetAnnotationForProperty(final FacetHolder holder) {
+        super(holder);
+    }
+
+    /**
+     * Always returns <i>Not Persisted</i>.
+     */
+    @Override
+    public String disables(final UsabilityContext<? extends UsabilityEvent> ic) {
+        return "Not Persisted";
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/typicallen/annotation/TypicalLengthAnnotationOnPropertyFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/typicallen/annotation/TypicalLengthAnnotationOnPropertyFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/typicallen/annotation/TypicalLengthAnnotationOnPropertyFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/typicallen/annotation/TypicalLengthAnnotationOnPropertyFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -17,33 +17,31 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.properties.typicallen.annotation;
 
-package org.apache.isis.core.progmodel.facets.properties.typicallen.annotation;
-
 import org.apache.isis.applib.annotation.TypicalLength;
 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.facets.AnnotationBasedFacetFactoryAbstract;
 import org.apache.isis.core.metamodel.facets.typicallength.TypicalLengthFacet;
-
-
-public class TypicalLengthAnnotationOnPropertyFacetFactory extends AnnotationBasedFacetFactoryAbstract {
-
-    public TypicalLengthAnnotationOnPropertyFacetFactory() {
-        super(FeatureType.PROPERTIES_ONLY);
-    }
-
-    @Override
-    public void process(ProcessMethodContext processMethodContext) {
-        final TypicalLength annotation = getAnnotation(processMethodContext.getMethod(), TypicalLength.class);
-        final TypicalLengthFacet facet = create(annotation, processMethodContext.getFacetHolder());
-
-        FacetUtil.addFacet(facet);
-    }
-
-    private TypicalLengthFacet create(final TypicalLength annotation, final FacetHolder holder) {
-        return annotation != null ? new TypicalLengthFacetAnnotationOnProperty(annotation.value(), holder) : null;
-    }
-
-}
+
+public class TypicalLengthAnnotationOnPropertyFacetFactory extends AnnotationBasedFacetFactoryAbstract {
+
+    public TypicalLengthAnnotationOnPropertyFacetFactory() {
+        super(FeatureType.PROPERTIES_ONLY);
+    }
+
+    @Override
+    public void process(final ProcessMethodContext processMethodContext) {
+        final TypicalLength annotation = getAnnotation(processMethodContext.getMethod(), TypicalLength.class);
+        final TypicalLengthFacet facet = create(annotation, processMethodContext.getFacetHolder());
+
+        FacetUtil.addFacet(facet);
+    }
+
+    private TypicalLengthFacet create(final TypicalLength annotation, final FacetHolder holder) {
+        return annotation != null ? new TypicalLengthFacetAnnotationOnProperty(annotation.value(), holder) : null;
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/typicallen/annotation/TypicalLengthFacetAnnotationOnProperty.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/typicallen/annotation/TypicalLengthFacetAnnotationOnProperty.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/typicallen/annotation/TypicalLengthFacetAnnotationOnProperty.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/typicallen/annotation/TypicalLengthFacetAnnotationOnProperty.java Tue Apr 26 22:03:43 2011
@@ -17,26 +17,23 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.properties.typicallen.annotation;
 
-package org.apache.isis.core.progmodel.facets.properties.typicallen.annotation;
-
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.typicallength.TypicalLengthFacetAbstract;
-
-
-public class TypicalLengthFacetAnnotationOnProperty extends TypicalLengthFacetAbstract {
-
-    private final int value;
-
-	public TypicalLengthFacetAnnotationOnProperty(final int value, final FacetHolder holder) {
-        super(holder, false);
-        this.value = value;
-    }
-
-	@Override
-	public int value() {
-		return value;
-	}
-
-}
-
+
+public class TypicalLengthFacetAnnotationOnProperty extends TypicalLengthFacetAbstract {
+
+    private final int value;
+
+    public TypicalLengthFacetAnnotationOnProperty(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/properties/typicallen/fromtype/TypicalLengthFacetForPropertyDerivedFromType.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/typicallen/fromtype/TypicalLengthFacetForPropertyDerivedFromType.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/typicallen/fromtype/TypicalLengthFacetForPropertyDerivedFromType.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/typicallen/fromtype/TypicalLengthFacetForPropertyDerivedFromType.java Tue Apr 26 22:03:43 2011
@@ -17,27 +17,27 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.properties.typicallen.fromtype;
 
-package org.apache.isis.core.progmodel.facets.properties.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 TypicalLengthFacetForPropertyDerivedFromType extends TypicalLengthFacetAbstract {
-
-    private final TypicalLengthFacet typicalLengthFacet;
-
-	public TypicalLengthFacetForPropertyDerivedFromType(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 TypicalLengthFacetForPropertyDerivedFromType extends TypicalLengthFacetAbstract {
+
+    private final TypicalLengthFacet typicalLengthFacet;
+
+    public TypicalLengthFacetForPropertyDerivedFromType(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/properties/typicallen/fromtype/TypicalLengthFacetForPropertyDerivedFromTypeFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/typicallen/fromtype/TypicalLengthFacetForPropertyDerivedFromTypeFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/typicallen/fromtype/TypicalLengthFacetForPropertyDerivedFromTypeFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/typicallen/fromtype/TypicalLengthFacetForPropertyDerivedFromTypeFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -17,9 +17,7 @@
  *  under the License.
  */
 
-
-package org.apache.isis.core.progmodel.facets.properties.typicallen.fromtype;
-
+package org.apache.isis.core.progmodel.facets.properties.typicallen.fromtype;
 
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
@@ -28,31 +26,30 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.FacetedMethod;
 import org.apache.isis.core.metamodel.facets.typicallength.TypicalLengthFacet;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-
-
-public class TypicalLengthFacetForPropertyDerivedFromTypeFacetFactory extends FacetFactoryAbstract {
-
-    public TypicalLengthFacetForPropertyDerivedFromTypeFacetFactory() {
-        super(FeatureType.PROPERTIES_ONLY);
-    }
-
-    @Override
-    public void process(ProcessMethodContext processMethodContext) {
-        final Class<?> type = processMethodContext.getMethod().getReturnType();
+
+public class TypicalLengthFacetForPropertyDerivedFromTypeFacetFactory extends FacetFactoryAbstract {
+
+    public TypicalLengthFacetForPropertyDerivedFromTypeFacetFactory() {
+        super(FeatureType.PROPERTIES_ONLY);
+    }
+
+    @Override
+    public void process(final ProcessMethodContext processMethodContext) {
+        final Class<?> type = processMethodContext.getMethod().getReturnType();
         final FacetedMethod facetHolder = processMethodContext.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 TypicalLengthFacetForPropertyDerivedFromType(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/properties/validate/PropertyValidateDefaultFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateDefaultFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateDefaultFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateDefaultFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -17,9 +17,7 @@
  *  under the License.
  */
 
-
-package org.apache.isis.core.progmodel.facets.properties.validate;
-
+package org.apache.isis.core.progmodel.facets.properties.validate;
 
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
@@ -27,34 +25,33 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.FacetFactory;
 import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
 import org.apache.isis.core.metamodel.specloader.facetprocessor.FacetProcessor;
-
-
-/**
- * Simply installs a {@link PropertyValidateFacet} onto all properties.
- * 
- * <p>
- * The idea is that this {@link FacetFactory} is included early on in the {@link FacetProcessor}, but
- * other {@link PropertyValidateFacet} implementations will potentially replace these where the property is
- * annotated or otherwise provides a validation mechanism.
- */
-public class PropertyValidateDefaultFacetFactory extends FacetFactoryAbstract {
-
-    public PropertyValidateDefaultFacetFactory() {
-        super(FeatureType.PROPERTIES_ONLY);
-    }
-
-    @Override
-    public void process(ProcessMethodContext processMethodContext) {
-        FacetUtil.addFacet(create(processMethodContext.getFacetHolder()));
-    }
-
-    @Override
-    public void processParams(ProcessParameterContext processParameterContext) {
-        FacetUtil.addFacet(create(processParameterContext.getFacetHolder()));
-    }
-
-    private PropertyValidateFacet create(final FacetHolder holder) {
-        return new PropertyValidateFacetDefault(holder);
-    }
-
-}
+
+/**
+ * Simply installs a {@link PropertyValidateFacet} onto all properties.
+ * 
+ * <p>
+ * The idea is that this {@link FacetFactory} is included early on in the {@link FacetProcessor}, but other
+ * {@link PropertyValidateFacet} implementations will potentially replace these where the property is annotated or
+ * otherwise provides a validation mechanism.
+ */
+public class PropertyValidateDefaultFacetFactory extends FacetFactoryAbstract {
+
+    public PropertyValidateDefaultFacetFactory() {
+        super(FeatureType.PROPERTIES_ONLY);
+    }
+
+    @Override
+    public void process(final ProcessMethodContext processMethodContext) {
+        FacetUtil.addFacet(create(processMethodContext.getFacetHolder()));
+    }
+
+    @Override
+    public void processParams(final ProcessParameterContext processParameterContext) {
+        FacetUtil.addFacet(create(processParameterContext.getFacetHolder()));
+    }
+
+    private PropertyValidateFacet create(final FacetHolder holder) {
+        return new PropertyValidateFacetDefault(holder);
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateFacetAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateFacetAbstract.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateFacetAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateFacetAbstract.java Tue Apr 26 22:03:43 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.properties.validate;
 
 import org.apache.isis.applib.events.ValidityEvent;
@@ -27,7 +26,6 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.interactions.PropertyModifyContext;
 import org.apache.isis.core.metamodel.interactions.ValidityContext;
 
-
 public abstract class PropertyValidateFacetAbstract extends FacetAbstract implements PropertyValidateFacet {
 
     public static Class<? extends Facet> type() {
@@ -38,6 +36,7 @@ public abstract class PropertyValidateFa
         super(type(), holder, false);
     }
 
+    @Override
     public String invalidates(final ValidityContext<? extends ValidityEvent> context) {
         if (!(context instanceof PropertyModifyContext)) {
             return null;
@@ -46,4 +45,3 @@ public abstract class PropertyValidateFa
         return invalidReason(propertyModifyContext.getTarget(), propertyModifyContext.getProposed());
     }
 }
-

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateFacetDefault.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateFacetDefault.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateFacetDefault.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateFacetDefault.java Tue Apr 26 22:03:43 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.properties.validate;
 
 import org.apache.isis.applib.events.ValidityEvent;
@@ -26,12 +25,12 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.interactions.ValidityContext;
 
-
 /**
  * Non checking property validation facet that provides default behaviour for all properties.
  */
 public class PropertyValidateFacetDefault extends FacetAbstract implements PropertyValidateFacet {
 
+    @Override
     public String invalidates(final ValidityContext<? extends ValidityEvent> ic) {
         return null;
     }
@@ -40,9 +39,9 @@ public class PropertyValidateFacetDefaul
         super(PropertyValidateFacet.class, holder, false);
     }
 
+    @Override
     public String invalidReason(final ObjectAdapter target, final ObjectAdapter proposedValue) {
         return null;
     }
 
 }
-

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.properties.validate;
 
-package org.apache.isis.core.progmodel.facets.properties.validate;
-
 import java.lang.reflect.Method;
 
 import org.apache.isis.core.commons.lang.NameUtils;
@@ -30,39 +29,40 @@ import org.apache.isis.core.metamodel.me
 import org.apache.isis.core.progmodel.facets.MethodFinderUtils;
 import org.apache.isis.core.progmodel.facets.MethodPrefixBasedFacetFactoryAbstract;
 import org.apache.isis.core.progmodel.facets.MethodPrefixConstants;
-
-
-public class PropertyValidateFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
-
-    private static final String[] PREFIXES = { MethodPrefixConstants.VALIDATE_PREFIX };
-
-    public PropertyValidateFacetFactory() {
-        super(FeatureType.PROPERTIES_ONLY, PREFIXES);
-    }
-
+
+public class PropertyValidateFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
+
+    private static final String[] PREFIXES = { MethodPrefixConstants.VALIDATE_PREFIX };
+
+    public PropertyValidateFacetFactory() {
+        super(FeatureType.PROPERTIES_ONLY, PREFIXES);
+    }
+
     @Override
-    public void process(ProcessMethodContext processMethodContext) {
+    public void process(final ProcessMethodContext processMethodContext) {
 
         attachValidateFacetIfValidateMethodIsFound(processMethodContext);
     }
 
-    private void attachValidateFacetIfValidateMethodIsFound(ProcessMethodContext processMethodContext) {
-        
+    private void attachValidateFacetIfValidateMethodIsFound(final ProcessMethodContext processMethodContext) {
+
         final Method getMethod = processMethodContext.getMethod();
         final String capitalizedName = NameUtils.javaBaseName(getMethod.getName());
-        
+
         final Class<?> returnType = getMethod.getReturnType();
         final Class<?>[] paramTypes = new Class[] { returnType };
-        
-        Class<?> cls = processMethodContext.getCls();
-        final Method method = MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.VALIDATE_PREFIX + capitalizedName, String.class, paramTypes);
+
+        final Class<?> cls = processMethodContext.getCls();
+        final Method method =
+            MethodFinderUtils.findMethod(cls, MethodScope.OBJECT, MethodPrefixConstants.VALIDATE_PREFIX
+                + capitalizedName, String.class, paramTypes);
         if (method == null) {
             return;
-        } 
+        }
         processMethodContext.removeMethod(method);
-        
+
         final FacetHolder property = processMethodContext.getFacetHolder();
         FacetUtil.addFacet(new PropertyValidateFacetViaMethod(method, property));
     }
 
-}
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateFacetNone.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateFacetNone.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateFacetNone.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateFacetNone.java Tue Apr 26 22:03:43 2011
@@ -17,33 +17,31 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.properties.validate;
 
-package org.apache.isis.core.progmodel.facets.properties.validate;
-
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-
-
-public class PropertyValidateFacetNone extends PropertyValidateFacetAbstract {
-
-    public PropertyValidateFacetNone(final FacetHolder holder) {
-        super(holder);
-    }
-
-    /**
-     * Returns <tt>null</tt>, ie property is valid.
-     * 
-     * <p>
-     * Subclasses should override as required.
-     */
-    public String invalidReason(final ObjectAdapter inObject, final ObjectAdapter value) {
-        return null;
-    }
-
-    @Override
-    public boolean isNoop() {
-        return true;
-    }
-
-}
-
+
+public class PropertyValidateFacetNone extends PropertyValidateFacetAbstract {
+
+    public PropertyValidateFacetNone(final FacetHolder holder) {
+        super(holder);
+    }
+
+    /**
+     * Returns <tt>null</tt>, ie property is valid.
+     * 
+     * <p>
+     * Subclasses should override as required.
+     */
+    @Override
+    public String invalidReason(final ObjectAdapter inObject, final ObjectAdapter value) {
+        return null;
+    }
+
+    @Override
+    public boolean isNoop() {
+        return true;
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateFacetViaMethod.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateFacetViaMethod.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateFacetViaMethod.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/PropertyValidateFacetViaMethod.java Tue Apr 26 22:03:43 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.properties.validate;
 
 import java.lang.reflect.Method;
@@ -29,7 +28,6 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.ImperativeFacet;
 
-
 public class PropertyValidateFacetViaMethod extends PropertyValidateFacetAbstract implements ImperativeFacet {
 
     private final Method method;
@@ -40,20 +38,24 @@ public class PropertyValidateFacetViaMet
     }
 
     /**
-     * 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 String invalidReason(final ObjectAdapter owningAdapter, final ObjectAdapter proposedAdapter) {
         return (String) AdapterInvokeUtils.invoke(method, owningAdapter, proposedAdapter);
     }
@@ -64,4 +66,3 @@ public class PropertyValidateFacetViaMet
     }
 
 }
-

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/maskannot/MaskAnnotationForPropertyFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/maskannot/MaskAnnotationForPropertyFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/maskannot/MaskAnnotationForPropertyFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/maskannot/MaskAnnotationForPropertyFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -17,9 +17,7 @@
  *  under the License.
  */
 
-
-package org.apache.isis.core.progmodel.facets.properties.validate.maskannot;
-
+package org.apache.isis.core.progmodel.facets.properties.validate.maskannot;
 
 import org.apache.isis.applib.annotation.Mask;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
@@ -30,69 +28,72 @@ 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 MaskAnnotationForPropertyFacetFactory extends AnnotationBasedFacetFactoryAbstract {
-
-    public MaskAnnotationForPropertyFacetFactory() {
-        super(FeatureType.PROPERTIES_ONLY);
-    }
-
-    /**
-     * In readiness for supporting <tt>@Value</tt> in the future.
-     */
-    @Override
-    public void process(ProcessClassContext processClassContaxt) {
-        final Mask annotation = getAnnotation(processClassContaxt.getCls(), Mask.class);
-        FacetUtil.addFacet(createMaskFacet(annotation, processClassContaxt.getFacetHolder()));
-    }
-
-    @Override
-    public void process(ProcessMethodContext processMethodContext) {
-        if (processMethodContext.getMethod().getReturnType() == void.class) {
-            return;
-        }
-
-        final Mask annotation = getAnnotation(processMethodContext.getMethod(), Mask.class);
-        addMaskFacetAndCorrespondingTitleFacet(processMethodContext.getFacetHolder(), annotation, processMethodContext.getMethod().getReturnType());
-    }
-
-    @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 MaskFacet createMaskFacet(final Mask annotation, final FacetHolder holder) {
-        return annotation != null ? new MaskFacetAnnotationForProperty(annotation.value(), null, holder) : null;
-    }
-
-    private boolean addMaskFacetAndCorrespondingTitleFacet(final FacetHolder holder, final Mask annotation, Class<?> cls) {
-        final MaskFacet maskFacet = createMaskFacet(annotation, holder);
-        if (maskFacet == null) {
-            return false;
-        }
-        FacetUtil.addFacet(maskFacet);
-
-        ObjectSpecification type = getSpecificationLookup().loadSpecification(cls);
-        final TitleFacet underlyingTitleFacet = type.getFacet(TitleFacet.class);
-        if (underlyingTitleFacet != null) {
-            final TitleFacet titleFacet = new TitleFacetBasedOnMask(maskFacet, underlyingTitleFacet);
-            FacetUtil.addFacet(titleFacet);
-        }
-        return true;
-    }
-
-}
+
+public class MaskAnnotationForPropertyFacetFactory extends AnnotationBasedFacetFactoryAbstract {
+
+    public MaskAnnotationForPropertyFacetFactory() {
+        super(FeatureType.PROPERTIES_ONLY);
+    }
+
+    /**
+     * In readiness for supporting <tt>@Value</tt> in the future.
+     */
+    @Override
+    public void process(final ProcessClassContext processClassContaxt) {
+        final Mask annotation = getAnnotation(processClassContaxt.getCls(), Mask.class);
+        FacetUtil.addFacet(createMaskFacet(annotation, processClassContaxt.getFacetHolder()));
+    }
+
+    @Override
+    public void process(final ProcessMethodContext processMethodContext) {
+        if (processMethodContext.getMethod().getReturnType() == void.class) {
+            return;
+        }
+
+        final Mask annotation = getAnnotation(processMethodContext.getMethod(), Mask.class);
+        addMaskFacetAndCorrespondingTitleFacet(processMethodContext.getFacetHolder(), annotation, processMethodContext
+            .getMethod().getReturnType());
+    }
+
+    @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 MaskFacet createMaskFacet(final Mask annotation, final FacetHolder holder) {
+        return annotation != null ? new MaskFacetAnnotationForProperty(annotation.value(), null, holder) : null;
+    }
+
+    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);
+
+        final ObjectSpecification type = getSpecificationLookup().loadSpecification(cls);
+        final TitleFacet underlyingTitleFacet = type.getFacet(TitleFacet.class);
+        if (underlyingTitleFacet != null) {
+            final TitleFacet titleFacet = new TitleFacetBasedOnMask(maskFacet, underlyingTitleFacet);
+            FacetUtil.addFacet(titleFacet);
+        }
+        return true;
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/maskannot/MaskFacetAnnotationForProperty.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/maskannot/MaskFacetAnnotationForProperty.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/maskannot/MaskFacetAnnotationForProperty.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/maskannot/MaskFacetAnnotationForProperty.java Tue Apr 26 22:03:43 2011
@@ -17,37 +17,35 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.properties.validate.maskannot;
 
-package org.apache.isis.core.progmodel.facets.properties.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 MaskFacetAnnotationForProperty extends MaskFacetAbstract {
-    private final MaskEvaluator evaluator;
-
-    public MaskFacetAnnotationForProperty(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 MaskFacetAnnotationForProperty extends MaskFacetAbstract {
+    private final MaskEvaluator evaluator;
+
+    public MaskFacetAnnotationForProperty(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/properties/validate/maxlenannot/MaxLengthAnnotationForPropertyFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/maxlenannot/MaxLengthAnnotationForPropertyFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/maxlenannot/MaxLengthAnnotationForPropertyFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/maxlenannot/MaxLengthAnnotationForPropertyFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -17,9 +17,7 @@
  *  under the License.
  */
 
-
-package org.apache.isis.core.progmodel.facets.properties.validate.maxlenannot;
-
+package org.apache.isis.core.progmodel.facets.properties.validate.maxlenannot;
 
 import org.apache.isis.applib.annotation.MaxLength;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
@@ -27,21 +25,20 @@ 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 MaxLengthAnnotationForPropertyFacetFactory extends AnnotationBasedFacetFactoryAbstract {
-
-    public MaxLengthAnnotationForPropertyFacetFactory() {
-        super(FeatureType.PROPERTIES_ONLY);
-    }
-
-    @Override
-    public void process(ProcessMethodContext processMethodContext) {
-        final MaxLength annotation = getAnnotation(processMethodContext.getMethod(), MaxLength.class);
-        FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
-    }
-
-    private MaxLengthFacet create(final MaxLength annotation, final FacetHolder holder) {
-        return annotation == null ? null : new MaxLengthFacetAnnotationForProperty(annotation.value(), holder);
-    }
-}
+
+public class MaxLengthAnnotationForPropertyFacetFactory extends AnnotationBasedFacetFactoryAbstract {
+
+    public MaxLengthAnnotationForPropertyFacetFactory() {
+        super(FeatureType.PROPERTIES_ONLY);
+    }
+
+    @Override
+    public void process(final ProcessMethodContext processMethodContext) {
+        final MaxLength annotation = getAnnotation(processMethodContext.getMethod(), MaxLength.class);
+        FacetUtil.addFacet(create(annotation, processMethodContext.getFacetHolder()));
+    }
+
+    private MaxLengthFacet create(final MaxLength annotation, final FacetHolder holder) {
+        return annotation == null ? null : new MaxLengthFacetAnnotationForProperty(annotation.value(), holder);
+    }
+}

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

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/perspec/MustSatisfySpecificationOnPropertyFacet.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/perspec/MustSatisfySpecificationOnPropertyFacet.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/perspec/MustSatisfySpecificationOnPropertyFacet.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/perspec/MustSatisfySpecificationOnPropertyFacet.java Tue Apr 26 22:03:43 2011
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.properties.validate.perspec;
 
-package org.apache.isis.core.progmodel.facets.properties.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 MustSatisfySpecificationOnPropertyFacet extends FacetAbstract implements ValidatingInteractionAdvisor {
-
-    public static Class<? extends Facet> type() {
-        return MustSatisfySpecificationOnPropertyFacet.class;
-    }
-
-    private final List<Specification> specifications;
-
-    public MustSatisfySpecificationOnPropertyFacet(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 MustSatisfySpecificationOnPropertyFacet extends FacetAbstract implements ValidatingInteractionAdvisor {
+
+    public static Class<? extends Facet> type() {
+        return MustSatisfySpecificationOnPropertyFacet.class;
+    }
+
+    private final List<Specification> specifications;
+
+    public MustSatisfySpecificationOnPropertyFacet(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/properties/validate/perspec/MustSatisfySpecificationOnPropertyFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/perspec/MustSatisfySpecificationOnPropertyFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/perspec/MustSatisfySpecificationOnPropertyFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/perspec/MustSatisfySpecificationOnPropertyFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.properties.validate.perspec;
 
-package org.apache.isis.core.progmodel.facets.properties.validate.perspec;
-
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.List;
@@ -31,49 +30,48 @@ 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 MustSatisfySpecificationOnPropertyFacetFactory  extends AnnotationBasedFacetFactoryAbstract {
-
-    public MustSatisfySpecificationOnPropertyFacetFactory() {
-        super(FeatureType.PROPERTIES_ONLY);
-    }
-
-    @Override
-    public void process(ProcessMethodContext processMethodContext) {
-        FacetUtil.addFacet(create(processMethodContext.getMethod(), processMethodContext.getFacetHolder()));
-    }
-
-    private Facet create(Method method, FacetHolder holder) {
-        return create(getAnnotation(method, MustSatisfy.class), holder);
-    }
-
-
-    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 MustSatisfySpecificationOnPropertyFacet(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 MustSatisfySpecificationOnPropertyFacetFactory extends AnnotationBasedFacetFactoryAbstract {
+
+    public MustSatisfySpecificationOnPropertyFacetFactory() {
+        super(FeatureType.PROPERTIES_ONLY);
+    }
+
+    @Override
+    public void process(final ProcessMethodContext processMethodContext) {
+        FacetUtil.addFacet(create(processMethodContext.getMethod(), processMethodContext.getFacetHolder()));
+    }
+
+    private Facet create(final Method method, final FacetHolder holder) {
+        return create(getAnnotation(method, MustSatisfy.class), holder);
+    }
+
+    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 MustSatisfySpecificationOnPropertyFacet(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/properties/validate/regexannot/RegExFacetAnnotationForProperty.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/regexannot/RegExFacetAnnotationForProperty.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/regexannot/RegExFacetAnnotationForProperty.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/regexannot/RegExFacetAnnotationForProperty.java Tue Apr 26 22:03:43 2011
@@ -17,48 +17,44 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.properties.validate.regexannot;
 
-package org.apache.isis.core.progmodel.facets.properties.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 RegExFacetAnnotationForProperty extends RegExFacetAbstract {
-
-    private final Pattern pattern;
-
-    public RegExFacetAnnotationForProperty(
-            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 RegExFacetAnnotationForProperty extends RegExFacetAbstract {
+
+    private final Pattern pattern;
+
+    public RegExFacetAnnotationForProperty(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;
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/regexannot/RegExFacetAnnotationForPropertyFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/regexannot/RegExFacetAnnotationForPropertyFacetFactory.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/regexannot/RegExFacetAnnotationForPropertyFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/properties/validate/regexannot/RegExFacetAnnotationForPropertyFacetFactory.java Tue Apr 26 22:03:43 2011
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.properties.validate.regexannot;
 
-package org.apache.isis.core.progmodel.facets.properties.validate.regexannot;
-
 import org.apache.isis.applib.annotation.RegEx;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
@@ -28,49 +27,48 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.object.title.TitleFacet;
 import org.apache.isis.core.progmodel.facets.object.regex.RegExFacet;
 import org.apache.isis.core.progmodel.facets.object.regex.TitleFacetFormattedByRegex;
-
-
-public class RegExFacetAnnotationForPropertyFacetFactory extends AnnotationBasedFacetFactoryAbstract {
-
-    public RegExFacetAnnotationForPropertyFacetFactory() {
-        super(FeatureType.PROPERTIES_ONLY);
-    }
-
-    @Override
-    public void process(ProcessMethodContext processMethodContext) {
-        final Class<?> returnType = processMethodContext.getMethod().getReturnType();
-        if (!isString(returnType)) {
-            return;
-        }
-        final RegEx annotation = getAnnotation(processMethodContext.getMethod(), RegEx.class);
-        addRegexFacetAndCorrespondingTitleFacet(processMethodContext.getFacetHolder(), annotation);
-    }
-
-    private void addRegexFacetAndCorrespondingTitleFacet(final FacetHolder holder, final RegEx annotation) {
-        final RegExFacet regexFacet = createRegexFacet(annotation, holder);
-        if (regexFacet == null) {
-            return;
-        }
-        FacetUtil.addFacet(regexFacet);
-
-        final TitleFacet titleFacet = createTitleFacet(regexFacet);
-        FacetUtil.addFacet(titleFacet);
-    }
-
-    private RegExFacet createRegexFacet(final RegEx annotation, final FacetHolder holder) {
-        if (annotation == null) {
-            return null;
-        }
-
-        final String validationExpression = annotation.validation();
-        final boolean caseSensitive = annotation.caseSensitive();
-        final String formatExpression = annotation.format();
-
-        return new RegExFacetAnnotationForProperty(validationExpression, formatExpression, caseSensitive, holder);
-    }
-
-    private TitleFacet createTitleFacet(final RegExFacet regexFacet) {
-        return new TitleFacetFormattedByRegex(regexFacet);
-    }
-
-}
+
+public class RegExFacetAnnotationForPropertyFacetFactory extends AnnotationBasedFacetFactoryAbstract {
+
+    public RegExFacetAnnotationForPropertyFacetFactory() {
+        super(FeatureType.PROPERTIES_ONLY);
+    }
+
+    @Override
+    public void process(final ProcessMethodContext processMethodContext) {
+        final Class<?> returnType = processMethodContext.getMethod().getReturnType();
+        if (!isString(returnType)) {
+            return;
+        }
+        final RegEx annotation = getAnnotation(processMethodContext.getMethod(), RegEx.class);
+        addRegexFacetAndCorrespondingTitleFacet(processMethodContext.getFacetHolder(), annotation);
+    }
+
+    private void addRegexFacetAndCorrespondingTitleFacet(final FacetHolder holder, final RegEx annotation) {
+        final RegExFacet regexFacet = createRegexFacet(annotation, holder);
+        if (regexFacet == null) {
+            return;
+        }
+        FacetUtil.addFacet(regexFacet);
+
+        final TitleFacet titleFacet = createTitleFacet(regexFacet);
+        FacetUtil.addFacet(titleFacet);
+    }
+
+    private RegExFacet createRegexFacet(final RegEx annotation, final FacetHolder holder) {
+        if (annotation == null) {
+            return null;
+        }
+
+        final String validationExpression = annotation.validation();
+        final boolean caseSensitive = annotation.caseSensitive();
+        final String formatExpression = annotation.format();
+
+        return new RegExFacetAnnotationForProperty(validationExpression, formatExpression, caseSensitive, holder);
+    }
+
+    private TitleFacet createTitleFacet(final RegExFacet regexFacet) {
+        return new TitleFacetFormattedByRegex(regexFacet);
+    }
+
+}

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DateAndTimeValueSemanticsProviderAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DateAndTimeValueSemanticsProviderAbstract.java?rev=1096928&r1=1096927&r2=1096928&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DateAndTimeValueSemanticsProviderAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DateAndTimeValueSemanticsProviderAbstract.java Tue Apr 26 22:03:43 2011
@@ -17,25 +17,23 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.value;
 
 import java.text.DateFormat;
 import java.util.Map;
 
-import com.google.inject.internal.Maps;
-
 import org.apache.isis.applib.adapters.Localization;
 import org.apache.isis.core.commons.config.ConfigurationConstants;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.progmodel.facets.object.value.ValueSemanticsProviderContext;
 
+import com.google.inject.internal.Maps;
 
 public abstract class DateAndTimeValueSemanticsProviderAbstract<T> extends ValueSemanticsProviderAbstractTemporal<T> {
 
-    private static Map<String,DateFormat> formats = Maps.newHashMap();
-    
+    private static Map<String, DateFormat> formats = Maps.newHashMap();
+
     static {
         formats.put("iso", createDateFormat("yyyy-MM-dd HH:mm"));
         formats.put("iso_short", createDateFormat("yyyyMMdd'T'HHmm"));
@@ -53,19 +51,14 @@ public abstract class DateAndTimeValueSe
     private static final Object DEFAULT_VALUE = null; // no default
     private static final int TYPICAL_LENGTH = 18;
 
-
     @SuppressWarnings("unchecked")
-    public DateAndTimeValueSemanticsProviderAbstract(
-            final FacetHolder holder,
-            final Class<T> adaptedClass,
-            final boolean immutable,
-            final boolean equalByContent,
-            final IsisConfiguration configuration, 
-            final ValueSemanticsProviderContext context) {
-        super("datetime", holder, adaptedClass, TYPICAL_LENGTH, immutable, equalByContent, (T) DEFAULT_VALUE, configuration, context);
+    public DateAndTimeValueSemanticsProviderAbstract(final FacetHolder holder, final Class<T> adaptedClass,
+        final boolean immutable, final boolean equalByContent, final IsisConfiguration configuration,
+        final ValueSemanticsProviderContext context) {
+        super("datetime", holder, adaptedClass, TYPICAL_LENGTH, immutable, equalByContent, (T) DEFAULT_VALUE,
+            configuration, context);
 
-        final String formatRequired = configuration.getString(
-                ConfigurationConstants.ROOT + "value.format.datetime");
+        final String formatRequired = configuration.getString(ConfigurationConstants.ROOT + "value.format.datetime");
         if (formatRequired == null) {
             format = formats().get(defaultFormat());
         } else {
@@ -95,9 +88,11 @@ public abstract class DateAndTimeValueSe
     protected Map<String, DateFormat> formats() {
         return formats;
     }
-    
-    protected DateFormat format(Localization localization) {
-        DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM, localization.getLocale());
+
+    @Override
+    protected DateFormat format(final Localization localization) {
+        final DateFormat dateFormat =
+            DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM, localization.getLocale());
         dateFormat.setTimeZone(localization.getTimeZone());
         return dateFormat;
     }



Mime
View raw message