incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1060035 [6/14] - in /incubator/isis/trunk: alternatives/embedded/src/main/java/org/apache/isis/alternatives/embedded/ alternatives/objectstore/nosql/src/test/java/org/apache/isis/alternatives/objectstore/nosql/ alternatives/objectstore/sql...
Date Mon, 17 Jan 2011 18:23:18 GMT
Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/multiline/annotation/MultiLineFacetAnnotationOnType.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/multiline/annotation/MultiLineFacetAnnotation.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/multiline/annotation/MultiLineFacetAnnotationOnType.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/multiline/annotation/MultiLineFacetAnnotationOnType.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/multiline/annotation/MultiLineFacetAnnotation.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/multiline/annotation/MultiLineFacetAnnotation.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/multiline/annotation/MultiLineFacetAnnotationOnType.java Mon Jan 17 18:22:58 2011
@@ -18,15 +18,15 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.propparam.multiline.annotation;
+package org.apache.isis.core.progmodel.facets.object.multiline.annotation;
 
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.progmodel.facets.propparam.multiline.MultiLineFacetAbstract;
+import org.apache.isis.core.metamodel.facets.multiline.MultiLineFacetAbstract;
 
 
-public class MultiLineFacetAnnotation extends MultiLineFacetAbstract {
+public class MultiLineFacetAnnotationOnType extends MultiLineFacetAbstract {
 
-    public MultiLineFacetAnnotation(final int numberOfLines, final boolean preventWrapping, final FacetHolder holder) {
+    public MultiLineFacetAnnotationOnType(final int numberOfLines, final boolean preventWrapping, final FacetHolder holder) {
         super(numberOfLines, preventWrapping, holder);
     }
 

Added: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/named/annotation/NamedAnnotationOnTypeFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/named/annotation/NamedAnnotationOnTypeFacetFactory.java?rev=1060035&view=auto
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/named/annotation/NamedAnnotationOnTypeFacetFactory.java (added)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/named/annotation/NamedAnnotationOnTypeFacetFactory.java Mon Jan 17 18:22:58 2011
@@ -0,0 +1,47 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+
+package org.apache.isis.core.progmodel.facets.object.named.annotation;
+
+import org.apache.isis.applib.annotation.Named;
+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.named.NamedFacet;
+
+
+public class NamedAnnotationOnTypeFacetFactory extends AnnotationBasedFacetFactoryAbstract {
+
+    public NamedAnnotationOnTypeFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY);
+    }
+
+    @Override
+    public void process(ProcessClassContext processClassContaxt) {
+        final Named annotation = getAnnotation(processClassContaxt.getCls(), Named.class);
+        FacetUtil.addFacet(create(annotation, processClassContaxt.getFacetHolder()));
+    }
+
+    private NamedFacet create(final Named annotation, final FacetHolder holder) {
+        return annotation != null ? new NamedFacetAnnotationOnType(annotation.value(), holder) : null;
+    }
+
+}

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/named/annotation/NamedFacetAnnotationOnType.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/named/annotation/NamedFacetAnnotation.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/named/annotation/NamedFacetAnnotationOnType.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/named/annotation/NamedFacetAnnotationOnType.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/named/annotation/NamedFacetAnnotation.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/named/annotation/NamedFacetAnnotation.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/named/annotation/NamedFacetAnnotationOnType.java Mon Jan 17 18:22:58 2011
@@ -18,15 +18,15 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.named.annotation;
+package org.apache.isis.core.progmodel.facets.object.named.annotation;
 
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.progmodel.facets.named.NamedFacetImpl;
+import org.apache.isis.core.metamodel.facets.named.NamedFacetAbstract;
 
 
-public class NamedFacetAnnotation extends NamedFacetImpl {
+public class NamedFacetAnnotationOnType extends NamedFacetAbstract {
 
-    public NamedFacetAnnotation(final String value, final FacetHolder holder) {
+    public NamedFacetAnnotationOnType(final String value, final FacetHolder holder) {
         super(value, holder);
     }
 

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/named/staticmethod/NamedFacetViaSingularNameStaticMethod.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/singular/NamedFacetViaMethod.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/named/staticmethod/NamedFacetViaSingularNameStaticMethod.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/named/staticmethod/NamedFacetViaSingularNameStaticMethod.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/singular/NamedFacetViaMethod.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/singular/NamedFacetViaMethod.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/named/staticmethod/NamedFacetViaSingularNameStaticMethod.java Mon Jan 17 18:22:58 2011
@@ -18,15 +18,15 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.ident.singular;
+package org.apache.isis.core.progmodel.facets.object.named.staticmethod;
 
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.naming.named.NamedFacetAbstract;
+import org.apache.isis.core.metamodel.facets.named.NamedFacetAbstract;
 
 
-public class NamedFacetViaMethod extends NamedFacetAbstract {
+public class NamedFacetViaSingularNameStaticMethod extends NamedFacetAbstract {
 
-    public NamedFacetViaMethod(final String value, final FacetHolder holder) {
+    public NamedFacetViaSingularNameStaticMethod(final String value, final FacetHolder holder) {
         super(value, holder);
     }
 

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/named/staticmethod/NamedFacetViaSingularNameStaticMethodFacetFactory.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/singular/SingularMethodFacetFactory.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/named/staticmethod/NamedFacetViaSingularNameStaticMethodFacetFactory.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/named/staticmethod/NamedFacetViaSingularNameStaticMethodFacetFactory.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/singular/SingularMethodFacetFactory.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/singular/SingularMethodFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/named/staticmethod/NamedFacetViaSingularNameStaticMethodFacetFactory.java Mon Jan 17 18:22:58 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.ident.singular;
+package org.apache.isis.core.progmodel.facets.object.named.staticmethod;
 
 import java.lang.reflect.Method;
 
@@ -29,15 +29,14 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.methodutils.MethodScope;
 import org.apache.isis.core.progmodel.facets.MethodFinderUtils;
 import org.apache.isis.core.progmodel.facets.MethodPrefixBasedFacetFactoryAbstract;
+import org.apache.isis.core.progmodel.facets.MethodPrefixConstants;
 
 
-public class SingularMethodFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
+public class NamedFacetViaSingularNameStaticMethodFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {
 
-    private static final String SINGULAR_NAME = "singularName";
+    private static final String[] PREFIXES = { MethodPrefixConstants.SINGULAR_NAME, };
 
-    private static final String[] PREFIXES = { SINGULAR_NAME, };
-
-    public SingularMethodFacetFactory() {
+    public NamedFacetViaSingularNameStaticMethodFacetFactory() {
         super(FeatureType.OBJECTS_ONLY, PREFIXES);
     }
 
@@ -46,11 +45,11 @@ public class SingularMethodFacetFactory 
         final Class<?> cls = processClassContext.getCls();
         final FacetHolder facetHolder = processClassContext.getFacetHolder();
 
-        final Method method = MethodFinderUtils.findMethod(cls, MethodScope.CLASS, SINGULAR_NAME, String.class, NO_PARAMETERS_TYPES);
+        final Method method = MethodFinderUtils.findMethod(cls, MethodScope.CLASS, MethodPrefixConstants.SINGULAR_NAME, String.class, NO_PARAMETERS_TYPES);
         if (method != null) {
             final String name = (String) InvokeUtils.invokeStatic(method);
             processClassContext.removeMethod(method);
-            FacetUtil.addFacet(new NamedFacetViaMethod(name, facetHolder));
+            FacetUtil.addFacet(new NamedFacetViaSingularNameStaticMethod(name, facetHolder));
         }
     }
 }

Added: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderactions/ActionOrderAnnotationFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderactions/ActionOrderAnnotationFacetFactory.java?rev=1060035&view=auto
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderactions/ActionOrderAnnotationFacetFactory.java (added)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderactions/ActionOrderAnnotationFacetFactory.java Mon Jan 17 18:22:58 2011
@@ -0,0 +1,47 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+
+package org.apache.isis.core.progmodel.facets.object.orderactions;
+
+import org.apache.isis.applib.annotation.ActionOrder;
+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.object.orderactions.ActionOrderFacet;
+
+
+public class ActionOrderAnnotationFacetFactory extends AnnotationBasedFacetFactoryAbstract {
+
+    public ActionOrderAnnotationFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY);
+    }
+
+    @Override
+    public void process(ProcessClassContext processClassContaxt) {
+        final ActionOrder annotation = getAnnotation(processClassContaxt.getCls(), ActionOrder.class);
+        FacetUtil.addFacet(create(annotation, processClassContaxt.getFacetHolder()));
+    }
+
+    private ActionOrderFacet create(final ActionOrder annotation, final FacetHolder facetHolder) {
+        return annotation == null ? null : new ActionOrderFacetAnnotation(annotation.value(), facetHolder);
+    }
+
+}

Propchange: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderactions/ActionOrderAnnotationFacetFactory.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Added: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderactions/ActionOrderFacetAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderactions/ActionOrderFacetAbstract.java?rev=1060035&view=auto
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderactions/ActionOrderFacetAbstract.java (added)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderactions/ActionOrderFacetAbstract.java Mon Jan 17 18:22:58 2011
@@ -0,0 +1,39 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+
+package org.apache.isis.core.progmodel.facets.object.orderactions;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.SingleStringValueFacetAbstract;
+import org.apache.isis.core.metamodel.facets.object.orderactions.ActionOrderFacet;
+
+
+public abstract class ActionOrderFacetAbstract extends SingleStringValueFacetAbstract implements ActionOrderFacet {
+
+    public static Class<? extends Facet> type() {
+        return ActionOrderFacet.class;
+    }
+
+    public ActionOrderFacetAbstract(final String value, final FacetHolder holder) {
+        super(type(), holder, value);
+    }
+
+}

Added: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderactions/ActionOrderFacetAnnotation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderactions/ActionOrderFacetAnnotation.java?rev=1060035&view=auto
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderactions/ActionOrderFacetAnnotation.java (added)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderactions/ActionOrderFacetAnnotation.java Mon Jan 17 18:22:58 2011
@@ -0,0 +1,33 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+
+package org.apache.isis.core.progmodel.facets.object.orderactions;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+
+
+public class ActionOrderFacetAnnotation extends ActionOrderFacetAbstract {
+
+    public ActionOrderFacetAnnotation(final String value, final FacetHolder holder) {
+        super(value, holder);
+    }
+
+}
+

Propchange: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderactions/ActionOrderFacetAnnotation.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderfields/FieldOrderAnnotationFacetFactory.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/fieldorder/FieldOrderAnnotationFacetFactory.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderfields/FieldOrderAnnotationFacetFactory.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderfields/FieldOrderAnnotationFacetFactory.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/fieldorder/FieldOrderAnnotationFacetFactory.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/fieldorder/FieldOrderAnnotationFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderfields/FieldOrderAnnotationFacetFactory.java Mon Jan 17 18:22:58 2011
@@ -18,14 +18,14 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.ordering.fieldorder;
+package org.apache.isis.core.progmodel.facets.object.orderfields;
 
 import org.apache.isis.applib.annotation.FieldOrder;
 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.layout.ordermethod.FieldOrderFacet;
+import org.apache.isis.core.metamodel.facets.object.orderfields.FieldOrderFacet;
 
 
 public class FieldOrderAnnotationFacetFactory extends AnnotationBasedFacetFactoryAbstract {

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderfields/FieldOrderFacetAbstract.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/fieldorder/FieldOrderFacetAbstract.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderfields/FieldOrderFacetAbstract.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderfields/FieldOrderFacetAbstract.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/fieldorder/FieldOrderFacetAbstract.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/fieldorder/FieldOrderFacetAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderfields/FieldOrderFacetAbstract.java Mon Jan 17 18:22:58 2011
@@ -18,12 +18,12 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.ordering.fieldorder;
+package org.apache.isis.core.progmodel.facets.object.orderfields;
 
 import org.apache.isis.core.metamodel.facetapi.Facet;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.SingleStringValueFacetAbstract;
-import org.apache.isis.core.metamodel.layout.ordermethod.FieldOrderFacet;
+import org.apache.isis.core.metamodel.facets.object.orderfields.FieldOrderFacet;
 
 
 public abstract class FieldOrderFacetAbstract extends SingleStringValueFacetAbstract implements FieldOrderFacet {

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderfields/FieldOrderFacetAnnotation.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/fieldorder/FieldOrderFacetAnnotation.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderfields/FieldOrderFacetAnnotation.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderfields/FieldOrderFacetAnnotation.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/fieldorder/FieldOrderFacetAnnotation.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/ordering/fieldorder/FieldOrderFacetAnnotation.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/orderfields/FieldOrderFacetAnnotation.java Mon Jan 17 18:22:58 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.ordering.fieldorder;
+package org.apache.isis.core.progmodel.facets.object.orderfields;
 
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/parseable/ParseableFacetAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/parseable/ParseableFacetAbstract.java?rev=1060035&r1=1060034&r2=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/parseable/ParseableFacetAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/parseable/ParseableFacetAbstract.java Mon Jan 17 18:22:58 2011
@@ -22,13 +22,13 @@ package org.apache.isis.core.progmodel.f
 
 import org.apache.isis.applib.adapters.Parser;
 import org.apache.isis.core.commons.authentication.AuthenticationSessionProvider;
+import org.apache.isis.core.commons.lang.ClassUtil;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.map.AdapterMap;
 import org.apache.isis.core.metamodel.facetapi.FacetAbstract;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.object.parseable.ParseableFacet;
 import org.apache.isis.core.metamodel.runtimecontext.DependencyInjector;
-import org.apache.isis.core.progmodel.util.ClassUtil;
 
 
 public abstract class ParseableFacetAbstract extends FacetAbstract implements ParseableFacet {

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/annotation/PluralAnnotationFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/annotation/PluralAnnotationFacetFactory.java?rev=1060035&r1=1060034&r2=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/annotation/PluralAnnotationFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/annotation/PluralAnnotationFacetFactory.java Mon Jan 17 18:22:58 2011
@@ -25,7 +25,7 @@ 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;
-import org.apache.isis.core.metamodel.facets.object.ident.plural.PluralFacet;
+import org.apache.isis.core.metamodel.facets.object.plural.PluralFacet;
 
 
 public class PluralAnnotationFacetFactory extends AnnotationBasedFacetFactoryAbstract {

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/annotation/PluralFacetAnnotation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/annotation/PluralFacetAnnotation.java?rev=1060035&r1=1060034&r2=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/annotation/PluralFacetAnnotation.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/annotation/PluralFacetAnnotation.java Mon Jan 17 18:22:58 2011
@@ -21,7 +21,7 @@
 package org.apache.isis.core.progmodel.facets.object.plural.annotation;
 
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.ident.plural.PluralFacetAbstract;
+import org.apache.isis.core.metamodel.facets.object.plural.PluralFacetAbstract;
 
 
 public class PluralFacetAnnotation extends PluralFacetAbstract {

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/staticmethod/PluralFacetViaMethod.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/staticmethod/PluralFacetViaMethod.java?rev=1060035&r1=1060034&r2=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/staticmethod/PluralFacetViaMethod.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/plural/staticmethod/PluralFacetViaMethod.java Mon Jan 17 18:22:58 2011
@@ -21,7 +21,7 @@
 package org.apache.isis.core.progmodel.facets.object.plural.staticmethod;
 
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.ident.plural.PluralFacetAbstract;
+import org.apache.isis.core.metamodel.facets.object.plural.PluralFacetAbstract;
 
 
 public class PluralFacetViaMethod extends PluralFacetAbstract {

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/regex/RegExFacet.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/RegExFacet.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/regex/RegExFacet.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/regex/RegExFacet.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/RegExFacet.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/RegExFacet.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/regex/RegExFacet.java Mon Jan 17 18:22:58 2011
@@ -17,11 +17,11 @@
  *  under the License.
  */
 
-package org.apache.isis.core.progmodel.facets.propparam.validate.regex;
+package org.apache.isis.core.progmodel.facets.object.regex;
 
 import org.apache.isis.core.metamodel.facets.MultipleValueFacet;
 import org.apache.isis.core.metamodel.interactions.ValidatingInteractionAdvisor;
-import org.apache.isis.core.progmodel.facets.propparam.validate.mask.MaskFacet;
+import org.apache.isis.core.progmodel.facets.object.mask.MaskFacet;
 
 /**
  * Whether the (string) property or a parameter must correspond to a specific regular expression.

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/regex/RegExFacetAbstract.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/RegExFacetAbstract.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/regex/RegExFacetAbstract.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/regex/RegExFacetAbstract.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/RegExFacetAbstract.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/RegExFacetAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/regex/RegExFacetAbstract.java Mon Jan 17 18:22:58 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.propparam.validate.regex;
+package org.apache.isis.core.progmodel.facets.object.regex;
 
 import org.apache.isis.applib.events.ValidityEvent;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/regex/TitleFacetFormattedByRegex.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/TitleFacetFormattedByRegex.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/regex/TitleFacetFormattedByRegex.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/regex/TitleFacetFormattedByRegex.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/TitleFacetFormattedByRegex.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/TitleFacetFormattedByRegex.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/regex/TitleFacetFormattedByRegex.java Mon Jan 17 18:22:58 2011
@@ -18,10 +18,10 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.propparam.validate.regex;
+package org.apache.isis.core.progmodel.facets.object.regex;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.progmodel.facets.object.ident.title.TitleFacetAbstract;
+import org.apache.isis.core.metamodel.facets.object.title.TitleFacetAbstract;
 
 
 public class TitleFacetFormattedByRegex extends TitleFacetAbstract {

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/regex/annotation/RegExFacetAnnotationForType.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/annotation/RegExFacetAnnotation.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/regex/annotation/RegExFacetAnnotationForType.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/regex/annotation/RegExFacetAnnotationForType.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/annotation/RegExFacetAnnotation.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/annotation/RegExFacetAnnotation.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/regex/annotation/RegExFacetAnnotationForType.java Mon Jan 17 18:22:58 2011
@@ -18,19 +18,19 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.propparam.validate.regex.annotation;
+package org.apache.isis.core.progmodel.facets.object.regex.annotation;
 
 import java.util.regex.Pattern;
 
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.progmodel.facets.propparam.validate.regex.RegExFacetAbstract;
+import org.apache.isis.core.progmodel.facets.object.regex.RegExFacetAbstract;
 
 
-public class RegExFacetAnnotation extends RegExFacetAbstract {
+public class RegExFacetAnnotationForType extends RegExFacetAbstract {
 
     private final Pattern pattern;
 
-    public RegExFacetAnnotation(
+    public RegExFacetAnnotationForType(
             final String validation,
             final String format,
             final boolean caseSensitive,

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/regex/annotation/RegExFacetAnnotationForTypeFacetFactory.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/annotation/RegExAnnotationFacetFactory.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/regex/annotation/RegExFacetAnnotationForTypeFacetFactory.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/regex/annotation/RegExFacetAnnotationForTypeFacetFactory.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/annotation/RegExAnnotationFacetFactory.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/annotation/RegExAnnotationFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/regex/annotation/RegExFacetAnnotationForTypeFacetFactory.java Mon Jan 17 18:22:58 2011
@@ -18,24 +18,20 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.propparam.validate.regex.annotation;
+package org.apache.isis.core.progmodel.facets.object.regex.annotation;
 
-import java.lang.annotation.Annotation;
-
 import org.apache.isis.applib.annotation.RegEx;
 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.object.ident.title.TitleFacet;
-import org.apache.isis.core.progmodel.facets.propparam.validate.regex.RegExFacet;
-import org.apache.isis.core.progmodel.facets.propparam.validate.regex.TitleFacetFormattedByRegex;
+import org.apache.isis.core.progmodel.facets.object.regex.RegExFacet;
 
 
-public class RegExAnnotationFacetFactory extends AnnotationBasedFacetFactoryAbstract {
+public class RegExFacetAnnotationForTypeFacetFactory extends AnnotationBasedFacetFactoryAbstract {
 
-    public RegExAnnotationFacetFactory() {
-        super(FeatureType.OBJECTS_PROPERTIES_AND_PARAMETERS);
+    public RegExFacetAnnotationForTypeFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY);
     }
 
     @Override
@@ -44,48 +40,6 @@ public class RegExAnnotationFacetFactory
         FacetUtil.addFacet(createRegexFacet(annotation, processClassContaxt.getFacetHolder()));
     }
 
-    @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);
-    }
-
-    @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 RegEx) {
-                final RegEx annotation = (RegEx) parameterAnnotations[j];
-                addRegexFacetAndCorrespondingTitleFacet(processParameterContext.getFacetHolder(), annotation);
-                return;
-            }
-        }
-    }
-
-    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;
@@ -95,11 +49,6 @@ public class RegExAnnotationFacetFactory
         final boolean caseSensitive = annotation.caseSensitive();
         final String formatExpression = annotation.format();
 
-        return new RegExFacetAnnotation(validationExpression, formatExpression, caseSensitive, holder);
-    }
-
-    private TitleFacet createTitleFacet(final RegExFacet regexFacet) {
-        return new TitleFacetFormattedByRegex(regexFacet);
+        return new RegExFacetAnnotationForType(validationExpression, formatExpression, caseSensitive, holder);
     }
-
 }

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/title/TitleFacetUsingParser.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/title/TitleFacetUsingParser.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/title/TitleFacetUsingParser.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/title/TitleFacetUsingParser.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/title/TitleFacetUsingParser.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/title/TitleFacetUsingParser.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/title/TitleFacetUsingParser.java Mon Jan 17 18:22:58 2011
@@ -18,13 +18,13 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.ident.title;
+package org.apache.isis.core.progmodel.facets.object.title;
 
 import org.apache.isis.applib.adapters.Parser;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.facetapi.FacetAbstract;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.object.ident.title.TitleFacet;
+import org.apache.isis.core.metamodel.facets.object.title.TitleFacet;
 import org.apache.isis.core.metamodel.runtimecontext.DependencyInjector;
 
 

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/title/TitleFacetViaTitleMethod.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/title/TitleFacetViaTitleMethod.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/title/TitleFacetViaTitleMethod.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/title/TitleFacetViaTitleMethod.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/title/TitleFacetViaTitleMethod.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/title/TitleFacetViaTitleMethod.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/title/TitleFacetViaTitleMethod.java Mon Jan 17 18:22:58 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.ident.title;
+package org.apache.isis.core.progmodel.facets.object.title;
 
 import java.lang.reflect.Method;
 import java.util.Collections;
@@ -28,6 +28,7 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.adapter.util.AdapterInvokeUtils;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.ImperativeFacet;
+import org.apache.isis.core.metamodel.facets.object.title.TitleFacetAbstract;
 
 
 public class TitleFacetViaTitleMethod extends TitleFacetAbstract implements ImperativeFacet {

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/title/TitleFacetViaToStringMethod.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/title/TitleFacetViaToStringMethod.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/title/TitleFacetViaToStringMethod.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/title/TitleFacetViaToStringMethod.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/title/TitleFacetViaToStringMethod.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/title/TitleFacetViaToStringMethod.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/title/TitleFacetViaToStringMethod.java Mon Jan 17 18:22:58 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.ident.title;
+package org.apache.isis.core.progmodel.facets.object.title;
 
 import java.lang.reflect.Method;
 import java.util.Collections;
@@ -27,6 +27,7 @@ import java.util.List;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.ImperativeFacet;
+import org.apache.isis.core.metamodel.facets.object.title.TitleFacetAbstract;
 
 
 public class TitleFacetViaToStringMethod extends TitleFacetAbstract implements ImperativeFacet {

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/title/TitleMethodFacetFactory.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/title/TitleMethodFacetFactory.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/title/TitleMethodFacetFactory.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/title/TitleMethodFacetFactory.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/title/TitleMethodFacetFactory.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/ident/title/TitleMethodFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/title/TitleMethodFacetFactory.java Mon Jan 17 18:22:58 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.ident.title;
+package org.apache.isis.core.progmodel.facets.object.title;
 
 import java.lang.reflect.Method;
 
@@ -27,9 +27,9 @@ 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.methodutils.MethodScope;
-import org.apache.isis.core.progmodel.facets.FallbackFacetFactory;
 import org.apache.isis.core.progmodel.facets.MethodFinderUtils;
 import org.apache.isis.core.progmodel.facets.MethodPrefixBasedFacetFactoryAbstract;
+import org.apache.isis.core.progmodel.fallback.FallbackFacetFactory;
 
 
 public class TitleMethodFacetFactory extends MethodPrefixBasedFacetFactoryAbstract {

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/typicallen/annotation/TypicalLengthAnnotationOnTypeFacetFactory.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/typicallength/annotation/TypicalLengthAnnotationFacetFactory.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/typicallen/annotation/TypicalLengthAnnotationOnTypeFacetFactory.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/typicallen/annotation/TypicalLengthAnnotationOnTypeFacetFactory.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/typicallength/annotation/TypicalLengthAnnotationFacetFactory.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/typicallength/annotation/TypicalLengthAnnotationFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/typicallen/annotation/TypicalLengthAnnotationOnTypeFacetFactory.java Mon Jan 17 18:22:58 2011
@@ -18,22 +18,20 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.propparam.typicallength.annotation;
+package org.apache.isis.core.progmodel.facets.object.typicallen.annotation;
 
-import java.lang.annotation.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.propparam.typicallength.TypicalLengthFacet;
+import org.apache.isis.core.metamodel.facets.typicallength.TypicalLengthFacet;
 
 
-public class TypicalLengthAnnotationFacetFactory extends AnnotationBasedFacetFactoryAbstract {
+public class TypicalLengthAnnotationOnTypeFacetFactory extends AnnotationBasedFacetFactoryAbstract {
 
-    public TypicalLengthAnnotationFacetFactory() {
-        super(FeatureType.OBJECTS_PROPERTIES_AND_PARAMETERS);
+    public TypicalLengthAnnotationOnTypeFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY);
     }
 
     @Override
@@ -42,28 +40,8 @@ public class TypicalLengthAnnotationFace
         FacetUtil.addFacet(create(annotation, processClassContaxt.getFacetHolder()));
     }
 
-    @Override
-    public void process(ProcessMethodContext processMethodContext) {
-        final TypicalLength annotation = getAnnotation(processMethodContext.getMethod(), TypicalLength.class);
-        final TypicalLengthFacet facet = create(annotation, processMethodContext.getFacetHolder());
-
-        FacetUtil.addFacet(facet);
-    }
-
-    @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];
-                FacetUtil.addFacet(create(annotation, processParameterContext.getFacetHolder()));
-                return;
-            }
-        }
-    }
-
     private TypicalLengthFacet create(final TypicalLength annotation, final FacetHolder holder) {
-        return annotation != null ? new TypicalLengthFacetAnnotation(annotation.value(), holder) : null;
+        return annotation != null ? new TypicalLengthFacetAnnotationOnType(annotation.value(), holder) : null;
     }
 
 }

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/typicallen/annotation/TypicalLengthFacetAnnotationOnType.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/typicallength/annotation/TypicalLengthFacetAnnotation.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/typicallen/annotation/TypicalLengthFacetAnnotationOnType.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/typicallen/annotation/TypicalLengthFacetAnnotationOnType.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/typicallength/annotation/TypicalLengthFacetAnnotation.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/typicallength/annotation/TypicalLengthFacetAnnotation.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/typicallen/annotation/TypicalLengthFacetAnnotationOnType.java Mon Jan 17 18:22:58 2011
@@ -18,17 +18,17 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.propparam.typicallength.annotation;
+package org.apache.isis.core.progmodel.facets.object.typicallen.annotation;
 
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.progmodel.facets.propparam.typicallength.TypicalLengthFacetAbstract;
+import org.apache.isis.core.metamodel.facets.typicallength.TypicalLengthFacetAbstract;
 
 
-public class TypicalLengthFacetAnnotation extends TypicalLengthFacetAbstract {
+public class TypicalLengthFacetAnnotationOnType extends TypicalLengthFacetAbstract {
 
     private final int value;
 
-	public TypicalLengthFacetAnnotation(final int value, final FacetHolder holder) {
+	public TypicalLengthFacetAnnotationOnType(final int value, final FacetHolder holder) {
         super(holder, false);
         this.value = value;
     }

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validate/method/ValidateObjectFacetViaValidateMethod.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validate/ValidateObjectFacetViaValidateMethod.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validate/method/ValidateObjectFacetViaValidateMethod.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validate/method/ValidateObjectFacetViaValidateMethod.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validate/ValidateObjectFacetViaValidateMethod.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validate/ValidateObjectFacetViaValidateMethod.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validate/method/ValidateObjectFacetViaValidateMethod.java Mon Jan 17 18:22:58 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.validate;
+package org.apache.isis.core.progmodel.facets.object.validate.method;
 
 import java.lang.reflect.Method;
 import java.util.Collections;
@@ -28,6 +28,7 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.adapter.util.AdapterInvokeUtils;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.ImperativeFacet;
+import org.apache.isis.core.progmodel.facets.object.validate.ValidateObjectFacetAbstract;
 
 
 public class ValidateObjectFacetViaValidateMethod extends ValidateObjectFacetAbstract implements ImperativeFacet {

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validate/method/ValidateObjectViaValidateMethodFacetFactory.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validate/ValidateObjectViaValidateMethodFacetFactory.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validate/method/ValidateObjectViaValidateMethodFacetFactory.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validate/method/ValidateObjectViaValidateMethodFacetFactory.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validate/ValidateObjectViaValidateMethodFacetFactory.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validate/ValidateObjectViaValidateMethodFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validate/method/ValidateObjectViaValidateMethodFacetFactory.java Mon Jan 17 18:22:58 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.object.validate;
+package org.apache.isis.core.progmodel.facets.object.validate.method;
 
 import java.lang.reflect.Method;
 

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validperspec/MustSatisfySpecificationOnTypeFacet.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/specification/MustSatisfySpecificationFacet.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validperspec/MustSatisfySpecificationOnTypeFacet.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validperspec/MustSatisfySpecificationOnTypeFacet.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/specification/MustSatisfySpecificationFacet.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/specification/MustSatisfySpecificationFacet.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validperspec/MustSatisfySpecificationOnTypeFacet.java Mon Jan 17 18:22:58 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.propparam.specification;
+package org.apache.isis.core.progmodel.facets.object.validperspec;
 
 import java.util.List;
 
@@ -33,15 +33,15 @@ import org.apache.isis.core.metamodel.in
 import org.apache.isis.core.metamodel.interactions.ValidatingInteractionAdvisor;
 import org.apache.isis.core.metamodel.interactions.ValidityContext;
 
-public class MustSatisfySpecificationFacet extends FacetAbstract implements ValidatingInteractionAdvisor {
+public class MustSatisfySpecificationOnTypeFacet extends FacetAbstract implements ValidatingInteractionAdvisor {
 
     public static Class<? extends Facet> type() {
-        return MustSatisfySpecificationFacet.class;
+        return MustSatisfySpecificationOnTypeFacet.class;
     }
 
     private final List<Specification> specifications;
 
-    public MustSatisfySpecificationFacet(final List<Specification> specifications, final FacetHolder holder) {
+    public MustSatisfySpecificationOnTypeFacet(final List<Specification> specifications, final FacetHolder holder) {
         super(type(), holder, false);
         this.specifications = specifications;
     }

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validperspec/MustSatisfySpecificationOnTypeFacetFactory.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/specification/MustSatisfySpecificationFacetFactory.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validperspec/MustSatisfySpecificationOnTypeFacetFactory.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validperspec/MustSatisfySpecificationOnTypeFacetFactory.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/specification/MustSatisfySpecificationFacetFactory.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/specification/MustSatisfySpecificationFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validperspec/MustSatisfySpecificationOnTypeFacetFactory.java Mon Jan 17 18:22:58 2011
@@ -18,23 +18,23 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.propparam.specification;
+package org.apache.isis.core.progmodel.facets.object.validperspec;
 
-import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.isis.applib.annotation.MustSatisfy;
 import org.apache.isis.applib.spec.Specification;
+import org.apache.isis.core.metamodel.facetapi.Facet;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetUtil;
 import org.apache.isis.core.metamodel.facetapi.FeatureType;
 import org.apache.isis.core.metamodel.facets.AnnotationBasedFacetFactoryAbstract;
 
-public class MustSatisfySpecificationFacetFactory  extends AnnotationBasedFacetFactoryAbstract {
+public class MustSatisfySpecificationOnTypeFacetFactory  extends AnnotationBasedFacetFactoryAbstract {
 
-    public MustSatisfySpecificationFacetFactory() {
-        super(FeatureType.OBJECTS_PROPERTIES_AND_PARAMETERS);
+    public MustSatisfySpecificationOnTypeFacetFactory() {
+        super(FeatureType.OBJECTS_ONLY);
     }
 
     @Override
@@ -42,34 +42,11 @@ public class MustSatisfySpecificationFac
         FacetUtil.addFacet(create(processClassContaxt.getCls(), processClassContaxt.getFacetHolder()));
     }
 
-    private MustSatisfySpecificationFacet create(Class<?> clazz, FacetHolder holder) {
+    private Facet create(Class<?> clazz, FacetHolder holder) {
         return create(getAnnotation(clazz, MustSatisfy.class), holder);
     }
 
-    @Override
-    public void process(ProcessMethodContext processMethodContext) {
-        FacetUtil.addFacet(create(processMethodContext.getMethod(), processMethodContext.getFacetHolder()));
-    }
-
-    private MustSatisfySpecificationFacet create(Method method, FacetHolder holder) {
-        return create(getAnnotation(method, MustSatisfy.class), holder);
-    }
-
-
-    @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 MustSatisfySpecificationFacet create(final MustSatisfy annotation, final FacetHolder holder) {
+    private static Facet create(final MustSatisfy annotation, final FacetHolder holder) {
         if (annotation == null) {
             return null;
         }
@@ -81,10 +58,10 @@ public class MustSatisfySpecificationFac
                 specifications.add(specification);
             }
         }
-        return specifications.size() > 0 ? new MustSatisfySpecificationFacet(specifications, holder) : null;
+        return specifications.size() > 0 ? new MustSatisfySpecificationOnTypeFacet(specifications, holder) : null;
     }
 
-    private Specification newSpecificationElseNull(Class<?> value) {
+    private static Specification newSpecificationElseNull(Class<?> value) {
         if (!(Specification.class.isAssignableFrom(value))) {
             return null;
         }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validprops/ObjectValidPropertiesFacet.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validprops/ObjectValidPropertiesFacet.java?rev=1060035&r1=1060034&r2=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validprops/ObjectValidPropertiesFacet.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/validprops/ObjectValidPropertiesFacet.java Mon Jan 17 18:22:58 2011
@@ -21,7 +21,7 @@
 package org.apache.isis.core.progmodel.facets.object.validprops;
 
 import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facets.propparam.validate.mandatory.MandatoryFacet;
+import org.apache.isis.core.metamodel.facets.mandatory.MandatoryFacet;
 import org.apache.isis.core.metamodel.interactions.ObjectValidityContext;
 import org.apache.isis.core.metamodel.interactions.ValidatingInteractionAdvisor;
 

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/EqualByContentFacetViaValueSemantics.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/EqualByContentFacetViaValueSemantics.java?rev=1060035&r1=1060034&r2=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/EqualByContentFacetViaValueSemantics.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/EqualByContentFacetViaValueSemantics.java Mon Jan 17 18:22:58 2011
@@ -21,7 +21,7 @@
 package org.apache.isis.core.progmodel.facets.object.value;
 
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.progmodel.facets.object.ebc.EqualByContentFacetAbstract;
+import org.apache.isis.core.metamodel.facets.ebc.EqualByContentFacetAbstract;
 
 
 public class EqualByContentFacetViaValueSemantics extends EqualByContentFacetAbstract {

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ImmutableFacetViaValueSemantics.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ImmutableFacetViaValueSemantics.java?rev=1060035&r1=1060034&r2=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ImmutableFacetViaValueSemantics.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ImmutableFacetViaValueSemantics.java Mon Jan 17 18:22:58 2011
@@ -22,10 +22,10 @@ package org.apache.isis.core.progmodel.f
 
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facets.When;
-import org.apache.isis.core.progmodel.facets.object.immutable.ImmutableFacetImpl;
+import org.apache.isis.core.metamodel.facets.object.immutable.ImmutableFacetAbstract;
 
 
-public class ImmutableFacetViaValueSemantics extends ImmutableFacetImpl {
+public class ImmutableFacetViaValueSemantics extends ImmutableFacetAbstract {
 
     public ImmutableFacetViaValueSemantics(final FacetHolder holder) {
         super(When.ALWAYS, holder);

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/TypicalLengthFacetUsingParser.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/typicallength/parser/TypicalLengthFacetUsingParser.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/TypicalLengthFacetUsingParser.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/TypicalLengthFacetUsingParser.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/typicallength/parser/TypicalLengthFacetUsingParser.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/propparam/typicallength/parser/TypicalLengthFacetUsingParser.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/TypicalLengthFacetUsingParser.java Mon Jan 17 18:22:58 2011
@@ -18,21 +18,21 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.propparam.typicallength.parser;
+package org.apache.isis.core.progmodel.facets.object.value;
 
 import org.apache.isis.applib.adapters.Parser;
 import org.apache.isis.core.metamodel.facetapi.FacetAbstract;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.propparam.typicallength.TypicalLengthFacet;
+import org.apache.isis.core.metamodel.facets.typicallength.TypicalLengthFacet;
 import org.apache.isis.core.metamodel.runtimecontext.DependencyInjector;
 
 
 public class TypicalLengthFacetUsingParser extends FacetAbstract implements TypicalLengthFacet {
 
-    private final Parser parser;
+    private final Parser<?> parser;
 	private final DependencyInjector dependencyInjector;
 	
-    public TypicalLengthFacetUsingParser(final Parser parser, final FacetHolder holder, final DependencyInjector dependencyInjector) {
+    public TypicalLengthFacetUsingParser(final Parser<?> parser, final FacetHolder holder, final DependencyInjector dependencyInjector) {
         super(TypicalLengthFacet.class, holder, false);
         this.parser = parser;
         this.dependencyInjector = dependencyInjector;

Added: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueFacetAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueFacetAbstract.java?rev=1060035&view=auto
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueFacetAbstract.java (added)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueFacetAbstract.java Mon Jan 17 18:22:58 2011
@@ -0,0 +1,191 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+
+package org.apache.isis.core.progmodel.facets.object.value;
+
+import org.apache.isis.applib.adapters.DefaultsProvider;
+import org.apache.isis.applib.adapters.EncoderDecoder;
+import org.apache.isis.applib.adapters.Parser;
+import org.apache.isis.applib.adapters.ValueSemanticsProvider;
+import org.apache.isis.core.commons.authentication.AuthenticationSessionProvider;
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.commons.lang.ClassUtil;
+import org.apache.isis.core.metamodel.adapter.map.AdapterMap;
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
+import org.apache.isis.core.metamodel.facets.MultipleValueFacetAbstract;
+import org.apache.isis.core.metamodel.facets.object.value.ValueFacet;
+import org.apache.isis.core.metamodel.runtimecontext.DependencyInjector;
+import org.apache.isis.core.progmodel.facets.object.defaults.DefaultedFacetUsingDefaultsProvider;
+import org.apache.isis.core.progmodel.facets.object.encodeable.EncodableFacetUsingEncoderDecoder;
+import org.apache.isis.core.progmodel.facets.object.parseable.ParseableFacetUsingParser;
+import org.apache.isis.core.progmodel.facets.object.title.TitleFacetUsingParser;
+
+
+public abstract class ValueFacetAbstract extends MultipleValueFacetAbstract implements ValueFacet {
+
+    public static Class<? extends Facet> type() {
+        return ValueFacet.class;
+    }
+
+    private static ValueSemanticsProvider<?> newValueSemanticsProviderOrNull(
+            final Class<?> semanticsProviderClass, 
+            final FacetHolder holder,
+    		final IsisConfiguration configuration,
+    		final ValueSemanticsProviderContext context) {
+        if (semanticsProviderClass == null) {
+            return null;
+        }
+        return (ValueSemanticsProvider<?>) ClassUtil.newInstance(
+        		semanticsProviderClass, 
+        		new Class<?>[]{ FacetHolder.class, IsisConfiguration.class, ValueSemanticsProviderContext.class},
+        		new Object[] { holder, configuration, context});
+    }
+
+    // to look after the facets (since MultiTyped)
+    private final FacetHolder facetHolder = new FacetHolderImpl();
+
+    private final ValueSemanticsProvider<?> semanticsProvider;
+
+    private final ValueSemanticsProviderContext context;
+
+    public enum AddFacetsIfInvalidStrategy {
+        DO_ADD(true),
+        DONT_ADD(false);
+        private boolean addFacetsIfInvalid;
+        private AddFacetsIfInvalidStrategy(boolean addFacetsIfInvalid) {
+            this.addFacetsIfInvalid = addFacetsIfInvalid;
+        }
+        public boolean shouldAddFacetsIfInvalid() {
+            return addFacetsIfInvalid;
+        }
+    }
+    
+    public ValueFacetAbstract(
+    		final Class<?> semanticsProviderClass, 
+    		final AddFacetsIfInvalidStrategy addFacetsIfInvalid, 
+    		final FacetHolder holder, 
+    		final IsisConfiguration configuration, 
+            final ValueSemanticsProviderContext context) {
+        this(newValueSemanticsProviderOrNull(semanticsProviderClass, holder, configuration, context), 
+            addFacetsIfInvalid, holder, context);
+    }
+
+    public ValueFacetAbstract(
+            final ValueSemanticsProvider<?> semanticsProvider,
+            final AddFacetsIfInvalidStrategy addFacetsIfInvalid,
+            final FacetHolder holder,
+            final ValueSemanticsProviderContext context) {
+        super(type(), holder);
+
+        this.semanticsProvider = semanticsProvider;
+        this.context = context;
+        
+        // note: we can't use the runtimeContext to inject dependencies into the semanticsProvider,
+        // because there won't be any PersistenceSession when initially building the metamodel.
+        // so, we defer until we use the parser.
+        
+        if (!isValid() && !addFacetsIfInvalid.shouldAddFacetsIfInvalid()) {
+            return;
+        }
+
+        // we now figure add all the facets supported. Note that we do not use FacetUtil.addFacet,
+        // because we need to add them explicitly to our delegate facetholder but have the
+        // facets themselves reference this value's holder.
+
+        facetHolder.addFacet((Facet) this); // add just ValueFacet.class initially.
+
+        // we used to add aggregated here, but this was wrong.  
+        // An immutable value is not aggregated, it is shared.
+
+        // ImmutableFacet, if appropriate
+        final boolean immutable = semanticsProvider != null ? semanticsProvider.isImmutable() : true;
+        if (immutable) {
+            facetHolder.addFacet(new ImmutableFacetViaValueSemantics(holder));
+        }
+
+        // EqualByContentFacet, if appropriate
+        final boolean equalByContent = semanticsProvider != null ? semanticsProvider.isEqualByContent() : true;
+        if (equalByContent) {
+            facetHolder.addFacet(new EqualByContentFacetViaValueSemantics(holder));
+        }
+
+        if (semanticsProvider != null) {
+
+            // install the EncodeableFacet if we've been given an EncoderDecoder
+            final EncoderDecoder<?> encoderDecoder = semanticsProvider.getEncoderDecoder();
+            if (encoderDecoder != null) {
+                facetHolder.addFacet(new EncodableFacetUsingEncoderDecoder(encoderDecoder, holder, getAdapterMap(), getDependencyInjector()));
+            }
+
+            // install the ParseableFacet and other facets if we've been given a Parser
+            final Parser<?> parser = semanticsProvider.getParser();
+            if (parser != null) {
+                facetHolder.addFacet(new ParseableFacetUsingParser(parser, holder, getAuthenticationSessionProvider(), getDependencyInjector(), getAdapterMap()));
+                facetHolder.addFacet(new TitleFacetUsingParser(parser, holder, getDependencyInjector()));
+                facetHolder.addFacet(new TypicalLengthFacetUsingParser(parser, holder, getDependencyInjector()));
+            }
+
+            // install the DefaultedFacet if we've been given a DefaultsProvider
+            final DefaultsProvider<?> defaultsProvider = semanticsProvider.getDefaultsProvider();
+            if (defaultsProvider != null) {
+                facetHolder.addFacet(new DefaultedFacetUsingDefaultsProvider(defaultsProvider, holder, getDependencyInjector()));
+            }
+        }
+    }
+
+
+    public boolean isValid() {
+        return this.semanticsProvider != null;
+    }
+
+    // /////////////////////////////
+    // MultiTypedFacet impl
+    // /////////////////////////////
+    @Override
+    public Class<? extends Facet>[] facetTypes() {
+        return facetHolder.getFacetTypes();
+    }
+
+    @Override
+    public <T extends Facet> T getFacet(Class<T> facetType) {
+        return facetHolder.getFacet(facetType);
+    }
+
+
+    
+    // /////////////////////////////////////////
+    // Dependencies (from constructor)
+    // /////////////////////////////////////////
+
+    public AdapterMap getAdapterMap() {
+        return context.getAdapterMap();
+    }
+    
+    public DependencyInjector getDependencyInjector() {
+        return context.getDependencyInjector();
+    }
+
+    public AuthenticationSessionProvider getAuthenticationSessionProvider() {
+        return context.getAuthenticationSessionProvider();
+    }
+
+}

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueSemanticsProviderAndFacetAbstract.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/ValueSemanticsProviderAndFacetAbstract.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueSemanticsProviderAndFacetAbstract.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueSemanticsProviderAndFacetAbstract.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/ValueSemanticsProviderAndFacetAbstract.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/ValueSemanticsProviderAndFacetAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueSemanticsProviderAndFacetAbstract.java Mon Jan 17 18:22:58 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.value;
+package org.apache.isis.core.progmodel.facets.object.value;
 
 import java.text.DecimalFormat;
 import java.text.Format;
@@ -45,7 +45,6 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.runtimecontext.DependencyInjector;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.spec.SpecificationLookup;
-import org.apache.isis.core.progmodel.facets.object.value.ValueSemanticsProviderContext;
 
 
 public abstract class ValueSemanticsProviderAndFacetAbstract<T> extends FacetAbstract implements ValueSemanticsProvider<T>, EncoderDecoder<T>,

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueSemanticsProviderUtil.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueSemanticsProviderUtil.java?rev=1060035&r1=1060034&r2=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueSemanticsProviderUtil.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueSemanticsProviderUtil.java Mon Jan 17 18:22:58 2011
@@ -34,7 +34,7 @@ public final class ValueSemanticsProvide
     public static final String SEMANTICS_PROVIDER_NAME_KEY_PREFIX = "isis.core.progmodel.value.";
     public static final String SEMANTICS_PROVIDER_NAME_KEY_SUFFIX = ".semanticsProviderName";
 
-    static String semanticsProviderNameFromConfiguration(final Class<?> type, final IsisConfiguration configuration) {
+    public static String semanticsProviderNameFromConfiguration(final Class<?> type, final IsisConfiguration configuration) {
         final String key = SEMANTICS_PROVIDER_NAME_KEY_PREFIX + type.getCanonicalName() + SEMANTICS_PROVIDER_NAME_KEY_SUFFIX;
         final String semanticsProviderName = configuration.getString(key);
         return !StringUtils.isNullOrEmpty(semanticsProviderName) ? semanticsProviderName : null;

Copied: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueUsingValueSemanticsProviderFacetFactory.java (from r1059849, incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/ValueUsingValueSemanticsProviderFacetFactory.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueUsingValueSemanticsProviderFacetFactory.java?p2=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueUsingValueSemanticsProviderFacetFactory.java&p1=incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/ValueUsingValueSemanticsProviderFacetFactory.java&r1=1059849&r2=1060035&rev=1060035&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/ValueUsingValueSemanticsProviderFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/object/value/ValueUsingValueSemanticsProviderFacetFactory.java Mon Jan 17 18:22:58 2011
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.core.progmodel.facets.value;
+package org.apache.isis.core.progmodel.facets.object.value;
 
 import org.apache.isis.core.commons.authentication.AuthenticationSessionProvider;
 import org.apache.isis.core.commons.authentication.AuthenticationSessionProviderAware;
@@ -32,8 +32,6 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
 import org.apache.isis.core.metamodel.runtimecontext.DependencyInjector;
 import org.apache.isis.core.metamodel.runtimecontext.DependencyInjectorAware;
-import org.apache.isis.core.progmodel.facets.object.value.ValueFacetUsingSemanticsProvider;
-import org.apache.isis.core.progmodel.facets.object.value.ValueSemanticsProviderContext;
 
 
 public abstract class ValueUsingValueSemanticsProviderFacetFactory<T> extends FacetFactoryAbstract implements 



Mime
View raw message