You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2021/11/15 09:24:08 UTC

[isis] branch master updated: ISIS-2882: replaces IConverter based on ValueSemantics

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new 41a5b22  ISIS-2882: replaces IConverter<Short/Int/Long/BigInt> based on ValueSemantics
41a5b22 is described below

commit 41a5b22bc29077578f8117e237455c42ef90e083
Author: Andi Huber <ah...@apache.org>
AuthorDate: Mon Nov 15 10:24:00 2021 +0100

    ISIS-2882: replaces IConverter<Short/Int/Long/BigInt> based on
    ValueSemantics
---
 .../model/converter/BigIntegerConverterWkt.java    | 34 ++++++++++++++++++++++
 .../model/converter/IntegerConverterWkt.java       | 32 ++++++++++++++++++++
 .../wicket/model/converter/LongConverterWkt.java   | 32 ++++++++++++++++++++
 .../wicket/model/converter/ShortConverterWkt.java  | 32 ++++++++++++++++++++
 .../scalars/jdkmath/JavaMathBigIntegerPanel.java   |  4 +--
 .../components/scalars/primitive/IntegerPanel.java |  4 +--
 .../ui/components/scalars/primitive/LongPanel.java |  4 +--
 .../components/scalars/primitive/ShortPanel.java   |  4 +--
 8 files changed, 138 insertions(+), 8 deletions(-)

