incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1051471 [7/10] - in /incubator/isis/trunk: alternatives/embedded/src/main/java/org/apache/isis/alternatives/embedded/ alternatives/embedded/src/main/java/org/apache/isis/alternatives/embedded/internal/ alternatives/objectstore/nosql/src/te...
Date Tue, 21 Dec 2010 12:06:23 GMT
Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DateValueSemanticsProvider.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DateValueSemanticsProvider.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DateValueSemanticsProvider.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DateValueSemanticsProvider.java Tue Dec 21 12:06:15 2010
@@ -20,23 +20,22 @@
 
 package org.apache.isis.core.progmodel.facets.value;
 
-import java.util.Date;
-
-import org.apache.isis.applib.adapters.EncoderDecoder;
-import org.apache.isis.applib.adapters.Parser;
+import java.util.Date;
+
+import edu.umd.cs.findbugs.annotations.SuppressWarnings;
+
+import org.apache.isis.applib.adapters.EncoderDecoder;
+import org.apache.isis.applib.adapters.Parser;
 import org.apache.isis.core.metamodel.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facets.FacetHolder;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
-
-import edu.umd.cs.findbugs.annotations.SuppressWarnings;
+import org.apache.isis.core.progmodel.facets.object.value.ValueSemanticsProviderContext;
 
 
-public class DateValueSemanticsProvider extends DateValueSemanticsProviderAbstract {
+public class DateValueSemanticsProvider extends DateValueSemanticsProviderAbstract<org.apache.isis.applib.value.Date> {
 
     private static final boolean IMMUTABLE = false;
     private static final boolean EQUAL_BY_CONTENT = false;
-    private static final Object DEFAULT_VALUE = null; // new org.apache.isis.applib.value.Date(2007,1,1);
+    private static final org.apache.isis.applib.value.Date DEFAULT_VALUE = null; // new org.apache.isis.applib.value.Date(2007,1,1);
 
     // // no default
 
@@ -45,26 +44,25 @@ public class DateValueSemanticsProvider 
      */
     @SuppressWarnings("NP_NULL_PARAM_DEREF_NONVIRTUAL")
     public DateValueSemanticsProvider() {
-        this(null, null, null, null);
+        this(null, null, null);
     }
 
     public DateValueSemanticsProvider(
     		final FacetHolder holder,
             final IsisConfiguration configuration,
-            final SpecificationLoader specificationLoader,
-            final RuntimeContext runtimeContext) {
-        super(holder, org.apache.isis.applib.value.Date.class, IMMUTABLE, EQUAL_BY_CONTENT, DEFAULT_VALUE, configuration, specificationLoader, runtimeContext);
+            final ValueSemanticsProviderContext context) {
+        super(holder, org.apache.isis.applib.value.Date.class, IMMUTABLE, EQUAL_BY_CONTENT, DEFAULT_VALUE, configuration, context);
     }
 
     @Override
-    protected Object add(
-            final Object original,
+    protected org.apache.isis.applib.value.Date add(
+            final org.apache.isis.applib.value.Date original,
             final int years,
             final int months,
             final int days,
             final int hours,
             final int minutes) {
-        final org.apache.isis.applib.value.Date date = (org.apache.isis.applib.value.Date) original;
+        final org.apache.isis.applib.value.Date date = original;
         return date.add(years, months, days);
     }
 
@@ -79,7 +77,7 @@ public class DateValueSemanticsProvider 
     }
 
     @Override
-    protected Object setDate(final Date date) {
+    protected org.apache.isis.applib.value.Date setDate(final Date date) {
         return new org.apache.isis.applib.value.Date(date);
     }
 }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DateValueSemanticsProviderAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DateValueSemanticsProviderAbstract.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DateValueSemanticsProviderAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DateValueSemanticsProviderAbstract.java Tue Dec 21 12:06:15 2010
@@ -22,18 +22,19 @@ package org.apache.isis.core.progmodel.f
 
 import java.text.DateFormat;
 import java.util.Calendar;
-import java.util.Hashtable;
+import java.util.Map;
+
+import com.google.inject.internal.Maps;
 
 import org.apache.isis.core.metamodel.config.ConfigurationConstants;
 import org.apache.isis.core.metamodel.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facets.FacetHolder;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
+import org.apache.isis.core.progmodel.facets.object.value.ValueSemanticsProviderContext;
 
 
-public abstract class DateValueSemanticsProviderAbstract extends ValueSemanticsProviderAbstractTemporal {
+public abstract class DateValueSemanticsProviderAbstract<T> extends ValueSemanticsProviderAbstractTemporal<T> {
 
-    private static Hashtable<String,DateFormat> formats = new Hashtable<String,DateFormat>();
+    private static Map<String,DateFormat> formats = Maps.newHashMap();
 
     static {
         formats.put("iso", createDateFormat("yyyy-MM-dd"));
@@ -45,18 +46,17 @@ public abstract class DateValueSemantics
 
     public DateValueSemanticsProviderAbstract(
             final FacetHolder holder,
-            final Class<?> adaptedClass,
+            final Class<T> adaptedClass,
             final boolean immutable,
             final boolean equalByContent,
-            final Object defaultValue,
+            final T defaultValue,
             final IsisConfiguration configuration, 
-            final SpecificationLoader specificationLoader, 
-            final RuntimeContext runtimeContext) {
-        super("date", holder, adaptedClass, 12, immutable, equalByContent, defaultValue, configuration, specificationLoader, runtimeContext);
+            final ValueSemanticsProviderContext context) {
+        super("date", holder, adaptedClass, 12, immutable, equalByContent, defaultValue, configuration, context);
 
         final String formatRequired = configuration.getString(ConfigurationConstants.ROOT + "value.format.date");
         if (formatRequired == null) {
-            format = (DateFormat) formats().get(defaultFormat());
+            format = formats().get(defaultFormat());
         } else {
             setMask(formatRequired);
         }
@@ -96,7 +96,7 @@ public abstract class DateValueSemantics
     }
 
     @Override
-    protected Hashtable<String,DateFormat> formats() {
+    protected Map<String, DateFormat> formats() {
         return formats;
     }
 

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DateValueTypeFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DateValueTypeFacetFactory.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DateValueTypeFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DateValueTypeFacetFactory.java Tue Dec 21 12:06:15 2010
@@ -24,7 +24,7 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.MethodRemover;
 
 
-public class DateValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory {
+public class DateValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory<org.apache.isis.applib.value.Date> {
 
     public DateValueTypeFacetFactory() {
         super(DateValueFacet.class); // as per inherited DateTimeValueSemanticsProvider#facetType
@@ -36,7 +36,7 @@ public class DateValueTypeFacetFactory e
         if (type != org.apache.isis.applib.value.Date.class) {
             return false;
         }
-        addFacets(new DateValueSemanticsProvider(holder, getConfiguration(), getSpecificationLoader(), getRuntimeContext()));
+        addFacets(new DateValueSemanticsProvider(holder, getConfiguration(), getContext()));
         return true;
     }
 

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DoublePrimitiveValueSemanticsProvider.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DoublePrimitiveValueSemanticsProvider.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DoublePrimitiveValueSemanticsProvider.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DoublePrimitiveValueSemanticsProvider.java Tue Dec 21 12:06:15 2010
@@ -26,37 +26,30 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facets.FacetHolder;
 import org.apache.isis.core.metamodel.facets.properties.defaults.PropertyDefaultFacet;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
+import org.apache.isis.core.progmodel.facets.object.value.ValueSemanticsProviderContext;
 
 
 public class DoublePrimitiveValueSemanticsProvider extends DoubleValueSemanticsProviderAbstract implements PropertyDefaultFacet {
 
-    private static final Object DEFAULT_VALUE = new Double(0.0d);
-
-    static final Class<?> adaptedClass() {
-        return double.class;
-    }
-
     /**
      * Required because implementation of {@link Parser} and {@link EncoderDecoder}.
      */
     public DoublePrimitiveValueSemanticsProvider() {
-        this(null, null, null, null);
+        this(null, null, null);
     }
 
     public DoublePrimitiveValueSemanticsProvider(
     		final FacetHolder holder,
             final IsisConfiguration configuration, 
-            final SpecificationLoader specificationLoader, 
-            final RuntimeContext runtimeContext) {
-        super(holder, adaptedClass(), DEFAULT_VALUE, configuration, specificationLoader, runtimeContext);
+            final ValueSemanticsProviderContext context) {
+        super(holder, double.class, configuration, context);
     }
 
     // //////////////////////////////////////////////////////////////////
     // PropertyDefaultFacet
     // //////////////////////////////////////////////////////////////////
 
+    @Override
     public ObjectAdapter getDefault(final ObjectAdapter inObject) {
         return createAdapter(double.class, new Double(0.0));
     }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DoublePrimitiveValueTypeFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DoublePrimitiveValueTypeFacetFactory.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DoublePrimitiveValueTypeFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DoublePrimitiveValueTypeFacetFactory.java Tue Dec 21 12:06:15 2010
@@ -24,7 +24,7 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.MethodRemover;
 
 
-public class DoublePrimitiveValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory {
+public class DoublePrimitiveValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory<Double> {
 
     public DoublePrimitiveValueTypeFacetFactory() {
         super(DoubleFloatingPointValueFacet.class);
@@ -32,10 +32,10 @@ public class DoublePrimitiveValueTypeFac
 
     @Override
     public boolean process(final Class<?> type, final MethodRemover methodRemover, final FacetHolder holder) {
-        if (type != DoublePrimitiveValueSemanticsProvider.adaptedClass()) {
+        if (type != double.class) {
             return false;
         }
-        addFacets(new DoublePrimitiveValueSemanticsProvider(holder, getConfiguration(), getSpecificationLoader(), getRuntimeContext()));
+        addFacets(new DoublePrimitiveValueSemanticsProvider(holder, getConfiguration(), getContext()));
         return true;
     }
 

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DoubleValueSemanticsProviderAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DoubleValueSemanticsProviderAbstract.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DoubleValueSemanticsProviderAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DoubleValueSemanticsProviderAbstract.java Tue Dec 21 12:06:15 2010
@@ -29,17 +29,17 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.facets.FacetHolder;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
+import org.apache.isis.core.progmodel.facets.object.value.ValueSemanticsProviderContext;
 
 
-public abstract class DoubleValueSemanticsProviderAbstract extends ValueSemanticsProviderAbstract implements
+public abstract class DoubleValueSemanticsProviderAbstract extends ValueSemanticsProviderAndFacetAbstract<Double> implements
         DoubleFloatingPointValueFacet {
 
     private static Class<? extends Facet> type() {
         return DoubleFloatingPointValueFacet.class;
     }
 
+    private static final Double DEFAULT_VALUE = new Double(0.0d);
     private static final int TYPICAL_LENGTH = 22;
     private static final boolean IMMUTABLE = true;
     private static final boolean EQUAL_BY_CONTENT = true;
@@ -47,11 +47,11 @@ public abstract class DoubleValueSemanti
     private final NumberFormat format;
 
     public DoubleValueSemanticsProviderAbstract(
-    		final FacetHolder holder, final Class<?> adaptedClass, final Object defaultValue,
+    		final FacetHolder holder, 
+    		final Class<Double> adaptedClass, 
             final IsisConfiguration configuration, 
-            final SpecificationLoader specificationLoader, 
-            final RuntimeContext runtimeContext) {
-        super(type(), holder, adaptedClass, TYPICAL_LENGTH, IMMUTABLE, EQUAL_BY_CONTENT, defaultValue, configuration, specificationLoader, runtimeContext);
+            final ValueSemanticsProviderContext context) {
+        super(type(), holder, adaptedClass, TYPICAL_LENGTH, IMMUTABLE, EQUAL_BY_CONTENT, DEFAULT_VALUE, configuration, context);
         format = determineNumberFormat("value.format.double");
     }
 
@@ -60,7 +60,7 @@ public abstract class DoubleValueSemanti
     // //////////////////////////////////////////////////////////////////
 
     @Override
-    protected Object doParse(final Object original, final String entry) {
+    protected Double doParse(final Object context, final String entry) {
         try {
             return new Double(format.parse(entry).doubleValue());
         } catch (final ParseException e) {
@@ -92,7 +92,7 @@ public abstract class DoubleValueSemanti
     }
 
     @Override
-    protected Object doRestore(final String data) {
+    protected Double doRestore(final String data) {
         return new Double(data);
     }
 
@@ -100,12 +100,14 @@ public abstract class DoubleValueSemanti
     // DoubleValueFacet
     // //////////////////////////////////////////////////////////////////
 
+    @Override
     public Double doubleValue(final ObjectAdapter object) {
         return (Double) (object == null ? null : object.getObject());
     }
 
+    @Override
     public ObjectAdapter createValue(final Double value) {
-        return getRuntimeContext().adapterFor(value);
+        return getAdapterMap().adapterFor(value);
     }
 
     // /////// toString ///////
@@ -113,8 +115,5 @@ public abstract class DoubleValueSemanti
     public String toString() {
         return "DoubleValueSemanticsProvider: " + format;
     }
-    
-
-
 
 }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DoubleWrapperValueSemanticsProvider.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DoubleWrapperValueSemanticsProvider.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DoubleWrapperValueSemanticsProvider.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DoubleWrapperValueSemanticsProvider.java Tue Dec 21 12:06:15 2010
@@ -24,31 +24,23 @@ import org.apache.isis.applib.adapters.E
 import org.apache.isis.applib.adapters.Parser;
 import org.apache.isis.core.metamodel.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facets.FacetHolder;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
+import org.apache.isis.core.progmodel.facets.object.value.ValueSemanticsProviderContext;
 
 
 public class DoubleWrapperValueSemanticsProvider extends DoubleValueSemanticsProviderAbstract {
 
-    private static final Object DEFAULT_VALUE = new Double(0.0d);
-
-    static final Class<?> adaptedClass() {
-        return Double.class;
-    }
-
     /**
      * Required because implementation of {@link Parser} and {@link EncoderDecoder}.
      */
     public DoubleWrapperValueSemanticsProvider() {
-        this(null, null, null, null);
+        this(null, null, null);
     }
 
     public DoubleWrapperValueSemanticsProvider(
     		final FacetHolder holder,
             final IsisConfiguration configuration, 
-            final SpecificationLoader specificationLoader, 
-            final RuntimeContext runtimeContext) {
-        super(holder, adaptedClass(), DEFAULT_VALUE, configuration, specificationLoader, runtimeContext);
+            final ValueSemanticsProviderContext context) {
+        super(holder, Double.class, configuration, context);
     }
 
 }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DoubleWrapperValueTypeFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DoubleWrapperValueTypeFacetFactory.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DoubleWrapperValueTypeFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/DoubleWrapperValueTypeFacetFactory.java Tue Dec 21 12:06:15 2010
@@ -24,7 +24,7 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.MethodRemover;
 
 
-public class DoubleWrapperValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory {
+public class DoubleWrapperValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory<Double> {
 
     public DoubleWrapperValueTypeFacetFactory() {
         super(DoubleFloatingPointValueFacet.class);
@@ -32,10 +32,10 @@ public class DoubleWrapperValueTypeFacet
 
     @Override
     public boolean process(final Class<?> type, final MethodRemover methodRemover, final FacetHolder holder) {
-        if (type != DoubleWrapperValueSemanticsProvider.adaptedClass()) {
+        if (type != Double.class) {
             return false;
         }
-        addFacets(new DoubleWrapperValueSemanticsProvider(holder, getConfiguration(), getSpecificationLoader(), getRuntimeContext()));
+        addFacets(new DoubleWrapperValueSemanticsProvider(holder, getConfiguration(), getContext()));
         return true;
     }
 

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/FloatPrimitiveValueSemanticsProvider.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/FloatPrimitiveValueSemanticsProvider.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/FloatPrimitiveValueSemanticsProvider.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/FloatPrimitiveValueSemanticsProvider.java Tue Dec 21 12:06:15 2010
@@ -26,37 +26,30 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facets.FacetHolder;
 import org.apache.isis.core.metamodel.facets.properties.defaults.PropertyDefaultFacet;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
+import org.apache.isis.core.progmodel.facets.object.value.ValueSemanticsProviderContext;
 
 
 public class FloatPrimitiveValueSemanticsProvider extends FloatValueSemanticsProviderAbstract implements PropertyDefaultFacet {
 
-    private static final Object DEFAULT_VALUE = new Float(0.0f);
-
-    static final Class<?> adaptedClass() {
-        return float.class;
-    }
-
     /**
      * Required because implementation of {@link Parser} and {@link EncoderDecoder}.
      */
     public FloatPrimitiveValueSemanticsProvider() {
-        this(null, null, null, null);
+        this(null, null, null);
     }
 
     public FloatPrimitiveValueSemanticsProvider(
     		final FacetHolder holder,
             final IsisConfiguration configuration, 
-            final SpecificationLoader specificationLoader, 
-            final RuntimeContext runtimeContext) {
-        super(holder, adaptedClass(), DEFAULT_VALUE, configuration, specificationLoader, runtimeContext);
+            final ValueSemanticsProviderContext context) {
+        super(holder, float.class, configuration, context);
     }
 
     // //////////////////////////////////////////////////////////////////
     // PropertyDefaultFacet
     // //////////////////////////////////////////////////////////////////
 
+    @Override
     public ObjectAdapter getDefault(final ObjectAdapter adapter) {
         return createAdapter(float.class, new Float(0.0f));
     }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/FloatPrimitiveValueTypeFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/FloatPrimitiveValueTypeFacetFactory.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/FloatPrimitiveValueTypeFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/FloatPrimitiveValueTypeFacetFactory.java Tue Dec 21 12:06:15 2010
@@ -24,7 +24,7 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.MethodRemover;
 
 
-public class FloatPrimitiveValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory {
+public class FloatPrimitiveValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory<Float> {
 
     public FloatPrimitiveValueTypeFacetFactory() {
         super(FloatingPointValueFacet.class);
@@ -32,10 +32,10 @@ public class FloatPrimitiveValueTypeFace
 
     @Override
     public boolean process(final Class<?> type, final MethodRemover methodRemover, final FacetHolder holder) {
-        if (type != FloatPrimitiveValueSemanticsProvider.adaptedClass()) {
+        if (type != float.class) {
             return false;
         }
-        addFacets(new FloatPrimitiveValueSemanticsProvider(holder, getConfiguration(), getSpecificationLoader(), getRuntimeContext()));
+        addFacets(new FloatPrimitiveValueSemanticsProvider(holder, getConfiguration(), getContext()));
         return true;
     }
 

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/FloatValueSemanticsProviderAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/FloatValueSemanticsProviderAbstract.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/FloatValueSemanticsProviderAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/FloatValueSemanticsProviderAbstract.java Tue Dec 21 12:06:15 2010
@@ -29,16 +29,16 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.facets.FacetHolder;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
+import org.apache.isis.core.progmodel.facets.object.value.ValueSemanticsProviderContext;
 
 
-public class FloatValueSemanticsProviderAbstract extends ValueSemanticsProviderAbstract implements FloatingPointValueFacet {
+public class FloatValueSemanticsProviderAbstract extends ValueSemanticsProviderAndFacetAbstract<Float> implements FloatingPointValueFacet {
 
     public static Class<? extends Facet> type() {
         return FloatingPointValueFacet.class;
     }
 
+    private static final Float DEFAULT_VALUE = new Float(0.0f);
     private static final int TYPICAL_LENGTH = 12;
     private static final boolean IMMUTABLE = true;
     private static final boolean EQUAL_BY_CONTENT = true;
@@ -46,11 +46,11 @@ public class FloatValueSemanticsProvider
     private final NumberFormat format;
 
     public FloatValueSemanticsProviderAbstract(
-    		final FacetHolder holder, final Class<?> adaptedClass, final Object defaultValue,
+    		final FacetHolder holder, 
+    		final Class<Float> adaptedClass,
             final IsisConfiguration configuration, 
-            final SpecificationLoader specificationLoader, 
-            final RuntimeContext runtimeContext) {
-        super(type(), holder, adaptedClass, TYPICAL_LENGTH, IMMUTABLE, EQUAL_BY_CONTENT, defaultValue, configuration, specificationLoader, runtimeContext);
+            final ValueSemanticsProviderContext context) {
+        super(type(), holder, adaptedClass, TYPICAL_LENGTH, IMMUTABLE, EQUAL_BY_CONTENT, DEFAULT_VALUE, configuration, context);
         format = determineNumberFormat("value.format.float");
     }
 
@@ -59,7 +59,7 @@ public class FloatValueSemanticsProvider
     // //////////////////////////////////////////////////////////////////
 
     @Override
-    protected Object doParse(final Object original, final String entry) {
+    protected Float doParse(final Object context, final String entry) {
         try {
             return new Float(format.parse(entry).floatValue());
         } catch (final ParseException e) {
@@ -87,7 +87,7 @@ public class FloatValueSemanticsProvider
     }
 
     @Override
-    protected Object doRestore(final String data) {
+    protected Float doRestore(final String data) {
         return new Float(data);
     }
 
@@ -95,12 +95,14 @@ public class FloatValueSemanticsProvider
     // FloatingPointValueFacet
     // //////////////////////////////////////////////////////////////////
 
+    @Override
     public Float floatValue(final ObjectAdapter object) {
         return object == null ? null : (Float) object.getObject();
     }
 
+    @Override
     public ObjectAdapter createValue(final Float value) {
-        return getRuntimeContext().adapterFor(value);
+        return getAdapterMap().adapterFor(value);
     }
 
     // /////// toString ///////

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/FloatWrapperValueSemanticsProvider.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/FloatWrapperValueSemanticsProvider.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/FloatWrapperValueSemanticsProvider.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/FloatWrapperValueSemanticsProvider.java Tue Dec 21 12:06:15 2010
@@ -24,31 +24,23 @@ import org.apache.isis.applib.adapters.E
 import org.apache.isis.applib.adapters.Parser;
 import org.apache.isis.core.metamodel.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facets.FacetHolder;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
+import org.apache.isis.core.progmodel.facets.object.value.ValueSemanticsProviderContext;
 
 
 public class FloatWrapperValueSemanticsProvider extends FloatValueSemanticsProviderAbstract {
 
-    private static final Object DEFAULT_VALUE = new Float(0.0f);
-
-    static final Class<?> adaptedClass() {
-        return Float.class;
-    }
-
     /**
      * Required because implementation of {@link Parser} and {@link EncoderDecoder}.
      */
     public FloatWrapperValueSemanticsProvider() {
-        this(null, null, null, null);
+        this(null, null, null);
     }
 
     public FloatWrapperValueSemanticsProvider(
     		final FacetHolder holder,
             final IsisConfiguration configuration, 
-            final SpecificationLoader specificationLoader, 
-            final RuntimeContext runtimeContext) {
-        super(holder, adaptedClass(), DEFAULT_VALUE, configuration, specificationLoader, runtimeContext);
+            final ValueSemanticsProviderContext context) {
+        super(holder, Float.class, configuration, context);
     }
 
 }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/FloatWrapperValueTypeFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/FloatWrapperValueTypeFacetFactory.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/FloatWrapperValueTypeFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/FloatWrapperValueTypeFacetFactory.java Tue Dec 21 12:06:15 2010
@@ -24,7 +24,7 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.MethodRemover;
 
 
-public class FloatWrapperValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory {
+public class FloatWrapperValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory<Float> {
 
     public FloatWrapperValueTypeFacetFactory() {
         super(FloatingPointValueFacet.class);
@@ -32,10 +32,10 @@ public class FloatWrapperValueTypeFacetF
 
     @Override
     public boolean process(final Class<?> type, final MethodRemover methodRemover, final FacetHolder holder) {
-        if (type != FloatWrapperValueSemanticsProvider.adaptedClass()) {
+        if (type != Float.class) {
             return false;
         }
-        addFacets(new FloatWrapperValueSemanticsProvider(holder, getConfiguration(), getSpecificationLoader(), getRuntimeContext()));
+        addFacets(new FloatWrapperValueSemanticsProvider(holder, getConfiguration(), getContext()));
         return true;
     }
 

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/ImageValueSemanticsProvider.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/ImageValueSemanticsProvider.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/ImageValueSemanticsProvider.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/ImageValueSemanticsProvider.java Tue Dec 21 12:06:15 2010
@@ -20,25 +20,24 @@
 
 package org.apache.isis.core.progmodel.facets.value;
 
-import org.apache.isis.applib.value.Image;
+import org.apache.isis.applib.value.Image;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.facets.FacetHolder;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
+import org.apache.isis.core.progmodel.facets.object.value.ValueSemanticsProviderContext;
 
 
-public class ImageValueSemanticsProvider extends ImageValueSemanticsProviderAbstract {
+public class ImageValueSemanticsProvider extends ImageValueSemanticsProviderAbstract<Image> {
 
     public ImageValueSemanticsProvider(
             final FacetHolder holder,
             final IsisConfiguration configuration, 
-            final SpecificationLoader specificationLoader, 
-            final RuntimeContext runtimeContext) {
-        super(holder, Image.class, configuration, specificationLoader, runtimeContext);
+            final ValueSemanticsProviderContext context) {
+        super(holder, Image.class, configuration, context);
     }
 
+    @Override
     public int getHeight(final ObjectAdapter object) {
         return image(object).getHeight();
     }
@@ -47,6 +46,7 @@ public class ImageValueSemanticsProvider
         return (Image) object.getObject();
     }
 
+    @Override
     public java.awt.Image getImage(final ObjectAdapter object) {
         return createImage(image(object).getImage());
     }
@@ -60,15 +60,17 @@ public class ImageValueSemanticsProvider
         return Image.class;
     }
 
+    @Override
     public int getWidth(final ObjectAdapter object) {
         return image(object).getWidth();
     }
 
     @Override
-    protected Object setPixels(final int[][] pixels) {
+    protected Image setPixels(final int[][] pixels) {
         return new Image(pixels);
     }
 
+    @Override
     public Facet getUnderlyingFacet() {
         return null;
     }
@@ -76,14 +78,17 @@ public class ImageValueSemanticsProvider
     /**
      * Not required because {@link #alwaysReplace()} is <tt>false</tt>.
      */
+    @Override
     public void setUnderlyingFacet(Facet underlyingFacet) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public boolean alwaysReplace() {
         return false;
     }
 
+    @Override
     public boolean isNoop() {
         return false;
     }
@@ -93,8 +98,9 @@ public class ImageValueSemanticsProvider
         return "ImageValueSemanticsProvider: ";
     }
 
+    @Override
     public ObjectAdapter createValue(final java.awt.Image image) {
-        return getRuntimeContext().adapterFor(new Image(grabPixels(image)));
+        return getAdapterMap().adapterFor(new Image(grabPixels(image)));
    }
 
 }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/ImageValueSemanticsProviderAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/ImageValueSemanticsProviderAbstract.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/ImageValueSemanticsProviderAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/ImageValueSemanticsProviderAbstract.java Tue Dec 21 12:06:15 2010
@@ -20,24 +20,24 @@
 
 package org.apache.isis.core.progmodel.facets.value;
 
-import java.awt.Image;
-import java.awt.image.ColorModel;
-import java.awt.image.ImageObserver;
-import java.awt.image.MemoryImageSource;
-import java.awt.image.PixelGrabber;
-
-import org.apache.isis.applib.adapters.Parser;
+import java.awt.Image;
+import java.awt.image.ColorModel;
+import java.awt.image.ImageObserver;
+import java.awt.image.MemoryImageSource;
+import java.awt.image.PixelGrabber;
+
+import org.apache.isis.applib.adapters.Parser;
 import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.core.commons.exceptions.UnexpectedCallException;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.facets.FacetHolder;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
+import org.apache.isis.core.progmodel.facets.object.value.ValueSemanticsProviderContext;
 
 
-public abstract class ImageValueSemanticsProviderAbstract extends ValueSemanticsProviderAbstract implements ImageValueFacet {
+public abstract class ImageValueSemanticsProviderAbstract<T> extends ValueSemanticsProviderAndFacetAbstract<T> implements ImageValueFacet {
+    
     private static final boolean IMMUTABLE = false;
     private static final boolean EQUAL_BY_CONTENT = false;
     private static final Object DEFAULT_VALUE = null; // no default
@@ -61,14 +61,12 @@ public abstract class ImageValueSemantic
 
     private FacetHolder facetHolder;
 
- //   private final RuntimeContext runtimeContext;
-
+    @SuppressWarnings("unchecked")
     public ImageValueSemanticsProviderAbstract(final FacetHolder holder,
-            final Class<?> adaptedClass,
+            final Class<T> adaptedClass,
             final IsisConfiguration configuration, 
-            final SpecificationLoader specificationLoader, 
-            final RuntimeContext runtimeContext) {
-        super(ImageValueFacet.class, holder, adaptedClass, TYPICAL_LENGTH, IMMUTABLE, EQUAL_BY_CONTENT, DEFAULT_VALUE, configuration, specificationLoader, runtimeContext);
+            final ValueSemanticsProviderContext context) {
+        super(ImageValueFacet.class, holder, adaptedClass, TYPICAL_LENGTH, IMMUTABLE, EQUAL_BY_CONTENT, (T)DEFAULT_VALUE, configuration, context);
     }
     
 
@@ -76,12 +74,12 @@ public abstract class ImageValueSemantic
      * Returns null to indicate that this value does not parse entry strings
      */
     @Override
-    public Parser getParser() {
+    public Parser<T> getParser() {
         return null;
     }
 
     @Override
-    protected Object doParse(Object original, String entry) {
+    protected T doParse(Object original, String entry) {
         throw new UnexpectedCallException();
     }
 
@@ -107,10 +105,12 @@ public abstract class ImageValueSemantic
         return value;
     }
 
+    @Override
     public boolean alwaysReplace() {
         return false;
     }
 
+    @Override
     public Facet getUnderlyingFacet() {
         return null;
     }
@@ -118,15 +118,17 @@ public abstract class ImageValueSemantic
     /**
      * Not required because {@link #alwaysReplace()} is <tt>false</tt>.
      */
+    @Override
     public void setUnderlyingFacet(Facet underlyingFacet) {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public boolean isDerived() {
         return false;
     }
 
-    public Object restoreFromByteArray(final byte[] byteArray) {
+    public T restoreFromByteArray(final byte[] byteArray) {
         final int[] flatIntArray = new int[byteArray.length / 4];
         for (int i = 0; i < flatIntArray.length; i++) {
             flatIntArray[i] = byteArrayToInt(byteArray, i * 4);
@@ -163,6 +165,7 @@ public abstract class ImageValueSemantic
         return newImage;
     }
 
+    @Override
     protected String doEncode(Object object) {
         final int[][] image = getPixels(object);
         final int lines = image.length;
@@ -252,7 +255,8 @@ public abstract class ImageValueSemantic
         }
     }
 
-    protected Object doRestore(final String data) {
+    @Override
+    protected T doRestore(final String data) {
         final int lines = decodePixel(data, 0);
         final int width = decodePixel(data, 1);
         final int[][] imageData = new int[lines][width];
@@ -263,26 +267,30 @@ public abstract class ImageValueSemantic
                 imageData[line][pixel] =imageData[line][pixel] | 0xFF000000; 
             }
         }
-        final Object image = setPixels(imageData);
+        final T image = setPixels(imageData);
         return image;
    }
 
-    protected abstract Object setPixels(int[][] pixels);
+    protected abstract T setPixels(int[][] pixels);
 
     public void setMask(final String mask) {}
 
+    @Override
     public String titleString(final Object value) {
         return "image";
     }
 
+    @Override
     public String titleStringWithMask(Object value, String usingMask) {
         return "image";
     }
     
+    @Override
     public FacetHolder getFacetHolder() {
         return facetHolder;
     }
 
+    @Override
     public void setFacetHolder(final FacetHolder facetHolder) {
         this.facetHolder = facetHolder;
     }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/ImageValueTypeFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/ImageValueTypeFacetFactory.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/ImageValueTypeFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/ImageValueTypeFacetFactory.java Tue Dec 21 12:06:15 2010
@@ -24,7 +24,7 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.MethodRemover;
 
 
-public class ImageValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory {
+public class ImageValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory<org.apache.isis.applib.value.Image> {
 
     public ImageValueTypeFacetFactory() {
         super(ImageValueFacet.class);
@@ -35,7 +35,7 @@ public class ImageValueTypeFacetFactory 
         if (type != org.apache.isis.applib.value.Image.class) {
             return false;
         }
-        addFacets(new ImageValueSemanticsProvider(holder, getConfiguration(), getSpecificationLoader(), getRuntimeContext()));
+        addFacets(new ImageValueSemanticsProvider(holder, getConfiguration(), getContext()));
         return true;
     }
 

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/IntPrimitiveValueSemanticsProvider.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/IntPrimitiveValueSemanticsProvider.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/IntPrimitiveValueSemanticsProvider.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/IntPrimitiveValueSemanticsProvider.java Tue Dec 21 12:06:15 2010
@@ -26,37 +26,30 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facets.FacetHolder;
 import org.apache.isis.core.metamodel.facets.properties.defaults.PropertyDefaultFacet;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
+import org.apache.isis.core.progmodel.facets.object.value.ValueSemanticsProviderContext;
 
 
 public class IntPrimitiveValueSemanticsProvider extends IntValueSemanticsProviderAbstract implements PropertyDefaultFacet {
 
-    private static final Object DEFAULT_VALUE = Integer.valueOf(0);
-
-    static final Class<?> adaptedClass() {
-        return int.class;
-    }
-
     /**
      * Required because implementation of {@link Parser} and {@link EncoderDecoder}.
      */
     public IntPrimitiveValueSemanticsProvider() {
-        this(null, null, null, null);
+        this(null, null, null);
     }
 
     public IntPrimitiveValueSemanticsProvider(
     		final FacetHolder holder,
             final IsisConfiguration configuration,
-            final SpecificationLoader specificationLoader,
-            final RuntimeContext runtimeContext) {
-        super(holder, adaptedClass(), DEFAULT_VALUE, configuration, specificationLoader, runtimeContext);
+            final ValueSemanticsProviderContext context) {
+        super(holder, int.class, configuration, context);
     }
 
     // //////////////////////////////////////////////////////////////////
     // PropertyDefaultFacet
     // //////////////////////////////////////////////////////////////////
 
+    @Override
     public ObjectAdapter getDefault(final ObjectAdapter inObject) {
         return createAdapter(int.class, Integer.valueOf(0));
     }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/IntPrimitiveValueTypeFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/IntPrimitiveValueTypeFacetFactory.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/IntPrimitiveValueTypeFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/IntPrimitiveValueTypeFacetFactory.java Tue Dec 21 12:06:15 2010
@@ -24,7 +24,7 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.MethodRemover;
 
 
-public class IntPrimitiveValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory {
+public class IntPrimitiveValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory<Integer> {
 
     public IntPrimitiveValueTypeFacetFactory() {
         super(IntegerValueFacet.class);
@@ -32,10 +32,10 @@ public class IntPrimitiveValueTypeFacetF
 
     @Override
     public boolean process(final Class<?> type, final MethodRemover methodRemover, final FacetHolder holder) {
-        if (type != IntPrimitiveValueSemanticsProvider.adaptedClass()) {
+        if (type != int.class) {
             return false;
         }
-        addFacets(new IntPrimitiveValueSemanticsProvider(holder, getConfiguration(), getSpecificationLoader(), getRuntimeContext()));
+        addFacets(new IntPrimitiveValueSemanticsProvider(holder, getConfiguration(), getContext()));
         return true;
     }
 

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/IntValueSemanticsProviderAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/IntValueSemanticsProviderAbstract.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/IntValueSemanticsProviderAbstract.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/IntValueSemanticsProviderAbstract.java Tue Dec 21 12:06:15 2010
@@ -29,16 +29,16 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facets.Facet;
 import org.apache.isis.core.metamodel.facets.FacetHolder;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
+import org.apache.isis.core.progmodel.facets.object.value.ValueSemanticsProviderContext;
 
 
-public abstract class IntValueSemanticsProviderAbstract extends ValueSemanticsProviderAbstract implements IntegerValueFacet {
+public abstract class IntValueSemanticsProviderAbstract extends ValueSemanticsProviderAndFacetAbstract<Integer> implements IntegerValueFacet {
 
     public static Class<? extends Facet> type() {
         return IntegerValueFacet.class;
     }
 
+    private static final Integer DEFAULT_VALUE = Integer.valueOf(0);
     private static final int TYPICAL_LENGTH = 9;
     private static final boolean IMMUTABLE = true;
     private static final boolean EQUAL_BY_CONTENT = true;
@@ -46,11 +46,11 @@ public abstract class IntValueSemanticsP
     private final NumberFormat format;
 
     public IntValueSemanticsProviderAbstract(
-    		final FacetHolder holder, final Class<?> adaptedClass, final Object defaultValue,
+    		final FacetHolder holder, 
+    		final Class<Integer> adaptedClass, 
             final IsisConfiguration configuration,
-            final SpecificationLoader specificationLoader,
-            final RuntimeContext runtimeContext) {
-        super(type(), holder, adaptedClass, TYPICAL_LENGTH, IMMUTABLE, EQUAL_BY_CONTENT, defaultValue, configuration, specificationLoader, runtimeContext);
+            final ValueSemanticsProviderContext context) {
+        super(type(), holder, adaptedClass, TYPICAL_LENGTH, IMMUTABLE, EQUAL_BY_CONTENT, DEFAULT_VALUE, configuration, context);
         format = determineNumberFormat("value.format.int");
     }
 
@@ -59,7 +59,7 @@ public abstract class IntValueSemanticsP
     // //////////////////////////////////////////////////////////////////
 
     @Override
-    protected Object doParse(final Object original, final String entry) {
+    protected Integer doParse(final Object context, final String entry) {
         try {
             return Integer.valueOf(format.parse(entry).intValue());
         } catch (final ParseException e) {
@@ -87,7 +87,7 @@ public abstract class IntValueSemanticsP
     }
 
     @Override
-    protected Object doRestore(final String data) {
+    protected Integer doRestore(final String data) {
         return new Integer(data);
     }
 
@@ -95,12 +95,14 @@ public abstract class IntValueSemanticsP
     // IntegerValueFacet
     // //////////////////////////////////////////////////////////////////
 
+    @Override
     public Integer integerValue(final ObjectAdapter object) {
         return (Integer) (object == null ? null : object.getObject());
     }
 
+    @Override
     public ObjectAdapter createValue(final Integer value) {
-        return value == null ? null : getRuntimeContext().adapterFor(value);
+        return value == null ? null : getAdapterMap().adapterFor(value);
     }
 
     // /////// toString ///////

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/IntWrapperValueSemanticsProvider.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/IntWrapperValueSemanticsProvider.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/IntWrapperValueSemanticsProvider.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/IntWrapperValueSemanticsProvider.java Tue Dec 21 12:06:15 2010
@@ -24,31 +24,23 @@ import org.apache.isis.applib.adapters.E
 import org.apache.isis.applib.adapters.Parser;
 import org.apache.isis.core.metamodel.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facets.FacetHolder;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
+import org.apache.isis.core.progmodel.facets.object.value.ValueSemanticsProviderContext;
 
 
 public class IntWrapperValueSemanticsProvider extends IntValueSemanticsProviderAbstract {
 
-    private static final Object DEFAULT_VALUE = Integer.valueOf(0);
-
-    static final Class<?> adaptedClass() {
-        return Integer.class;
-    }
-
     /**
      * Required because implementation of {@link Parser} and {@link EncoderDecoder}.
      */
     public IntWrapperValueSemanticsProvider() {
-        this(null, null, null, null);
+        this(null, null, null);
     }
 
     public IntWrapperValueSemanticsProvider(
     		final FacetHolder holder,
             final IsisConfiguration configuration,
-            final SpecificationLoader specificationLoader,
-            final RuntimeContext runtimeContext) {
-        super(holder, adaptedClass(), DEFAULT_VALUE, configuration, specificationLoader, runtimeContext);
+            final ValueSemanticsProviderContext context) {
+        super(holder, Integer.class, configuration, context);
     }
 
 }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/IntWrapperValueTypeFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/IntWrapperValueTypeFacetFactory.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/IntWrapperValueTypeFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/IntWrapperValueTypeFacetFactory.java Tue Dec 21 12:06:15 2010
@@ -24,7 +24,7 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.MethodRemover;
 
 
-public class IntWrapperValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory {
+public class IntWrapperValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory<Integer> {
 
     public IntWrapperValueTypeFacetFactory() {
         super(IntegerValueFacet.class);
@@ -32,10 +32,10 @@ public class IntWrapperValueTypeFacetFac
 
     @Override
     public boolean process(final Class<?> type, final MethodRemover methodRemover, final FacetHolder holder) {
-        if (type != IntWrapperValueSemanticsProvider.adaptedClass()) {
+        if (type != Integer.class) {
             return false;
         }
-        addFacets(new IntWrapperValueSemanticsProvider(holder, getConfiguration(), getSpecificationLoader(), getRuntimeContext()));
+        addFacets(new IntWrapperValueSemanticsProvider(holder, getConfiguration(), getContext()));
         return true;
     }
 

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaAwtImageValueSemanticsProvider.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaAwtImageValueSemanticsProvider.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaAwtImageValueSemanticsProvider.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaAwtImageValueSemanticsProvider.java Tue Dec 21 12:06:15 2010
@@ -25,21 +25,20 @@ import java.awt.Image;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facets.FacetHolder;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
+import org.apache.isis.core.progmodel.facets.object.value.ValueSemanticsProviderContext;
 
 
-public class JavaAwtImageValueSemanticsProvider extends ImageValueSemanticsProviderAbstract {
+public class JavaAwtImageValueSemanticsProvider extends ImageValueSemanticsProviderAbstract<Image> {
 
     public JavaAwtImageValueSemanticsProvider(
             final FacetHolder holder,
             final IsisConfiguration configuration,
-            final SpecificationLoader specificationLoader,
-            final RuntimeContext runtimeContext) {
-        super(holder, Image.class, configuration, specificationLoader, runtimeContext);
+            final ValueSemanticsProviderContext context) {
+        super(holder, Image.class, configuration, context);
     }
 
-	public int getHeight(final ObjectAdapter object) {
+	@Override
+    public int getHeight(final ObjectAdapter object) {
         return image(object).getHeight(null);
     }
 
@@ -47,6 +46,7 @@ public class JavaAwtImageValueSemanticsP
         return (Image) object.getObject();
     }
 
+    @Override
     public Image getImage(final ObjectAdapter object) {
         return image(object);
     }
@@ -60,17 +60,18 @@ public class JavaAwtImageValueSemanticsP
         return Image.class;
     }
 
+    @Override
     public int getWidth(final ObjectAdapter object) {
         return image(object).getWidth(null);
     }
 
     @Override
-    protected Object setPixels(final int[][] pixels) {
-        final Image image = createImage(pixels);
-        return getRuntimeContext().adapterFor(image);
+    protected Image setPixels(final int[][] pixels) {
+        return createImage(pixels);
     }
 
 
+    @Override
     public boolean isNoop() {
         return false;
     }
@@ -80,8 +81,9 @@ public class JavaAwtImageValueSemanticsP
         return "JavaAwtImageValueSemanticsProvider: ";
     }
 
+    @Override
     public ObjectAdapter createValue(final Image image) {
-        return getRuntimeContext().adapterFor(image);
+        return getAdapterMap().adapterFor(image);
    }
     
 }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaAwtImageValueTypeFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaAwtImageValueTypeFacetFactory.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaAwtImageValueTypeFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaAwtImageValueTypeFacetFactory.java Tue Dec 21 12:06:15 2010
@@ -24,7 +24,7 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.MethodRemover;
 
 
-public class JavaAwtImageValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory {
+public class JavaAwtImageValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory<java.awt.Image> {
 
     public JavaAwtImageValueTypeFacetFactory() {
         super(ImageValueFacet.class);
@@ -35,7 +35,7 @@ public class JavaAwtImageValueTypeFacetF
         if (type != java.awt.Image.class) {
             return false;
         }
-        addFacets(new JavaAwtImageValueSemanticsProvider(holder, getConfiguration(), getSpecificationLoader(), getRuntimeContext()));
+        addFacets(new JavaAwtImageValueSemanticsProvider(holder, getConfiguration(), getContext()));
         return true;
     }
 

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlDateValueSemanticsProvider.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlDateValueSemanticsProvider.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlDateValueSemanticsProvider.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlDateValueSemanticsProvider.java Tue Dec 21 12:06:15 2010
@@ -23,15 +23,14 @@ package org.apache.isis.core.progmodel.f
 import java.sql.Date;
 import java.util.Calendar;
 
+import edu.umd.cs.findbugs.annotations.SuppressWarnings;
+
 import org.apache.isis.applib.adapters.EncoderDecoder;
 import org.apache.isis.applib.adapters.Parser;
 import org.apache.isis.applib.clock.Clock;
 import org.apache.isis.core.metamodel.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facets.FacetHolder;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
-
-import edu.umd.cs.findbugs.annotations.SuppressWarnings;
+import org.apache.isis.core.progmodel.facets.object.value.ValueSemanticsProviderContext;
 
 
 /**
@@ -40,37 +39,36 @@ import edu.umd.cs.findbugs.annotations.S
  * @see JavaUtilDateValueSemanticsProvider
  * @see JavaSqlTimeValueSemanticsProvider
  */
-public class JavaSqlDateValueSemanticsProvider extends DateValueSemanticsProviderAbstract {
+public class JavaSqlDateValueSemanticsProvider extends DateValueSemanticsProviderAbstract<Date> {
 
     private static final boolean IMMUTABLE = false;
     private static final boolean EQUAL_BY_CONTENT = false;
-    private static final Object DEFAULT_VALUE = null; // no default
+    private static final Date DEFAULT_VALUE = null; // no default
 
     /**
      * Required because implementation of {@link Parser} and {@link EncoderDecoder}.
      */
     @SuppressWarnings("NP_NULL_PARAM_DEREF_NONVIRTUAL")
     public JavaSqlDateValueSemanticsProvider() {
-        this(null, null, null, null);
+        this(null, null, null);
     }
 
     public JavaSqlDateValueSemanticsProvider(
     		final FacetHolder holder,
             final IsisConfiguration configuration,
-            final SpecificationLoader specificationLoader,
-            final RuntimeContext runtimeContext) {
-        super(holder, Date.class, IMMUTABLE, EQUAL_BY_CONTENT, DEFAULT_VALUE, configuration, specificationLoader, runtimeContext);
+            final ValueSemanticsProviderContext context) {
+        super(holder, Date.class, IMMUTABLE, EQUAL_BY_CONTENT, DEFAULT_VALUE, configuration, context);
     }
 
     @Override
-    protected Object add(
-            final Object original,
+    protected Date add(
+            final Date original,
             final int years,
             final int months,
             final int days,
             final int hours,
             final int minutes) {
-        final Date date = (Date) original;
+        final Date date = original;
         final Calendar cal = Calendar.getInstance();
         cal.setTime(date);
         cal.set(Calendar.HOUR, 0);
@@ -93,12 +91,12 @@ public class JavaSqlDateValueSemanticsPr
     }
 
     @Override
-    protected Object setDate(final java.util.Date date) {
+    protected Date setDate(final java.util.Date date) {
         return new Date(date.getTime());
     }
 
     @Override
-    protected Object now() {
+    protected Date now() {
         return new Date(Clock.getTime());
     }
 

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlDateValueTypeFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlDateValueTypeFacetFactory.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlDateValueTypeFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlDateValueTypeFacetFactory.java Tue Dec 21 12:06:15 2010
@@ -20,13 +20,13 @@
 
 package org.apache.isis.core.progmodel.facets.value;
 
-import java.sql.Date;
-
+import java.sql.Date;
+
 import org.apache.isis.core.metamodel.facets.FacetHolder;
 import org.apache.isis.core.metamodel.facets.MethodRemover;
 
 
-public class JavaSqlDateValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory {
+public class JavaSqlDateValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory<Date> {
 
     public JavaSqlDateValueTypeFacetFactory() {
         super(DateValueFacet.class); // as per inherited TimeValueSemanticsProvider#facetType (inherited)
@@ -37,7 +37,7 @@ public class JavaSqlDateValueTypeFacetFa
         if (type != Date.class) {
             return false;
         }
-        addFacets(new JavaSqlDateValueSemanticsProvider(holder, getConfiguration(), getSpecificationLoader(), getRuntimeContext()));
+        addFacets(new JavaSqlDateValueSemanticsProvider(holder, getConfiguration(), getContext()));
         return true;
     }
 

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeStampValueSemanticsProvider.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeStampValueSemanticsProvider.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeStampValueSemanticsProvider.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeStampValueSemanticsProvider.java Tue Dec 21 12:06:15 2010
@@ -21,8 +21,13 @@
 package org.apache.isis.core.progmodel.facets.value;
 
 import java.sql.Timestamp;
+import java.text.DateFormat;
 import java.util.Date;
-import java.util.Hashtable;
+import java.util.Map;
+
+import com.google.inject.internal.Maps;
+
+import edu.umd.cs.findbugs.annotations.SuppressWarnings;
 
 import org.apache.isis.applib.adapters.EncoderDecoder;
 import org.apache.isis.applib.adapters.Parser;
@@ -30,19 +35,16 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facets.FacetHolder;
 import org.apache.isis.core.metamodel.facets.properties.defaults.PropertyDefaultFacet;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
-
-import edu.umd.cs.findbugs.annotations.SuppressWarnings;
+import org.apache.isis.core.progmodel.facets.object.value.ValueSemanticsProviderContext;
 
 
-public class JavaSqlTimeStampValueSemanticsProvider extends TimeStampValueSemanticsProviderAbstract {
+public class JavaSqlTimeStampValueSemanticsProvider extends TimeStampValueSemanticsProviderAbstract<java.sql.Timestamp> {
 
     public static final boolean isAPropertyDefaultFacet() {
         return PropertyDefaultFacet.class.isAssignableFrom(JavaSqlTimeStampValueSemanticsProvider.class);
     }
 
-    private static Hashtable formats = new Hashtable();
+    private static Map<String,DateFormat> formats = Maps.newHashMap();
 
     static {
         initFormats(formats);
@@ -53,15 +55,14 @@ public class JavaSqlTimeStampValueSemant
      */
     @SuppressWarnings("NP_NULL_PARAM_DEREF_NONVIRTUAL")
     public JavaSqlTimeStampValueSemanticsProvider() {
-        this(null, null, null, null);
+        this(null, null, null);
     }
 
     public JavaSqlTimeStampValueSemanticsProvider(
             final FacetHolder holder,
             final IsisConfiguration configuration,
-            final SpecificationLoader specificationLoader,
-            final RuntimeContext runtimeContext) {
-        super(holder, configuration, specificationLoader, runtimeContext);
+            final ValueSemanticsProviderContext context) {
+        super(holder, java.sql.Timestamp.class, configuration, context);
     }
 
     // //////////////////////////////////////////////////////////////////
@@ -74,17 +75,17 @@ public class JavaSqlTimeStampValueSemant
     }
 
     @Override
-    protected Hashtable formats() {
+    protected Map<String, DateFormat> formats() {
         return formats;
     }
 
     @Override
-    protected Object now() {
+    protected Timestamp now() {
         throw new InvalidEntryException("Can't change a timestamp.");
     }
 
     @Override
-    protected Object setDate(final Date date) {
+    protected Timestamp setDate(final Date date) {
         return new Timestamp(date.getTime());
     }
 

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeStampValueTypeFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeStampValueTypeFacetFactory.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeStampValueTypeFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeStampValueTypeFacetFactory.java Tue Dec 21 12:06:15 2010
@@ -24,7 +24,7 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.MethodRemover;
 
 
-public class JavaSqlTimeStampValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory {
+public class JavaSqlTimeStampValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory<java.sql.Timestamp> {
 
     public JavaSqlTimeStampValueTypeFacetFactory() {
         super(DateValueFacet.class); // as per inherited DateTimeValueSemanticsProvider#facetType
@@ -36,7 +36,7 @@ public class JavaSqlTimeStampValueTypeFa
         if (type != java.sql.Timestamp.class) {
             return false;
         }
-        addFacets(new JavaSqlTimeStampValueSemanticsProvider(holder, getConfiguration(), getSpecificationLoader(), getRuntimeContext()));
+        addFacets(new JavaSqlTimeStampValueSemanticsProvider(holder, getConfiguration(), getContext()));
         return true;
     }
 

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeValueSemanticsProvider.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeValueSemanticsProvider.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeValueSemanticsProvider.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeValueSemanticsProvider.java Tue Dec 21 12:06:15 2010
@@ -21,27 +21,29 @@
 package org.apache.isis.core.progmodel.facets.value;
 
 import java.sql.Time;
+import java.text.DateFormat;
 import java.util.Calendar;
 import java.util.Date;
-import java.util.Hashtable;
+import java.util.Map;
+
+import com.google.inject.internal.Maps;
+
+import edu.umd.cs.findbugs.annotations.SuppressWarnings;
 
 import org.apache.isis.applib.adapters.EncoderDecoder;
 import org.apache.isis.applib.adapters.Parser;
 import org.apache.isis.applib.clock.Clock;
 import org.apache.isis.core.metamodel.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facets.FacetHolder;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
-
-import edu.umd.cs.findbugs.annotations.SuppressWarnings;
+import org.apache.isis.core.progmodel.facets.object.value.ValueSemanticsProviderContext;
 
 
 /**
  * Treats {@link java.sql.Time} as a time-only value type.
  *
  */
-public class JavaSqlTimeValueSemanticsProvider extends TimeValueSemanticsProviderAbstract {
-    private static Hashtable formats = new Hashtable();
+public class JavaSqlTimeValueSemanticsProvider extends TimeValueSemanticsProviderAbstract<java.sql.Time> {
+    private static Map<String, DateFormat> formats = Maps.newHashMap();
 
     static {
         initFormats(formats);
@@ -52,20 +54,19 @@ public class JavaSqlTimeValueSemanticsPr
      */
     @SuppressWarnings("NP_NULL_PARAM_DEREF_NONVIRTUAL")
     public JavaSqlTimeValueSemanticsProvider() {
-        this(null, null, null, null);
+        this(null, null, null);
     }
 
     public JavaSqlTimeValueSemanticsProvider(
     		final FacetHolder holder,
             final IsisConfiguration configuration,
-            final SpecificationLoader specificationLoader,
-            final RuntimeContext runtimeContext) {
-        super(holder, java.sql.Time.class, configuration, specificationLoader, runtimeContext);
+            final ValueSemanticsProviderContext context) {
+        super(holder, java.sql.Time.class, configuration, context);
     }
 
     @Override
-    public Object add(final Object original, final int years, final int months, final int days, final int hours, final int minutes) {
-        final java.sql.Time time = (Time) original;
+    public Time add(final Time original, final int years, final int months, final int days, final int hours, final int minutes) {
+        final java.sql.Time time = original;
         final Calendar cal = Calendar.getInstance();
         cal.setTime(time);
         cal.set(Calendar.YEAR, 0);
@@ -86,17 +87,17 @@ public class JavaSqlTimeValueSemanticsPr
     }
 
     @Override
-    protected Hashtable formats() {
+    protected Map<String, DateFormat> formats() {
         return formats;
     }
 
     @Override
-    protected Object now() {
+    protected Time now() {
         return new java.sql.Time(Clock.getTime());
     }
 
     @Override
-    protected Object setDate(final Date date) {
+    protected Time setDate(final Date date) {
         return new java.sql.Time(date.getTime());
     }
 

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeValueTypeFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeValueTypeFacetFactory.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeValueTypeFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeValueTypeFacetFactory.java Tue Dec 21 12:06:15 2010
@@ -24,7 +24,7 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.MethodRemover;
 
 
-public class JavaSqlTimeValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory {
+public class JavaSqlTimeValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory<java.sql.Time> {
 
     public JavaSqlTimeValueTypeFacetFactory() {
         super(DateValueFacet.class); // as per inherited TimeValueSemanticsProvider#facetType (inherited)
@@ -35,7 +35,7 @@ public class JavaSqlTimeValueTypeFacetFa
         if (type != java.sql.Time.class) {
             return false;
         }
-        addFacets(new JavaSqlTimeValueSemanticsProvider(holder, getConfiguration(), getSpecificationLoader(), getRuntimeContext()));
+        addFacets(new JavaSqlTimeValueSemanticsProvider(holder, getConfiguration(), getContext()));
         return true;
     }
 

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaUtilDateValueSemanticsProvider.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaUtilDateValueSemanticsProvider.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaUtilDateValueSemanticsProvider.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaUtilDateValueSemanticsProvider.java Tue Dec 21 12:06:15 2010
@@ -23,15 +23,14 @@ package org.apache.isis.core.progmodel.f
 import java.util.Calendar;
 import java.util.Date;
 
+import edu.umd.cs.findbugs.annotations.SuppressWarnings;
+
 import org.apache.isis.applib.adapters.EncoderDecoder;
 import org.apache.isis.applib.adapters.Parser;
 import org.apache.isis.applib.clock.Clock;
 import org.apache.isis.core.metamodel.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facets.FacetHolder;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
-
-import edu.umd.cs.findbugs.annotations.SuppressWarnings;
+import org.apache.isis.core.progmodel.facets.object.value.ValueSemanticsProviderContext;
 
 
 /**
@@ -40,7 +39,7 @@ import edu.umd.cs.findbugs.annotations.S
  * @see JavaSqlDateValueSemanticsProvider
  * @see JavaSqlTimeValueSemanticsProvider
  */
-public class JavaUtilDateValueSemanticsProvider extends JavaUtilDateValueSemanticsProviderAbstract {
+public class JavaUtilDateValueSemanticsProvider extends DateAndTimeValueSemanticsProviderAbstract<java.util.Date> {
 
     private static final boolean IMMUTABLE = false;
     private static final boolean EQUAL_BY_CONTENT = false;
@@ -50,15 +49,14 @@ public class JavaUtilDateValueSemanticsP
      */
     @SuppressWarnings("NP_NULL_PARAM_DEREF_NONVIRTUAL")
     public JavaUtilDateValueSemanticsProvider() {
-        this(null, null, null, null);
+        this(null, null, null);
     }
 
     public JavaUtilDateValueSemanticsProvider(
     		final FacetHolder holder,
             final IsisConfiguration configuration,
-            final SpecificationLoader specificationLoader,
-            final RuntimeContext runtimeContext) {
-        super(holder, Date.class, IMMUTABLE, EQUAL_BY_CONTENT, configuration, specificationLoader, runtimeContext);
+            final ValueSemanticsProviderContext context) {
+        super(holder, Date.class, IMMUTABLE, EQUAL_BY_CONTENT, configuration, context);
     }
 
     @Override
@@ -67,14 +65,14 @@ public class JavaUtilDateValueSemanticsP
     }
 
     @Override
-    protected Object add(
-            final Object original,
+    protected Date add(
+            final Date original,
             final int years,
             final int months,
             final int days,
             final int hours,
             final int minutes) {
-        final Date date = (Date) original;
+        final Date date = original;
         final Calendar cal = Calendar.getInstance();
         cal.setTime(date);
         cal.set(Calendar.SECOND, 0);
@@ -90,12 +88,12 @@ public class JavaUtilDateValueSemanticsP
     }
 
     @Override
-    protected Object now() {
+    protected Date now() {
         return new Date(Clock.getTime());
     }
 
     @Override
-    protected Object setDate(final Date date) {
+    protected Date setDate(final Date date) {
         return date;
     }
 }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaUtilDateValueTypeFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaUtilDateValueTypeFacetFactory.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaUtilDateValueTypeFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/JavaUtilDateValueTypeFacetFactory.java Tue Dec 21 12:06:15 2010
@@ -20,13 +20,13 @@
 
 package org.apache.isis.core.progmodel.facets.value;
 
-import java.util.Date;
-
+import java.util.Date;
+
 import org.apache.isis.core.metamodel.facets.FacetHolder;
 import org.apache.isis.core.metamodel.facets.MethodRemover;
 
 
-public class JavaUtilDateValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory {
+public class JavaUtilDateValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory<Date> {
 
     public JavaUtilDateValueTypeFacetFactory() {
         super(DateValueFacet.class); // as per inherited TimeValueSemanticsProvider#facetType (inherited)
@@ -37,7 +37,7 @@ public class JavaUtilDateValueTypeFacetF
         if (type != Date.class) {
             return false;
         }
-        addFacets(new JavaUtilDateValueSemanticsProvider(holder, getConfiguration(), getSpecificationLoader(), getRuntimeContext()));
+        addFacets(new JavaUtilDateValueSemanticsProvider(holder, getConfiguration(), getContext()));
         return true;
     }
 

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/LongPrimitiveValueSemanticsProvider.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/LongPrimitiveValueSemanticsProvider.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/LongPrimitiveValueSemanticsProvider.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/LongPrimitiveValueSemanticsProvider.java Tue Dec 21 12:06:15 2010
@@ -26,37 +26,31 @@ import org.apache.isis.core.metamodel.ad
 import org.apache.isis.core.metamodel.config.IsisConfiguration;
 import org.apache.isis.core.metamodel.facets.FacetHolder;
 import org.apache.isis.core.metamodel.facets.properties.defaults.PropertyDefaultFacet;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
+import org.apache.isis.core.progmodel.facets.object.value.ValueSemanticsProviderContext;
 
 
 public class LongPrimitiveValueSemanticsProvider extends LongValueSemanticsProviderAbstract implements PropertyDefaultFacet {
 
-    private static final Object DEFAULT_VALUE = Long.valueOf(0L);
-
-    static final Class<?> adaptedClass() {
-        return long.class;
-    }
 
     /**
      * Required because implementation of {@link Parser} and {@link EncoderDecoder}.
      */
     public LongPrimitiveValueSemanticsProvider() {
-        this(null, null, null, null);
+        this(null, null, null);
     }
 
     public LongPrimitiveValueSemanticsProvider(
     		final FacetHolder holder,
             final IsisConfiguration configuration,
-            final SpecificationLoader specificationLoader,
-            final RuntimeContext runtimeContext) {
-        super(holder, adaptedClass(), DEFAULT_VALUE, configuration, specificationLoader, runtimeContext);
+            final ValueSemanticsProviderContext context) {
+        super(holder, long.class, configuration, context);
     }
 
     // //////////////////////////////////////////////////////////////////
     // PropertyDefaultFacet
     // //////////////////////////////////////////////////////////////////
 
+    @Override
     public ObjectAdapter getDefault(final ObjectAdapter inObject) {
         return createAdapter(long.class, Long.valueOf(0L));
     }

Modified: incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/LongPrimitiveValueTypeFacetFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/LongPrimitiveValueTypeFacetFactory.java?rev=1051471&r1=1051470&r2=1051471&view=diff
==============================================================================
--- incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/LongPrimitiveValueTypeFacetFactory.java (original)
+++ incubator/isis/trunk/core/progmodel/src/main/java/org/apache/isis/core/progmodel/facets/value/LongPrimitiveValueTypeFacetFactory.java Tue Dec 21 12:06:15 2010
@@ -24,7 +24,7 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.MethodRemover;
 
 
-public class LongPrimitiveValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory {
+public class LongPrimitiveValueTypeFacetFactory extends ValueUsingValueSemanticsProviderFacetFactory<Long> {
 
     public LongPrimitiveValueTypeFacetFactory() {
         super(LongValueFacet.class);
@@ -32,10 +32,10 @@ public class LongPrimitiveValueTypeFacet
 
     @Override
     public boolean process(final Class<?> type, final MethodRemover methodRemover, final FacetHolder holder) {
-        if (type != LongPrimitiveValueSemanticsProvider.adaptedClass()) {
+        if (type != long.class) {
             return false;
         }
-        addFacets(new LongPrimitiveValueSemanticsProvider(holder, getConfiguration(), getSpecificationLoader(), getRuntimeContext()));
+        addFacets(new LongPrimitiveValueSemanticsProvider(holder, getConfiguration(), getContext()));
         return true;
     }
 



Mime
View raw message