diff --git a/viewers/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/converter/BigIntegerConverterWkt.java b/viewers/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/converter/BigIntegerConverterWkt.java
new file mode 100644
index 0000000..eb78a47
--- /dev/null
+++ b/viewers/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/converter/BigIntegerConverterWkt.java
@@ -0,0 +1,34 @@
+/*
+ *  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.viewer.wicket.model.converter;
+
+import java.math.BigInteger;
+
+import org.apache.isis.viewer.wicket.model.models.ScalarModel;
+
+public class BigIntegerConverterWkt
+extends ConverterBasedOnValueSemantics<BigInteger> {
+
+    private static final long serialVersionUID = 1L;
+
+    public BigIntegerConverterWkt(final ScalarModel scalarModel) {
+        super(scalarModel);
+    }
+
+}
diff --git a/viewers/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/converter/IntegerConverterWkt.java b/viewers/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/converter/IntegerConverterWkt.java
new file mode 100644
index 0000000..b5dc5f9
--- /dev/null
+++ b/viewers/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/converter/IntegerConverterWkt.java
@@ -0,0 +1,32 @@
+/*
+ *  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.viewer.wicket.model.converter;
+
+import org.apache.isis.viewer.wicket.model.models.ScalarModel;
+
+public class IntegerConverterWkt
+extends ConverterBasedOnValueSemantics<Integer> {
+
+    private static final long serialVersionUID = 1L;
+
+    public IntegerConverterWkt(final ScalarModel scalarModel) {
+        super(scalarModel);
+    }
+
+}
diff --git a/viewers/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/converter/LongConverterWkt.java b/viewers/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/converter/LongConverterWkt.java
new file mode 100644
index 0000000..2ba392c
--- /dev/null
+++ b/viewers/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/converter/LongConverterWkt.java
@@ -0,0 +1,32 @@
+/*
+ *  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.viewer.wicket.model.converter;
+
+import org.apache.isis.viewer.wicket.model.models.ScalarModel;
+
+public class LongConverterWkt
+extends ConverterBasedOnValueSemantics<Long> {
+
+    private static final long serialVersionUID = 1L;
+
+    public LongConverterWkt(final ScalarModel scalarModel) {
+        super(scalarModel);
+    }
+
+}
diff --git a/viewers/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/converter/ShortConverterWkt.java b/viewers/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/converter/ShortConverterWkt.java
new file mode 100644
index 0000000..267ac7d
--- /dev/null
+++ b/viewers/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/converter/ShortConverterWkt.java
@@ -0,0 +1,32 @@
+/*
+ *  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.viewer.wicket.model.converter;
+
+import org.apache.isis.viewer.wicket.model.models.ScalarModel;
+
+public class ShortConverterWkt
+extends ConverterBasedOnValueSemantics<Short> {
+
+    private static final long serialVersionUID = 1L;
+
+    public ShortConverterWkt(final ScalarModel scalarModel) {
+        super(scalarModel);
+    }
+
+}
diff --git a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jdkmath/JavaMathBigIntegerPanel.java b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jdkmath/JavaMathBigIntegerPanel.java
index 5575e7b..ea3bb5d 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jdkmath/JavaMathBigIntegerPanel.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jdkmath/JavaMathBigIntegerPanel.java
@@ -22,8 +22,8 @@ import java.math.BigInteger;
 
 import org.apache.wicket.markup.html.form.AbstractTextComponent;
 import org.apache.wicket.util.convert.IConverter;
-import org.apache.wicket.util.convert.converter.BigIntegerConverter;
 
+import org.apache.isis.viewer.wicket.model.converter.BigIntegerConverterWkt;
 import org.apache.isis.viewer.wicket.model.models.ScalarModel;
 import org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelTextFieldNumeric;
 import org.apache.isis.viewer.wicket.ui.util.Wkt;
@@ -53,7 +53,7 @@ extends ScalarPanelTextFieldNumeric<BigInteger> {
 
     @Override
     protected IConverter<BigInteger> getConverter(final ScalarModel scalarModel) {
-        return new BigIntegerConverter();
+        return new BigIntegerConverterWkt(scalarModel);
     }
 
 }
diff --git a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/primitive/IntegerPanel.java b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/primitive/IntegerPanel.java
index ee4e678..72cb601 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/primitive/IntegerPanel.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/primitive/IntegerPanel.java
@@ -20,8 +20,8 @@ package org.apache.isis.viewer.wicket.ui.components.scalars.primitive;
 
 import org.apache.wicket.markup.html.form.AbstractTextComponent;
 import org.apache.wicket.util.convert.IConverter;
-import org.apache.wicket.util.convert.converter.IntegerConverter;
 
+import org.apache.isis.viewer.wicket.model.converter.IntegerConverterWkt;
 import org.apache.isis.viewer.wicket.model.models.ScalarModel;
 import org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelTextFieldNumeric;
 import org.apache.isis.viewer.wicket.ui.util.Wkt;
@@ -50,7 +50,7 @@ public class IntegerPanel extends ScalarPanelTextFieldNumeric<Integer> {
 
     @Override
     protected IConverter<Integer> getConverter(final ScalarModel scalarModel) {
-        return IntegerConverter.INSTANCE;
+        return new IntegerConverterWkt(scalarModel);
     }
 
 }
diff --git a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/primitive/LongPanel.java b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/primitive/LongPanel.java
index 6e0152c..20562a8 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/primitive/LongPanel.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/primitive/LongPanel.java
@@ -20,8 +20,8 @@ package org.apache.isis.viewer.wicket.ui.components.scalars.primitive;
 
 import org.apache.wicket.markup.html.form.AbstractTextComponent;
 import org.apache.wicket.util.convert.IConverter;
-import org.apache.wicket.util.convert.converter.LongConverter;
 
+import org.apache.isis.viewer.wicket.model.converter.LongConverterWkt;
 import org.apache.isis.viewer.wicket.model.models.ScalarModel;
 import org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelTextFieldNumeric;
 import org.apache.isis.viewer.wicket.ui.util.Wkt;
@@ -50,7 +50,7 @@ public class LongPanel extends ScalarPanelTextFieldNumeric<Long> {
 
     @Override
     protected IConverter<Long> getConverter(final ScalarModel scalarModel) {
-        return LongConverter.INSTANCE;
+        return new LongConverterWkt(scalarModel);
     }
 
 }
diff --git a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/primitive/ShortPanel.java b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/primitive/ShortPanel.java
index f986d28..b9ae2ff 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/primitive/ShortPanel.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/primitive/ShortPanel.java
@@ -20,8 +20,8 @@ package org.apache.isis.viewer.wicket.ui.components.scalars.primitive;
 
 import org.apache.wicket.markup.html.form.AbstractTextComponent;
 import org.apache.wicket.util.convert.IConverter;
-import org.apache.wicket.util.convert.converter.ShortConverter;
 
+import org.apache.isis.viewer.wicket.model.converter.ShortConverterWkt;
 import org.apache.isis.viewer.wicket.model.models.ScalarModel;
 import org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelTextFieldNumeric;
 import org.apache.isis.viewer.wicket.ui.util.Wkt;
@@ -50,6 +50,6 @@ public class ShortPanel extends ScalarPanelTextFieldNumeric<Short> {
 
     @Override
     protected IConverter<Short> getConverter(final ScalarModel scalarModel) {
-        return ShortConverter.INSTANCE;
+        return new ShortConverterWkt(scalarModel);
     }
 }